Hey there,
We have a custom post type called case studies.
You can see this working here:
hidden link
It has a taxonomy called packages.
We are inserting a view called (Case Studies Packages Taxonomy View) into our php template called taxonomy-package.php
I've tried creating a wordpress archive in Toolset but I can't get this to work.
You can see the front-end of the taxonomy archive looks ok:
hidden link
But the h2 sub-heading which is using [wpv-taxonomy-title] which should display the taxonomy title of whichever taxonomy we're in - but this is stuck on the first taxonomy item 'Blog Package' no matter which taxonomy archive you switch too.
It says:
Here are the case studies for our Blog Package
It should say:
Here are the case studies for our Consulting Work
Also the main content is repeated 9 times.
And on taxonomy archives like:
hidden link
There is no content but it's still looping through 9 times and displaying empty boxes when it should show 'No items found'.
Hello,
Thanks for the details, I can login into your website.
Q1) Here are the case studies for our Blog Package
Since it is in a term's archive page, and you are going to display the archive page title, you can try the shortcode: [wpv-archive-title].
For example, edit the taxonomy view "Case Studies Packages Taxonomy View":
hidden link
in section "Loop Editor", replace the codes from:
<h2>Here are the case studies for our <span>[wpv-taxonomy-title]</span></h2>
To:
<h2>Here are the case studies for our <span>[wpv-archive-title]</span></h2>
Q2) Also the main content is repeated 9 times...
You are using Taxonomy view in the term's archive page, but the correct way is setup Views WordPress Archive, see our document:
https://toolset.com/documentation/user-guides/creating-wordpress-custom-post-archives/
Please follow above document to customize the taxonomy wordpress archive page, and test again
Thanks for your support Luo,
I've now tried creating a WordPress archive in the normal way on the case studies archive.
hidden link But as you can see this doesn't work.
When I inspect the page the content is there but it looks like there's some conflict with the theme which is why I was embedding the view into the php templates in the first place.
Unfortunately we're unable to shut of the theme or switch our theme as we have over 200 blog posts that use this theme and the Tatsu page builder.
The case studies view embedded into the php template was working fine the only problem we have is getting the taxonomy-case-study.php to display properly.
Can you help us find a work-around using the taxonomy-case-study.php template for this?
Or is it not possible to display taxonomy views in a php template?
The URL hidden link is archive page of post type "case-studies", but theme file "taxonomy-case-study.php" is for archive page of "case-study", why do you need to use taxonomy theme file to customize the archive page of post type?
See WordPress document.
And I have checked the URL:
hidden link
Views wordpress archive "Case Studies Archive" does work on above archive page, but there are some other CSS/JS codes setup it's outer DIV tag to 0 height, so it does not display correctly.
There is a simple workaround, you can use CSS codes to override it, for example, edit wordpress archive "Case Studies Archive":
hidden link
click "CSS editor", add below codes:
.portfolio-container{
height: auto !important;
}
Test it again:
hidden link
Check if it is fixed or not.
Thanks Luo,
That's got me moving forward again. I'm now using the Toolset WordPress archive as the archive for the case studies custom post type and taxonomy.
I'd like to display different content under the h1 heading using a conditional:
Is it possible to do something like this:
If case studies archive display:
Check out our case studies to see how we've helped our clients
If case studies taxonomy display:
Here are the case studies for our [wpv-archive-title]
I've been looking for the documentation on how to but don't know the syntax for this conditional.
Thanks for your support!
My issue is resolved now. Thank you!