Author name not showing in single post meta

Community Forums Forums Design Tips and Tricks Author name not showing in single post meta

This topic is: resolved

This topic contains 5 replies, has 2 voices, and was last updated by  braddalton 3 months, 2 weeks ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #112881

    bello-via
    Participant
    Post count: 9

    I’m hoping this is an obvious fix that I’m just missing after days of customizations to a current project. For some reason the author name disappears only on single posts and appears just fine on the blog page with all posts showing.

    Link to blog page: Hopeful World – Our Stories

    Link to single post: Hopeful World – Where Hope Begins

    I’m using Genesis Simple Edits with the following in the ‘post info’ field:
    written by [post_author_posts_link] [post_date]

    I’ve also got the following added to functions.php to remove the post meta in the footer of each post:

    //* Remove the entry meta in the entry footer (requires HTML5 theme support)
       remove_action( 'genesis_entry_footer', 'genesis_post_meta' );

    Ideally the above PHP was supposed to be conditional and only remove the post meta (categories specifically) on the blog page, not on single posts but I couldn’t successfully isolate just the blog page so for now it removes on both single posts and the main blog listing. May eventually post a topic on that for help as well but for now just including the code here in case somehow that’s causing my author name to disappear.

    Any help would be MUCH appreciated.

    http://hopefulworld.org/hopefulworld.org
    #112932

    braddalton
    Participant
    Post count: 10254

    You can’t use the code and plugin at the same time as they conflict.

    Its more flexible to use the code with a conditional tag so please deactivate the plugin and modify the code to suit your needs.


    #113063

    bello-via
    Participant
    Post count: 9

    That made perfect sense Brad. I was so hopeful that would fix it but no luck. :(

    Here’s the steps I’ve tried, testing after each to see if the author name appeared…

    I deactivated the Genesis Simple Edits plugin and even deleted the files for it.
    I deleted the custom PHP code mentioned above (the removal of the entry meta in the footer).
    I added the snippet for “customize the post meta function” code to functions.php (as is, no changes).
    I tried adjusting the snippet code with the wording and arrangement that the client would prefer.
    Lastly, I replaced the functions.php file with the original functions.php from the parallax theme download.

    Still no author name showing on the single post pages. I’ve also checked to make sure I hadn’t added a ‘display: none’ styling that might affect it in the CSS since I’d tried at one point removing the post footer meta on the excerpts using display:none but was unable to isolate the excerpts only using that method. Never-the-less, I figured I better double check and make sure something wasn’t still lingering there.

    I feel like I have a better game plan for getting the wording the way I’d like it but the author name disappearing is going to be an issue with the client I’m sure. Two steps forward, one step back. Could be worse I suppose. Any other ideas?

    #113113

    braddalton
    Participant
    Post count: 10254

    The snippet needs to be modified correctly and it will work. Used this solution many times.


    #113428

    bello-via
    Participant
    Post count: 9

    Kay, 3 days later I figured out what the issue was. Posting the solution here because it drives me nuts when I find posts that describe exactly what I’m trying to do with either no response or no follow-up showing what worked. :)

    I found this post where you pointed out that certain get_author_info won’t work outside the loop. I realized then that the following code in my functions.php file might be what’s causing the same issue as this previous poster.

    // * Relocate titles on Page, Post and other single pages
    add_action( 'genesis_after_header','relocate_entry_title_singular' );
    function relocate_entry_title_singular() {
    
    	if ( ! is_singular() )
    		return;
    	echo '<div class="entry-header-wrapper"><div class="wrap">';
    		genesis_do_post_title();
    		genesis_post_info();
    	echo '</div></div>';
    
    	if ( is_page_template( 'page_blog.php' ) )
    		return;
    	remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
    	remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
    	remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
    
    	if ( ! is_singular('post' ) )
    		return;
    	remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
    }

    I changed it to this:

    // * Relocate titles on Page, Post and other single pages
    add_action( 'genesis_after_header','relocate_entry_title_singular' );
    function relocate_entry_title_singular() {
    
    	if ( ! is_singular() )
    		return;
    	echo '<div class="entry-header-wrapper"><div class="wrap">';
    		genesis_do_post_title();
    	echo '</div></div>';
    
    	if ( is_page_template( 'page_blog.php' ) )
    		return;
    	remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
    	remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
    	remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
    }

    removing the genesis_post_info(); from the first half of the code and remove_action( 'genesis_entry_header', 'genesis_post_info', 12 ); from the last bit there. Problem solved.

    Thanks for the advice on the conflict issue with simple edits and using the custom snippets. That’ll definitely be helpful to know for future projects. :)

    #113460

    braddalton
    Participant
    Post count: 10254

    Looks like you worked out the problem and fixed it.


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

You must be logged in to reply to this topic.