Skip Navigation

[Résolu] Would like different "types" to retain their styling when collated in an archive

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created Il y a 9 années et 11 mois. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

This topic contains 5 réponses, has 2 voix.

Last updated by jamesG-3 Il y a 9 années et 10 mois.

Assisted by: Ghennadi.

Auteur
Publications
#221983
Frontpage-Web.png

Hi there - I have attached a screenshot below. I am looking to have an archive page that retains the unique styling of each type when collated into one archive style view in order that each type of content is visually differentiated. I was wondering if the [wpv-if evaluate="'[wpv-post-type]' = 'post'"] shortcode holds the answer but I can't seem to get it to work as hoped. Thanks!

#222080

Dear jamesG-3,

Your shortocde is correct, i just checked it and everything works fine.

[wpv-if evaluate="'[wpv-post-type]' = 'post'"]
        <div class="content-for-posts"></div>
 [/wpv-if]

If you still have problem, please copy/paste here your View layout content.

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.
Regards,
Gen.

#222100

Thanks - I will give it a shot and see how it goes

#222101

Hi there - I tried the following shortcode and nothing appeared.

[wpv-if evaluate="'[wpv-post-type]' = 'tv'"]
        <div class="content-for-posts"></div>
 [/wpv-if]

I have a post type called tv, one called shop, one called articles and then the standard wordpress blog posts.

Without the wpv-if I can pull all 4 content types into one long list but I would like to be able to have them styled differently based on the content type. For example, the background of the TV posts should be black with additional padding, the magazine should have a different title font and featured image border etc etc.

I feel like I might just be missing something small here but am not sure what it is. Thanks!

(the site is hidden link)

#222196

Dear jamesG-3,

You have to write code for yourself

[wpv-if evaluate="'[wpv-post-type]' = 'tv'"]
        <div class="my-class-for-tv">
[/wpv-if]
[wpv-if evaluate="'[wpv-post-type]' = 'shop'"]
        <div class="my-class-for-shop">
[/wpv-if]
Post Content 
</div>

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.
Regards,
Gen.

#222413

Perfect!!! I think I had some residual code from the posts that threw it out. In cleanly making a new image everything worked perfectly. Thanks

Le forum ‘Types Community Support’ est fermé à de nouveaux sujets et réponses.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.