- This topic has 5 replies, 2 voices, and was last updated 3 years, 6 months ago by Tom.
-
AuthorPosts
-
October 8, 2020 at 9:49 am #1478886madmanweb
I had set up a snippet on my sites to move the meta info above the title. This was provided by you guys in a previous support ticket:
add_action( 'after_setup_theme','tu_gp_move_meta' ); function tu_gp_move_meta() { remove_action( 'generate_after_entry_title', 'generate_post_meta' ); add_action( 'generate_before_content', 'generate_post_meta' ); }
But this is breaking with the latest update of GP. Now the date is appearing both below AND above the title. Example:
https://seenunseen.in/episodes/2020/9/27/episode-192-the-loneliness-of-the-long-distance-trucker/Worse, it’s appearing on the home page of one of my sites which is a static page designed in Gutenberg with zero posts showing. See: https://vivekkaul.com/
I’ve hidden the display of “11 August, 2020” with CSS for now but if you check the page source, you will find:
<article id="post-6591" class="post-6591 page type-page status-publish" itemtype="https://schema.org/CreativeWork" itemscope> <div class="inside-article"> <div class="entry-meta"> <span class="posted-on"><time class="updated" datetime="2020-10-08T20:52:05+05:30" itemprop="dateModified">8 October, 2020</time><time class="entry-date published" datetime="2020-08-11T11:33:52+05:30" itemprop="datePublished">11 August, 2020</time></span> </div>
These issues go away if I disable the snippet, but then I _want the date above the title.
Please tell me how to fix this.
October 8, 2020 at 9:56 am #1478896TomLead DeveloperLead DeveloperHi there,
Try this instead:
add_action( 'wp', function() { remove_action( 'generate_after_entry_title', 'generate_post_meta' ); if ( 'post' === get_post_type() ) { add_action( 'generate_before_content', 'generate_post_meta' ); } } );
October 8, 2020 at 10:13 am #1478935madmanwebThat fixed the problem on the single pages [1] but removed the meta info entirely on the home page listing [2]
[1] https://seenunseen.in/episodes/2020/9/6/episode-189-the-acting-life/
We should also probably throw in some logic so that it doesn’t appear if there’s no content loop being called as in the home page of https://vivekkaul.com
October 8, 2020 at 10:15 am #1478938TomLead DeveloperLead DeveloperCan you try the updated code here?: https://generatepress.com/forums/topic/latest-update-broke-my-design/#post-1478896
October 8, 2020 at 10:45 am #1478993madmanwebYes, this seems to have worked.
Thank you.
October 8, 2020 at 10:45 am #1478994TomLead DeveloperLead DeveloperYou’re welcome 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.