[Resolved] Moving post meta (date updated) below featured image is not working after 3.0?

Home Forums Support [Resolved] Moving post meta (date updated) below featured image is not working after 3.0?

Home Forums Support Moving post meta (date updated) below featured image is not working after 3.0?

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1476489
    Roy

    I always moved the meta (date last updated on) to Below the featured image using this recommended code in child Functions:

    add_action( ‘after_setup_theme’, function() {
    remove_action( ‘generate_after_entry_title’, ‘generate_post_meta’ );
    add_action( ‘generate_after_entry_header’, ‘generate_post_meta’, 15 );
    } );

    But since updating to 3.0 this shows 2 dates – 1 above and 1 below the featured image
    i.e. the add_action works fine but the remove_action no longer removes the meta from above the featured image…

    Happens using flexbox or floats. Any ideas – does the generate_after_entry_title need changing to something new?
    Thanks

    #1476867
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Try this instead:

    add_action( 'wp', function() {
        remove_action( 'generate_after_entry_title', 'generate_post_meta' );
        add_action( 'generate_after_entry_header', 'generate_post_meta', 15 );
    } );

    Let me know 🙂

    #1477212
    Roy

    Hi Tom, you’re a star – changing it to ‘wp’ worked perfectly 🙂

    Thanks for the very quick help.

    Ps my scores on Page Speed and GTmetrix have both gone up since the new version and switching to Flexbox – nice work!

    #1477220
    Tom
    Lead Developer
    Lead Developer

    You’re welcome!

    That’s great to hear! 🙂

    #2138468
    Paul

    The following code does not work properly….
    add_action( ‘wp’, function() {
    remove_action( ‘generate_after_entry_title’, ‘generate_post_meta’ );
    add_action( ‘generate_after_entry_header’, ‘generate_post_meta’, 15 );
    } );

    It adds the meta on every single page in .inside-article .entry-meta, which is not what people want.
    We simply want to modify the blog page and not every page on our site.
    in saying this, how do I target just the blog page’s code and not break every other page?

    #2138475
    Paul

    Since I don’t want to run the following PHP code via snippets and break every page of my site, is there better code to use then this so that it only applies to html classes or ids on my blog page?
    add_action( ‘wp’, function() {
    remove_action( ‘generate_after_entry_title’, ‘generate_post_meta’ );
    add_action( ‘generate_after_entry_header’, ‘generate_post_meta’, 15 );
    } );

    Also, can I use a hook to apply this code just to blog pages instead of everything like code snippets does?

    #2138639
    Leo
    Staff
    Customer Support

    Can you open a new topic for your question?

    This one is a bit old already.

    Thanks!

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.