Skip Navigation

[Resolved] Taxonomy View inside WordPress archive

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

Problem:

Display a taxonomy view outside wpv-loop HTML tags of taxonomy archive page.

Solution:

It should be a known issue of Toolset Views plugin, The recommended workaround is to not use Content Templates to group fields in a Taxonomy View. See example here:

https://toolset.com/forums/topic/taxonomy-view-inside-wordpress-archive/#post-1712141

Relevant Documentation:

This support ticket is created 4 years, 8 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 – 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 4 replies, has 2 voices.

Last updated by Helmi 4 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#1708589
Taxonomy-View.png

Tell us what you are trying to do?

We wanted to get some kind of taxonomie view or filter above the loop (please look at the attached image), that shows alle categories with the count of the posts of the categorie, so the user can click on one category and gets in the archive. If we use a "normal" view to display the posts, we can set a taxonomie view named "divi-category-section" above the loop with this code in the loop and it works:

<a href="[wpv-taxonomy-url]">[wpv-taxonomy-title] | [wpv-taxonomy-post-count]</a>

But this doesn't work in the WordPress-Archive view.

Is there any documentation that you are following?

I already found this thread: Displaying view by taxonomies url in the archieve loop ... and I already integrated the given function and shortcode. But with this solution I only can display the information from the category term of the actual shown WP archive, not iterate over all category terms.

Is there a similar example that we can see?

At the moment only the attached image from our designer.

What is the link to your site?

Our staging site is not public at the moment.

#1709657

Hello,

What do you mean this:

But this doesn't work in the WordPress-Archive view.

It should be able to work in taxonomy archive page too?
How do you setup the taxonomy view in WordPress-Archive view? Where do you put and display it?
Please provide detail steps to duplicate the same problem

#1710149

In the WP-Archive view I put the view "divi-category-section" at the exact same place as in the "normal" test view I created, but it didn't get fully processed. In the output It only shows up with "Kategorie: " and then no further output (inspected the HTML-code output).

Loop-Editor of the divi-category-section view:

[wpv-layout-start]
<div class="dw-category-filter">
<span>Kategorien</span>
	[wpv-items-found]
	<!-- wpv-loop-start -->
	<wpv-loop>
		[wpv-post-body view_template="loop-item-in-divi-category-section"]
	</wpv-loop>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]
</div>
[wpv-layout-end]

Loop item in divi-category-section:

<a href="[wpv-taxonomy-url]">[wpv-taxonomy-title] | [wpv-taxonomy-post-count]</a>

WP-Archive for posts, categorys and tags

Loop-Editor of the WP-Archive Beitraege view:

[wpv-layout-start]
[wpv-view name="divi-category-section"]
	[wpv-items-found]
<div class="dw-post-index">
	<!-- wpv-loop-start -->
	<wpv-loop>
		<div class="dw-post-item dw-post-wrapper-[wpv-loop-index accumulate="false" pad="false"]">[wpv-post-body view_template="loop-item-in-blogansicht"]</div>
	</wpv-loop>
	<!-- wpv-loop-end -->
</div>
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]

[wpv-pager-archive-nav-links output="bootstrap"]

[wpv-layout-end]

Loop item in Beitraege

<div class="dw-post">
    <h2 class="dw-title color-[types field='postcolor' output='raw'/]">[wpv-post-link]</h2>
	<div class="dw-image bg-gradient-[types field='postcolor' output='raw'/]">[wpv-post-featured-image size="full" class="dw-postimage-img"]</div>
	<p class="dw-excerpt">[wpv-post-excerpt]</p>
	<div class="dw-category bg-light-[types field='postcolor' output='raw'/] color-[types field='postcolor' output='raw'/]">[wpv-post-taxonomy type="category"]</div>
	<div class="dw-meta">
  		<span class="dw-author">[wpv-post-author]</span> |
      	<span class="dw-date">[wpv-post-date]</span>
 	</div>
</div>
#1712141

It should be a known issue of Toolset Views plugin, see erratum:
https://toolset.com/errata/content-template-is-not-rendered-if-added-outside-the-archive-loop-of-a-view/

Toolset lets you style WordPress archives. You can insert anything in the Loop Editor of those archives including Content Templates.

However, there are two cases where Content Templates will not display:

If you insert Content Templates outside the wpv-loop HTML tags.

Please try the workaround of above erratum:

The recommended workaround is to not use Content Templates to group fields in a Taxonomy View.

In your case, you can edit "Loop-Editor of the divi-category-section view", replace this line from:

[wpv-post-body view_template="loop-item-in-divi-category-section"]

To:

<a href="[wpv-taxonomy-url]">[wpv-taxonomy-title] | [wpv-taxonomy-post-count]</a>
#1712331

My issue is resolved now. Thank you!