Quantcast
Channel: Toolset » All Posts
Viewing all articles
Browse latest Browse all 20145

Targeting a specific CPT with CSS to remove metadata in site search results

$
0
0

I have created a CPT which uses a Views Content Template.

I have removed the metadata which appears on the page by inputting code in the CSS section of the template:

.post-meta {display:none;}

#comments {display:none;}

#post-author, #connect {display:none;}

.post-entries a:link, .post-entries a:visited {display: none;}

All good so far… however when I do a site search for any of these pages, the metadata is visible in the search result listings.

Obviously to the user, these pages are not 'blog posts'. However there are also blog posts in the results so I need the metadata to show for blog posts, but not for CPT's.

How do I target a CPT specifically? Can I do this with CSS as above, or do I need to put something in functions.php?

Your help is appreciated.


Viewing all articles
Browse latest Browse all 20145

Trending Articles