Sauter la navigation

[Résolu] Conditional Output According to Number of Posts (including outside view)

This support ticket is created Il y a 5 années et 4 mois. There's a good chance that you are reading advice that it now obsolete.
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)

Ce sujet contient 0 réponses, a 1 voix.

Dernière mise à jour par zacharyL Il y a 5 années et 4 mois.

Assisté par: Shane.

Auteur
Publications
#1325503
screenshot.jpg

I am trying to: Display a link that says "View More Posts" when the post count, of WooCommerce products with "Featured" set, hits more than the limit threshold, of 4, of a view, utilizing a conditional logic argument that states the following:

[wpv-conditional if="( '[wpv-found-count]' gt '4' )"]<a href="#">view more</a>[/wpv-conditional]

as proposed by this support thread: https://toolset.com/forums/topic/conditional-output-according-to-the-number-of-items/?bbp_reply_to=600309&_wpnonce=90f316f145#new-post

However, [wpv-found-count] prints the integer '4', even when there are five products that are set as "Featured".

You can view the page in question here: lien caché

My current view configuration is as follows:

Display 4 items
Taxonomy Filter: Select Posts with taxonomy: Tags in one of these: featured
No pagination

My markup in the Loop Editor:

[wpv-layout-start]
	[wpv-items-found]
	<div class="equipment-specials-wrapper">
	<!-- wpv-loop-start -->
		<wpv-loop>
          	<a href="[wpv-post-url]" class="equipment-special">
              	<div><img src="[wpv-post-featured-image size='custom' width='538' height='323' crop='true' output='url']" alt="[wpv-post-title]" /></div>
              	<div><h4>[wpv-post-title]</h4></div>
          	</a>
		</wpv-loop>
	<!-- wpv-loop-end -->
	</div>
	[wpv-found-count]
	[wpv-conditional if="( '[wpv-found-count]' gt '4' )"]<a href="#" class="futura double-right">view all specials</a>[/wpv-conditional]
	[/wpv-items-found]
	[wpv-no-items-found]
		<div class="no-items"><h4>We're sorry, there are currently no items on sale at this time</h4></div>
	[/wpv-no-items-found]
[wpv-layout-end]

I put a standalone [wpv-found-count] shortcode to troubleshoot, as seen in the screenshot. I even tried this same conditional with a post view with no taxonomy filters, as seen further down the page. Same problem. I've come to the conclusion that this shortcode is not the one I'm looking for. So my question is, is there a way to output the total number of posts of a given type, both for filtered and non filtered views, that contain a post limit, and have it appropriately interact with the conditional arguments?

#1325525