The guest author function doesn't work everywhere..
-
It works fine on the admin side, but the front-end is not displaying the guest authors name as it should. The instructions for adding the guest author to my template are here. https://vip.wordpress.com/documentati…to-your-theme/.
I added the suggested code to my custom-functions.php file
Code:if ( function_exists( 'coauthors_posts_links' ) ) { coauthors_posts_links(); } else { the_author_posts_link(); }
Nothing seemed to happen.. so then I tried this:
Code:
function guest_author_shortcode( $attr ) { $attr = shortcode_atts( array( 'before' => '', 'after' => '' ), $attr ); if ( function_exists( 'coauthors_posts_links' ) ) { $author = coauthors_posts_links( null, null, null, null, false ); } else { $author = '<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '" title="' . esc_attr( get_the_author_meta( 'display_name' ) ) . '">' . get_the_author_meta( 'display_name' ) . '</a></span>'; } return $attr['before'] . $author . $attr['after']; }
This is the result..
So here is the guest authors profile page:
http: // eitestsite(dot)eyeitalia(dot)com/author/sonia-bieber/And you can see the one article she has written.. However, when you go to the direct link to the article: http: // eitestsite(dot)eyeitalia(dot)com/2013/08/15/experience-tuscany-from-the-decks-of-your-own-yacht/, you’ll see that my name is listed as the author..
I know I’m missing something, but honestly, I’m tired and confused, and since PHP is not my first (or second language) I’m not sure how to get this to work.. Could use a hand from the much wiser members of this community.. Can someone lend a lady a hand.. PRETTY PLEASE.. what the heck am I missing..
- The topic ‘The guest author function doesn't work everywhere..’ is closed to new replies.