Custom Post Type – How to Remove These Elements

Posted in: Newspaper
Post count: 5

Hi there,

I would like to create a poll from time to time for my audience. The poll will use a custom post type and I can create a special layout template from Visual Composer for all poll posts.

I want to remove these elements from the poll posts:
– social share buttons (top and bottom)
– author card
– next and previous post
– category and tag
– breadcrumb

Note that these elements are standard for other posts and I would like to keep them. I will use ‘Custom CSS’ plugin to insert custom codes to remove the above for ONLY poll posts.

Can you provide the codes that I can add in ‘Custom CSS’ to remove the above elements? Or is there any other better way to do this, ie custom css for only certain type of post?

Thanks in advance

Post count: 20688

Hi,

You could hide these elements for that specific post type. This can be done by using the unique class that is added based on the name of your custom post type, that you have created. Example
https://www.screencast.com/t/ibXlQLEJ7QY
Then you can create custom code to hide them from that post type, or even by post Id. If you can provide a link to one of your custom post type posts, I will try to give you a solution.

Thanks

Post count: 5

Hi Simion,

Thanks for the reply, here’s the link to a sample: https://30.com.my/uncategorized/new-template/

thanks

Post count: 20688

Hi,

Please try this code, it will hide the elements that you mention on this particular post type
https://www.screencast.com/t/HuhHbQdciMhb
Let me know if this not what you wanted or the code is not working properly for you. The code must be entered in Theme panel->Custom Css

.new-template .td-post-sharing,
.new-template .author-box-wrap,
.new-template .td-post-next-prev-content,
.new-template .td-category,
.new-template .entry-crumbs {
display: none;
}

Thanks

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newspaper’ is closed to new topics and replies.