Hide date on specific blog posts (Renew) and still show author

I’d like to hide the dates on specific blog posts that are “Evergreen” content (but still show the author).

If it’s not possible to hide the date on specific posts, can you at least tell me how to hide the date in general? If I hide meta info in the blog options, it also hides the author, so that won’t work.

None of the code I’ve found on this forum works for me.

But I’d really love to be able to control it post by post, if it can be done. :slight_smile: Thank you!

Hi There,

Thanks for writing in! To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.

Thank you.

https://sassypantsdesign.com

Hi There,

Please add the following code to Theme Options CSS

.p-meta>span time, .p-meta>span time:after  {
    display: none;
}

Hope it helps!

Thanks. It sort of helps, but there is a problem. It does remove the date - for all of the posts. But it leaves an extra “/” after the name, which looks funny. For example, it reads like this now:

TITLE OF POST
Amy / / tags / # of comments

So I need to get rid of that, but I’m also wondering if I can remove the date on individual posts. Some of them contain “evergreen” content and some might need to actually have the dates. There is no way to customize that in the post settings somehow?

Thank you!

Hi there,

Please change the given CSS to this,

    .p-meta>span:nth-child(2n+0) {
     display: none;   
    }

Hope this helps.

Hi - thank you for your reply. It helped some, but now there is another problem. Now it shows:

Amy / tags /

It’s supposed to show “# of comments” after that last “/”. I am ok with it not showing the number of comments, but I want to get rid of that last “/”.

Also, nobody has addressed my question of whether or not there is a way to only hide the date on CERTAIN posts, rather than ALL posts. Is that possible?

Thank you so much for your help.

Hi There,

.p-meta>span:nth-child(3):after {
    content: "";
}

This is the structure of meta information. See how we have a paragraph tag and 4 span tag inside to separate each information.

<p class="p-meta">
<span>Amy</span>
<span><time class="entry-date" datetime="2017-06-20T17:41:27+00:00">June 20, 2017</time></span>
<span><a href="https://sassypantsdesign.com/category/life/everything-else/" title="View all posts in: “Everything Else”">Everything Else</a>, <a href="https://sassypantsdesign.com/category/life/" title="View all posts in: “Life”">Life</a></span>
<span><a href="https://sassypantsdesign.com/who-knew-smiling-could-make-you-happy/#respond" title="Leave a comment on: “Who Knew Smiling Could Make you Happy?”" class="meta-comments">0 Comments</a></span>
</p>

To access each span tag and slash after each span, see the following CSS guide


.p-meta>span:first-child(){ /*Access first span with Amy or Author*/
    /*Add style here*/
}
.p-meta>span:first-child:after{ /*Access/Remove  / after Amy or Author*/
    content: "";
}
.p-meta>span:nth-child(2){ /*Access second span with Date/time*/
    /*Add style here*/
}
.p-meta>span:nth-child(2):after{ /*Access/Remove / after second span with Date/time*/
    content: "";
}
.p-meta>span:nth-child(3){ /*Access third span with Category content*/
    /*Add style here*/
}
.p-meta>span:nth-child(3):after{ /*Access/Remove / after third span with Category content*/
    content: "";
}
.p-meta>span:last-child(){ /*Access last span with Category content*/
    /*Add style here*/
}

Now, to filter it to just work on specific post, we can add the post ID as filter like below:

.postid-1 .p-meta>span:nth-child(2){ /*Access second span with Date/time*/
    /*Add style here*/
}

See this on how to locate post id: https://theme.co/apex/forum/t/setup-how-to-locate-post-ids/59
This CSS link might help: https://developer.mozilla.org/en-US/docs/Web/CSS/Child_selectors

Hope this helps.

Thank you so much. That’s super helpful. Sounds like it would be a bit of a hassle to do this every time a new post is added if I need to edit the css, but at least I know it can be done.

It would be a great idea if perhaps in a future update, showing or not showing the post date could be an option when adding a new post. I know that some other blogs who write evergreen content don’t generally want to show the date so the blog always appears fresh, but if they do post something that is date sensitive, then they do need to show the date.

But at least I’m glad to know how it all works. Thanks again very much.

Oh dear, I thought I was done but I just realized that the date still shows in the thumbnails of “recent posts” in the side bar when you are on an individual blog page. Can I remove the dates there, too?

Hi There,

You can add this on Theme Options > CSS

/*hides the date on the recent post element*/
span.x-recent-posts-date {display: none;}

Make sure to clear your caching plugin and all caching feature your site might have, or else you won’t going to see the changes immediately, until the cache is generated.

Thanks,

:neutral_face::neutral_face:Unfortunately, this did not seem to work. I have WP Rocket, and I purged cache multiple times. I also deleted browser cache, and tried it in a different browser. Nothing worked. :thinking:

Hi There,

Maybe some custom CSS is over-riding it, lets add an !important rule on that code and try to purge your caching plugins again.

/*hides the date on the recent post element*/
span.x-recent-posts-date {display: none !important;}

Cheers!

That worked! Thanks a bunch for sticking with me on this. :grin:

We are delighted to assist you with this.

Cheers :grin:

Which theme file(s) would I look to change the actual order of the meta information? I know this cannot be done via CSS.

thanks

Hey @wbgTHEMECO,

You will need to take a look at the meta function of the stack you’re using. If you’re using Ethos for example, you will need to copy its meta function to functions.php. The function is x_ethos_entry_meta for Ethos and it is in ethos.php which can be found in wp-content\themes\x\framework\functions.

Hope this will lead you to the right direction.