Home › Forums › Support › Need to remove date published meta from posts | using GP Element in header
- This topic has 3 replies, 2 voices, and was last updated 3 years, 11 months ago by
Ying.
-
AuthorPosts
-
September 30, 2021 at 1:39 pm #1948628
Alan
Hi there,
I currently have both date updated and date published meta on my posts. It is being inserted via GP Elements type is Header.
I was able to use CSS to change the one that is displayed on posts to be the updated date rather than the published date using the following CSS code that I found on the GP support forums (if memory serves) —
/* show updated post date */ .page-hero time.updated { display: inline; } .page-hero time.published { display: none; } /* end show updated post date */
However, Google is still picking up the published date on the SERPs and I’m 99% sure it is because the published date, while hidden, is still in the source code on every post.
How can I remove the <time> element that contains the published date from the source code on the posts? I’ve looked at tons of GP support posts and can’t find a solution that works. Also, changing the setting for show date under Customize –> Blog –> Single does not work, I think because it is showing via an Element. The code from the element in question is–
<div class="inside-header"> <span class="hero-category">{{post_terms.category}}</span> <h1> {{post_title}} </h1> <span class="hero-byline">{{post_date}} by {{post_author}} | *As an Amazon Associate, we earn from qualifying purchases</span> </div>
I cannot find where {{post_date}} is pulling from in the theme or WP core files. I’m thinking the code that is being output by {{post_date}} is from somewhere in the GP theme, though I could be mistaken. I’m just at a real loss here and have spent hours trying to solve this.
Can you help or point me in the right direction? I’m including a link to a URL on my site in the private information field where you can see the meta data on the byline area that I’m talking about. Please let me know if there is any other information I can provide to assist. Thanks in advance!
GeneratePress Theme version 3.0.4
GP Premium 2.0.3September 30, 2021 at 2:34 pm #1948655Ying
StaffCustomer SupportHi Alan,
I would recommend to try block element – post meta or block element – page hero:
https://docs.generatepress.com/article/block-element-post-meta-template/
https://docs.generatepress.com/article/block-element-page-hero/You can completely remove the post date if there’s an updated date exists within the block settings.
Please be noted that you’ll need to install GenerateBlocks plugin to use the dynamic feature of the block element.
Hope that’s helpful 🙂
October 7, 2021 at 12:43 pm #1956394Alan
Ying, that isn’t the solution I was looking for.
However, for anyone else in the future that is trying to solve this same problem, the solution you are looking for lies here! 🙂 — https://generatepress.com/forums/topic/remove-published-date-when-using-page-header/
October 7, 2021 at 1:15 pm #1956415Ying
StaffCustomer SupportGlad you found your solution!
-
AuthorPosts
- You must be logged in to reply to this topic.