Author Box on Pages above Comments

Community Forums Forums Design Tips and Tricks Author Box on Pages above Comments

This topic is: not resolved

Tagged: ,

This topic contains 2 replies, has 2 voices, and was last updated by  Dan B 1 year, 3 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #12603

    Mane60
    Participant
    Post count: 12

    I raised this question with support, and Jennifer answered me very quickly to solve it. She also suggested it would be a good topic for the forum, so here it is:

    I was trying to get the Author Box to show on pages as well as posts.

    I added the following to functions.php so that pages could show an authorbox.

    /** Add Genesis Author Box on Single Pages**/
    add_action(‘genesis_after_post’, ‘genesis_do_author_box_page’);
    function genesis_do_author_box_page() {
    $page_exclusions = array(‘about-me’,’Contact’); //edit these pages, can take slugs, page names, or page/post ID
    if ( ( !is_page() ) || is_page($page_exclusions) )
    return;
    if ( get_the_author_meta( ‘genesis_author_box_single’, get_the_author_meta(‘ID’) ) ) {
    genesis_author_box( ‘single’ );
    }
    }
    I found the method here:

    http://wpsmith.net/2011/genesis/add-the-genesis-author-box-to-pages/

    Unfortunately, the authorbox showed up below comments on pages, which wasn’t ideal.

    To get it above the comments, you can use a priority to try to move it where you want. In this case, 5 is the priority number. So we edit just one line of the above code to add the priority:

    add_action(‘genesis_after_post’, ‘genesis_do_author_box_page’, 5);

    I hope this helps someone out there. :)

    • This topic was modified 1 year, 9 months ago by  Mane60.
    • This topic was modified 1 year, 9 months ago by  Mane60. Reason: The gist method didn't show the code
    • This topic was modified 1 year, 9 months ago by  Mane60.
    • This topic was modified 1 year, 9 months ago by  Mane60. Reason: The gist method didn't show the code
    #12605

    Mane60
    Participant
    Post count: 12
    #47431

    Dan B
    Participant
    Post count: 26

    Thanks Mane60. Just a note for all future forum searchers:

    1) Be sure you have globally enabled the Author Box in your theme (if it’s not already so), otherwise the instructions above have no effect.

    2) Ensure you have copied the code in the proper format. I copied, originally, from the post above and had formatting errors (with all the ‘s turning into ’s). You can prevent this by getting the code directly from http://wpsmith.net/2011/genesis/add-the-genesis-author-box-to-pages/


    Dan @ ZindaMedia
    Freelance web development and design for non-profits and small businesses.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.