Community Forums › Forums › Archived Forums › Design Tips and Tricks › Authors Name on Post Meta NOT showing on individual posts
Tagged: author name, get_the_author, post meta, post_author_posts_link
- This topic has 15 replies, 3 voices, and was last updated 5 years, 4 months ago by itzsnider.
-
AuthorPosts
-
May 28, 2019 at 12:52 pm #491379itzsniderParticipant
I am trying to add the Authors name to a single page and it's not showing BUT on the author archive it shows fine or blog archive it shows fine, what am I missing?
Here is the code I am using in my functions.php
//* Customize the post info function add_filter( 'genesis_post_info', 'mfs_post_info_filter' ); function mfs_post_info_filter($post_info) { if ( !is_page() ) { $post_info = 'Published on[post_date] by [post_author_posts_link]'; return $post_info; } }
Blog page here - https://www.regenerationministries.org/category/blog/ - author names show
Article itself here - https://www.regenerationministries.org/grief-and-letting-go-of-sin/ - misisng author name
Josh's name shows on each of the articles on the Blog page - on the Article itself it just says PUBLISHED ON MAY 22, 2019 BY
Any ideas would be great
https://www.regenerationministries.org/grief-and-letting-go-of-sin/May 28, 2019 at 1:13 pm #491381itzsniderParticipantSo I can use the below code and it shows the Date again but NOT the author itself.
//* Customize the post info function add_filter( 'genesis_post_info', 'mfs_post_info_filter' ); function mfs_post_info_filter($post_info) { if ( !is_page() ) { $post_info = 'Published on[post_date] by [post_author_posts_link][post_date]'; return $post_info; } }
May 28, 2019 at 1:59 pm #491382Brad DaltonParticipantMay 28, 2019 at 2:06 pm #491383itzsniderParticipant//* Customize the post info function add_filter( 'genesis_post_info', 'mfs_post_info_filter' ); function mfs_post_info_filter($post_info) { $post_info = 'Published on[post_date] by [post_author_link]'; return $post_info; }
Still nothing.
May 28, 2019 at 3:43 pm #491388Brad DaltonParticipantWhich theme are you using?
Also, do you have the Genesis Simple Edits plugin installed as that can override code.
May 29, 2019 at 6:50 am #491400itzsniderParticipantI am using a custom theme that I think was built off of Altitude. And no plugins at this point.
What's weird is it doesn't even see the Author call out at all. I can add the time, date etc BUT not the author for some reason.
Thanks for your time Brad.
May 29, 2019 at 10:48 am #491408Brad DaltonParticipantMay 29, 2019 at 10:58 am #491409itzsniderParticipantThe above code is the only time author is found in that file. Where else would I be looking? And it's specific to posts which is even weirder if you ask me.
May 30, 2019 at 9:35 am #491421MarcyParticipantDoes the theme have Genesis Simple Hooks or another code snippets plugin or a custom functionality plugin, maybe even in the mu-plugins? Those are all other placed to look for overriding code.
Marcy | Amethyst Website Design | Twitter
May 31, 2019 at 8:00 am #491436itzsniderParticipantOkay here is what I have found out BUT have yet to figure out how to fix it!
The category page works as the DB sees it as a "post".
The "post" itself is not seen as a post until AFTER the call for the author is done.
The call for post_info is done PRIOR to the DB seeing it as a post due to backstretch and the code below.
Here is the code - the call to featured-single is NOT site-inner which is where the post lives, lower in the code.
echo '<div class="featured-single"><div class="overlay-gradient"><div class="wrap">'; genesis_entry_header_markup_open(); genesis_do_post_title(); genesis_post_info(); genesis_entry_header_markup_close(); echo '</div></div></div>';
Any ideas on how to fix this or where to start?
May 31, 2019 at 9:49 am #491441MarcyParticipantYou were also discussing this elsewhere, but you really haven't provided enough info here for anyone to help. It was my understanding that you were using the Gallery Pro theme, but then I saw another theme also mentioned.
For Gallery Pro you would want to try adding a priority on the filter in genesis-changes.php, like this
add_filter( 'genesis_post_info', 'bbs_entry_meta_header', 1,1 );
But then I also saw a pastebin - https://pastebin.com/McSGwkTs - with this
//* Reposition Post Info on blog page add_action( 'genesis_entry_header', 'genesis_post_info', 12 ); echo '<div class="featured-single"><div class="overlay-gradient"><div class="wrap">'; genesis_entry_header_markup_open(); genesis_do_post_title(); genesis_post_info(); genesis_entry_header_markup_close(); echo '</div></div></div>'; } }
If that's the case, you might want to try to change that 12 to 4 or less.
Marcy | Amethyst Website Design | Twitter
May 31, 2019 at 10:00 am #491442itzsniderParticipantI am using a custom theme based loosely on Altitude Pro.
Using the above code of `//* Reposition Post Info on blog page
add_action( 'genesis_entry_header', 'genesis_post_info', 12 );` does bring the author in BUT it's above the text and BELOW the image. So the position is off.Back to the above comment that the background image - featured-single, is called BEFORE it knows it's a post.
Here is what the above add does, 12 or 4.
Image here - https://imgur.com/cOwWiZcI want the author on the image as in the above screenshot. For that to happen though it needs to know it's a post prior to the image being called. Still working on figuring that position out.
May 31, 2019 at 12:23 pm #491444MarcyParticipantMay 31, 2019 at 12:34 pm #491445itzsniderParticipantAdded it back in as a 2 and it shows in the wrong place, again below the image itself.
https://imgur.com/ksibLI9 this is the HTML when a two is added.
https://imgur.com/mGIX28y is the outcome when adding it back in.
Doesn't seem to matter where in the functions.php file either. I believe it's due to the featured-single call.
May 31, 2019 at 2:16 pm #491446Brad DaltonParticipantpost_author_posts_link uses get_the_author which only works within the loop
https://codex.wordpress.org/Function_Reference/get_the_author
June 3, 2019 at 7:11 am #491478itzsniderParticipantI will close this, I don't think I am communicating this well.
Thanks all for your help.
-
AuthorPosts
- The topic ‘Authors Name on Post Meta NOT showing on individual posts’ is closed to new replies.