Community Forums › Forums › Archived Forums › Design Tips and Tricks › Display Author Box before Comments on a Page
Tagged: author box, genesis_author_box_single, studio pro
- This topic has 3 replies, 3 voices, and was last updated 7 years, 11 months ago by
SEO Expert India.
-
AuthorPosts
-
March 2, 2018 at 8:00 am #217214
Timothy Mayo
MemberHi All,
Would really appreciate some help on this, it's driving me crazy!
I have the author box displaying on pages using the following code:
==========
add_action( 'genesis_entry_footer', 'genesis_do_author_box_page' );
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' );
}
}
==========When comments for the page are disabled this works fine and displays the author box at the bottom of my pages after my social share buttons.
However, when I enable comments for the page, the author box gets pushed to below the comments. I don't want this to happen. I want it to display directly underneath the social share buttons like it does on posts.
I've tried using both genesis_entry_content and genesis_entry_footer, but they both still place the author box below the comments.
You can see an example of what I mean on this page here:
And on this post you can see how I'd like it to work:
I'm not a coder, I just hack things until they work. But I can't solve this one.
Any help would be much appreciated. I'm using the 3rd party theme Studio Pro from SEO Themes.
Also if anyone knows of a plugin than can be used to enable/disable post info like date and author easily on pages, that would be great! I'm using a workaround for this right now, but it's not ideal.
Many thanks!
https://www.alphashooters.com/compare/sony-a7ii-vs-a7iii/
TimMarch 2, 2018 at 7:35 pm #217232Brad Dalton
ParticipantMarch 2, 2018 at 11:56 pm #217242SEO Expert India
MemberThanks Braddalto !
I have changed the the Genesis hook but still facing the same issue.
SEO expert just what you needed –
http://seoexpertindia.net/March 3, 2018 at 5:46 am #217248Timothy Mayo
MemberGreat thanks Brad. I changed the hook to genesis_before_comments and this did the trick.
Here's the code for anyone who wants to add an author box to pages and have it appear before the comments. It also still displays correctly on pages where I don't have comments turned on.
========
// Add the author box on single pages before comments.
add_action( 'genesis_before_comments', 'genesis_do_author_box_page' );
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' );
}
}
======= -
AuthorPosts
- The topic ‘Display Author Box before Comments on a Page’ is closed to new replies.