Skip Navigation

[Resolved] CPT archiv with specifici taxonomy category

This support ticket is created 4 years, 11 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 11 replies, has 3 voices.

Last updated by Shane 4 years, 11 months ago.

Assisted by: Shane.

Author
Posts
#1481029

Tell us what you are trying to do?
I have CPT archiv page "Books" - hidden link, filtering by taxonomy "Genre".

I need similar archive, which only displays taxonomy "Adult" - the rest (filtering by taxonomy"Genre" and sorting by post type "date o publication") from archiv hidden link should stay. The books in this archive page are sorted by date of publication custom post type - this is main reason, why I can´t use simple archive page for taxonomy. If there is any easier solution - please tell me.

Finally, there should be 3 archives:
1/ hidden link - it works now well
2/ hidden link - the same archiv but only for taxonomy "Adult"
3/ hidden link - the same as 1/ but for taxonomy "Childrens"

What is the link to your site?
hidden link

Thank you for your help!

Best,
Josef

#1481393

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Josef,

Thank you for getting in touch. There isn't a simple way to design an archive for a specific taxonomy.

What you're going to have to do is to create 1 taxonomy archive and within that archive you can create multiple template.

Using our views shortcode to switch between them.

Example


[wpv–conditional if="( '[wpv-taxonomy-title]' eq 'Adult' )"]

Adult design template goes here
[/wpv–conditional]

[wpv–conditional if="( '[wpv-taxonomy-title]' eq 'Children' )"]

Children design template goes here
[/wpv–conditional]

You will need to do this for each of the taxonomy terms that the Book taxonomy has.

Thanks,
Shane

#1481513

Hi Shine,
thank you for your quick answer.

I'm trying to add a condition you sent me, but I´m doing something wrong - in all cases I only see my old view and parts of code from condition at the start and in at the end on archiv page.

I tried to wrap template for view first, then wrap shortcode on archiv page (I´m using Beaver Builder to create archiv page), I tried wrap Loop in view editor too.

Could you please send me more detail information where put the conditional - or I can send temporary accesses to admin.

Thank you veru much.
Josef

#1482949

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Josef,

Please send the admin details so that I can see what you have.

This way I can advise more precisely on how to get this working for you.

Thanks,
Shane

#1483603

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Josef,

Do you intend to build the custom archive for the Age Category with Beaver Builder or are you going to create a custom archive with toolset?

Currently your archive is being displayed with the default method for wordpress.

If you use our Toolset custom archive method you can use the solution that i've provided in the link https://toolset.com/forums/topic/cpt-archiv-with-specifici-taxonomy-category/#post-1481393

Thanks,
Shane

#1484261

Hi Shane,
I prefer in this case Beaver Builder archive solution (via Themer), because I´m used to it and I already did with them other archive pages on this site (hidden link, hidden link.

I´m using Toolset for design View (custom grid with filtering), this View is insert as HTML shortcode to empty archive page. The logic of archive pages is set in Beaver Themer. It will be great, if I can put condition direct inside View.

Thank you,
Josef

#1485291

Hi, Shane is unavailable today and will return tomorrow to continue assisting you with this ticket. Thanks for your patience!

#1487001

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Josef,

You perhaps may not be able to get the conditional logic working inside the view since the taxonomy shortcodes need to be in a taxonomy view.

However what you can do is if you are inserting the view using the Oxygen Builder WYSIWYG editor then you would be able to utilize the conditional logic there.

This would mean you will need to create 2 separate views and load the view based on the conditional logic.

Updating the code I had previously provided to match this new logic would look like this.


[wpv–conditional if="( '[wpv-taxonomy-title]' eq 'Adult' )"]
 
[wpv-view name='adult-view']

[/wpv–conditional]
 
[wpv–conditional if="( '[wpv-taxonomy-title]' eq 'Children' )"]
 
[wpv-view name='children-view']

[/wpv–conditional]

Given that your Oxygen builder would be a custom archive template then the [wpv-taxonomy-title] shortcode should work as intended.

If you are experiencing any issues or if the information provided is not clear please let me know.

Thanks,
Shane

#1488557
conditional.png

Hi Shine,

thanks for your time, unfortunately this solution doesnt work for me. I´m using Beaver Builder (+ Beaver Themer), but I suppose it works like Oxygen editor that you mention.

I tried your code here - hidden link (printscreen of source attached). I tried Wysiwyg component or HTML component - the result was the same.

Is there any other option how to set this?

Thanks a lot,
Josef

#1488937

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Josef,

It seems that the conditional shortcode isn't working on the archive template.

Does Beaver Builder have a conditional block or something of sort ? I would need to verify that the conditionals do not work on Beaver Builder templates.

Would you mind if I grabbed a copy of the site so that I can have a more detailed look at this one ?

Thanks,
Shane

#1488979

Hi Shane,
Beaver Themer has conditional settings (every template has own rules), but Im not sure how they works together with Toolset conditionals.

You can grab your own copy, of course.

Thank you,
Josef

#1489077

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Josef,

Since there is a conditional for Beaver Builder I would suggest opening a ticket with beaver builder to ask them how this works.

Because if you're able to conditionally display the block based on the Archive you are viewing then you can load a different view based on the archive.

This would work just as well, so i would suggest asking them if its possible to display a different block/widget based on the archive that you're on.

Thanks,
Shane