Removing Date, Author on certain posts

I realize that this is not a Themeco-specific question, but I am looking for a way to do something.

I have a news posts area that currently does not show author, but it shows the date and category and I want to keep that the way it is.

But I want to create and organize some more content utilizing posts (not pages) to give me some more flexibility. I’m going to have hundreds of posts created and I want to be able to structure them accordingly.

Is there a way to only show category on the rest of these posts for this other section?

Hi Kev,

Thanks for reaching out.
If I correctly understand your point, that is you want to show only the category for newly added posts whereas the previously added post will show the date and categories as it is. If that is the case, you can add any specific tag or category for newly added posts to recognize separately and add custom CSS code to Theme Options > CSS which will make the date and other options invisible. I have tried the same by adding a specific tag i.e test to multiple posts and added the following CSS and found this working. In my setup, the category shows as 3rd item, so I specified 3 in the custom CSS code, you may need to change according to your setup.

.tag-test .p-meta span:not(:nth-child(3))
{
    display: none;
}
.tag-test .p-meta span:nth-child(3):after
{
    display: none;
}

Please remember that the above code will work if copied as it is and don’t conflict with any existing style.
Please note that the code provided serves only as a guide to help you get started custom coding on your own if there’s no option offered in our theme or the products we bundle.
We really do not provide support for custom codes that means we can’t fix it in case it conflicts with something on your site nor will we enhance it.

Thanks

1 Like

Thanks @tristup! I appreciate the response.

This is not a new vs. old posts issue. The “News” posts will still happen and I want to keep my setting with them showing only date and category. However, these other posts (not News) I want to show just the category. These posts are not actually News posts, but content posts and I am going to structure them differently and I only need the category to show up on them.

So for example, let’s say one of these categories is called “little lamb stars.” How would I only show the meta category “little lamb stars” and hide the other meta data so it doesn’t affect the “News” section I have already?

Right now I am hiding all of the meta data for the category, but I just want the category meta to show. Can’t seem to figure it out.

.category-little-lamb-stars .p-meta {
display: none !important;
}

Would love to do this via css and not in php.

Hello @Kev,

You can combine the code of @Tristup and the category selector in your code:

.p-meta span:not(:nth-child(3)){
    display: none;
}

.p-meta span:nth-child(3):after {
    display: none;
}

.category-little-lamb-stars .p-meta span:not(:nth-child(3)),
.category-little-lamb-stars .p-meta span:nth-child(3):after {
    display: inline-block;
}

The category in all posts will be hidden and only the posts with the little lamb stars category will be display.

The code above is just an example. It may not work out of the box. You may need to select the correct selectors that applies for your site. You need to use the Google Chrome Developer Toolbar to check the live HTML code and find which CSS selector you need to use.

Best Regards.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.