Skip Navigation

[Resolved] Can different post types be set to display differently in archives?

This support ticket is created 5 years, 5 months 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by johnB-43 5 years, 5 months ago.

Assisted by: Minesh.

Author
Posts
#1283961
Annotation 2019-07-04 114709.jpg

I am trying to:
Create an archive loop which will display items across several different post types. I'd like to visually differentiate between them, e.g. have the stories, news and institutions each display in a way that makes it obvious what they are (have different icons, maybe different backgrounds).

Link to a page where the issue can be seen:
hidden link

I expected to see:
Posts of different types look different in the loop output

Instead, I got:
All posts of all types look identical

#1284021

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

You can use [wpv-conditionnal] shortcode to display the conditional output. To check the post type of the current post, you can use the [wpv-post-type] shortcode.

For example:

[wpv-conditional if="( '[wpv-post-type]' eq 'post' )" ] 
This post is belongs to post type post.
[/wpv-conditional]

[wpv-conditional if="( '[wpv-post-type]' eq 'student' )" ] 
This post is belongs to post type student.
[/wpv-conditional]


Where:
- post is a post type slug. you should change it as required.

More info:
=> https://toolset.com/documentation/user-guides/conditional-html-output-in-views/

#1284059

My issue is resolved now. Thank you!