Author Box on Pages above Comments

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

This topic is: not resolved

This topic contains 1 reply, has 1 voice, and was last updated by  Mane60 5 months ago.

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

    Mane60
    Participant
    Post count: 11

    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 5 months ago by  Mane60.
    • This topic was modified 5 months ago by  Mane60. Reason: The gist method didn't show the code
    • This topic was modified 5 months ago by  Mane60.
    • This topic was modified 5 months ago by  Mane60. Reason: The gist method didn't show the code
    #12605

    Mane60
    Participant
    Post count: 11
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.