Community Forums › Forums › Archived Forums › General Discussion › Add Author Profile box to PAGES
Tagged: Author Profile, Magazine Pro, pages
- This topic has 9 replies, 2 voices, and was last updated 10 years, 7 months ago by sandnsurf.
-
AuthorPosts
-
June 22, 2014 at 2:15 am #111028sandnsurfMember
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 ThemeThis 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') ) ) {
http://lifeinthefastlane.com
genesis_author_box('single)');
}
}June 22, 2014 at 4:48 am #111034Brad DaltonParticipantThe 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/
June 22, 2014 at 5:03 am #111036sandnsurfMemberThank 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 missingMike
June 22, 2014 at 7:04 am #111054Brad DaltonParticipantI 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.
June 22, 2014 at 7:15 am #111056sandnsurfMemberThank you @braddalton - it worked!
You are a scholar and a gentleman
June 22, 2014 at 7:42 am #111058sandnsurfMember...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 );June 22, 2014 at 9:31 am #111071Brad DaltonParticipantI 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/
June 23, 2014 at 7:16 pm #111254sandnsurfMemberThanks 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' );
}
}June 29, 2014 at 6:30 am #111047sandnsurfMemberHave 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
July 2, 2014 at 11:27 am #111049sandnsurfMemberHave 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
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.