Skip Navigation

[Resolved] Can one custom post type be styled differently in a view based on css?

This thread is resolved. Here is a description of the problem and solution.

Problem:

I want to create a view with 2 custom types, searched by taxonomy and style one custom type different than the other.

Solution:

In views loop, display two Toolset conditional block, check if current post is specific post type, then display different contents

Relevant Documentation:

https://toolset.com/course-lesson/using-toolset-conditional-block/

This support ticket is created 4 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by boelS 3 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#2059199
Screen Shot 2021-05-17 at 8.14.47 PM.jpg

Tell us what you are trying to do?
I want to create a view with 2 custom types, searched by taxonomy and style one custom type different than the other. If not, is there another way to style a featured listing differently in a view, using css? (radio button selection for example)
Is there any documentation that you are following?
I have not found a fit
Is there a similar example that we can see?
See attached image. The featured listing has a yellow background.
What is the link to your site?
hidden link

#2059333
post-type-condition.JPG

Hello,

It is possible, for example, you can try these:
Find and edit the view block you mentioned in screenshot:
https://toolset.com/wp-content/uploads/2021/05/2059199-Screen_Shot_2021_05_17_at_8.14.47_PM.jpg

In views loop, display two Toolset conditional block, check if current post is specific post type, then display different contents, see my screenshot post-type-condition.JPG

More help:
https://toolset.com/course-lesson/using-toolset-conditional-block/

#2067007

My issue is resolved now. Thank you!