Moving Post Info

Community Forums Forums General Discussion Moving Post Info

This topic is: not resolved

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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #99901

    gsxrgeek
    Member
    Post count: 4

    Hi, I have created a child theme and moving the post info to the footer entry instead of the header entry.

    Well it works… except the post info still shows in the header-entry and the footer-entry on the first post entry. Its only the first one on each page, all the others are fine.

    Not sure how to fix it or what the issue is.
    //if page is home, move post info to entry footer
    add_action( ‘genesis_entry_content’, ‘move_post_info’ );
    function move_post_info() {
    if (is_home()) {
    // Remove the entry meta in the entry footer (requires HTML5 theme support)
    remove_action( ‘genesis_entry_footer’, ‘genesis_post_meta’ );
    //moves the post info to the entry footer
    remove_action( ‘genesis_entry_header’, ‘genesis_post_info’, 12 );
    add_action( ‘genesis_entry_footer’, ‘genesis_post_info’, 9 );
    }
    }

    #99906

    braddalton
    Participant
    Post count: 9959

    Bit hard to test as the code has been embedded in the page and turned some of the characters around which causes errors.


    #99908

    Sridhar Katakam
    Participant
    Post count: 1019

    Can you provide the URL of your site?

    If the requirement is to remove Post meta and move Post info from entry header to entry footer on Posts page, then the following should work (I tested it successfully):

    add_action( 'genesis_before_entry', 'reposition_entry_header' );
    function reposition_entry_header() {
    
    	if ( is_home() ) {
    
    		remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
    
    		remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
    		add_action( 'genesis_entry_footer', 'genesis_post_info' );
    
    	}
    
    }

    #99935

    gsxrgeek
    Member
    Post count: 4

    Sridhar, that fixed it. Not sure why my code was leaving the post info in the entry header on the first entry. Weird. Thanks!!

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

You must be logged in to reply to this topic.