Add Author Profile box to PAGES

Community Forums Forums General Discussion Add Author Profile box to PAGES

This topic is: resolved

This topic contains 9 replies, has 2 voices, and was last updated by  sandnsurf 2 months, 2 weeks ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #111028

    sandnsurf
    Participant
    Post count: 6

    Hello

    I am having difficulty adding the author profile box to pages on my website (http://lifeinthefastlane.com)
    I am running WP 3.9.1 and the Magazine Pro Theme

    This was working a few months ago, but is no longer working. A couple of the edits I have made (such as modify gravatar size) have also failed to persist following recent upgrade to WP 3.9.1

    I have followed the forums and the number of posts relating to author profile box on pages and went with the following code (as I was unable to find the old thread where somebody very ably assisted with this query)

    functions.php code:

    add_action(‘genesis_after_post’, ‘genesis_do_author_box’);
    function genesis_do_author_box_page() {
    if ( !is_page() )
    return;

    if ( get_the_author_meta(‘genesis_author_box_single’, get_the_author_meta(‘ID’) ) ) {
    genesis_author_box(‘single)’);
    }
    }

    http://lifeinthefastlane.com
    #111034

    braddalton
    Participant
    Post count: 9721

    The loop hooks have changed for HTML 5 themes so genesis_after_post needs to be changed in the code.

    http://my.studiopress.com/docs/genesis-loop-hooks-comparison/


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #111036

    sandnsurf
    Participant
    Post count: 6

    Thank you @braddalton
    Have updated the code to:

    add_action(‘genesis_after_entry’, ‘genesis_do_author_box’);
    function genesis_do_author_box_page() {
    if ( !is_page() )
    return;

    if ( get_the_author_meta(‘genesis_author_box_single’, get_the_author_meta(‘ID’) ) ) {
    genesis_author_box(‘single)’);
    }
    }

    No luck as yet
    Will revisit all functions.php to see what I am missing

    Mike

    #111054

    braddalton
    Participant
    Post count: 9721

    I tested this code and it worked on a single static page.

    Please copy ALL the code from the view raw link and paste it at the end of your child themes functions.php file using a text editor like Notepad++

    You can also modify the conditional tag and hook.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #111056

    sandnsurf
    Participant
    Post count: 6

    Thank you @braddaltonit worked!

    You are a scholar and a gentleman

    #111058

    sandnsurf
    Participant
    Post count: 6

    …and finally if I wanted to put the author box ‘above the comments’ as per the other post on the blog…could I modify your code from here (http://wpsites.net/best-plugins/re-positioning-shareaholic-sharing-buttons-after-author-box/)?

    //* Reposition Author Box
    remove_action( ‘genesis_after_entry’, ‘genesis_do_author_box_single’, 8 );
    add_action( ‘genesis_entry_content’, ‘genesis_do_author_box_single’, 11 );

    //* Hook Shareaholic Apps in Manually
    function hook_shareaholic_buttons_genesis() {
    if (is_singular(‘post’) ) {
    echo do_shortcode (‘[shareaholic app="share_buttons" id="562884"]‘);
    echo do_shortcode (‘[shareaholic app="recommendations" id="<insert shareaholic app ID here>"]‘);
    }
    };
    /**
    * @author Brad Dalton – WP Sites
    * @example http://wpsites.net/best-plugins/re-positioning-shareaholic-sharing-buttons-after-author-box/
    */
    add_action(‘genesis_entry_footer’, ‘hook_shareaholic_buttons_genesis’, 5 );

    #111071

    braddalton
    Participant
    Post count: 9721

    I think you could change the hook to genesis_entry_footer

    You van also use the 3rd parameter for positioning priority http://wpsites.net/web-design/3rd-parameter-action-hooks/


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #111254

    sandnsurf
    Participant
    Post count: 6

    Thanks so much @braddalton

    Final solution below (changing hook from genesis_after_entry to genesis_before_comments) moved the author box on pages from below to above comments and trackbacks…

    /** Add Genesis Author Box on Single Pages**/
    add_action(‘genesis_before_comments’, ‘add_author_box_singular_pages’);
    /**
    * @link http://wpsmith.net/2011/genesis/add-the-genesis-author-box-to-pages/
    */
    function add_author_box_singular_pages() {
    if ( !is_page())
    return;
    if ( get_the_author_meta( ‘genesis_author_box_single’, get_the_author_meta(‘ID’) ) ) {
    genesis_author_box( ‘single’ );
    }
    }

    #111047

    sandnsurf
    Participant
    Post count: 6

    Have reviewed relevant posts on forum such as here and here

    I understand that the previous code was for XHTML so changed functions.php as per @braddalton with no effect

    Not sure what to add next – so I added the global author box code
    //* Display author box on single posts
    add_filter( ‘get_the_author_genesis_author_box_single’, ‘__return_true’ );

    and

    //* Display author box on archive pages
    add_filter( ‘get_the_author_genesis_author_box_archive’, ‘__return_true’ );

    Will continue to try and fix, but if anyone has anymore suggestions, would love to hear them

    Mike

    #111049

    sandnsurf
    Participant
    Post count: 6

    Have reviewed relevant posts on forum such as here . I understand that the previous code was for XHTML so changed functions.php as per @braddalton with no effect

    Not sure what to add next – so have added the global author box code

    //* Display author box on single posts
    add_filter( ‘get_the_author_genesis_author_box_single’, ‘__return_true’ );

    and

    //* Display author box on archive pages
    add_filter( ‘get_the_author_genesis_author_box_archive’, ‘__return_true’ );

    Will continue to try and fix, but if anyone has anymore suggestions, would love to hear them

    Mike

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

You must be logged in to reply to this topic.