Skip Navigation

[Resolved] Further question to your reply #1448801

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

Problem:

Filter view by taxonomy terms using shortcode attribute.

Solution:

You can try taxonomy filter in to your post view, for example:
https://toolset.com/forums/topic/further-question-to-your-reply-1448801/#post-1455601

Relevant Documentation:

https://toolset.com/documentation/user-guides/filtering-views-by-taxonomy/

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

Last updated by FuChan 4 years, 10 months ago.

Assisted by: Luo Yang.

Author
Posts
#1455463
view NG.png

Hi Nigel,

In your reply #1448801, you provided a solution by using following short code.
<wpv-loop>
[wpv-conditional if="( CONTAINS(#(privilege),'[wpv-current-user info='login']') )"]
<h3>[wpv-post-link]</h3>
[/wpv-conditional]
</wpv-loop>

It works fine, but the products in the result page seems not so pretty since some empty spaces still exist as shown in the attached image.
The red circle represents the products not visible to this logged-in user.
Is it possible to remove it so that the vacancy can be filled?

Thanks.

#1455601

Hello,

I assume we are talking about this thread:
https://toolset.com/forums/topic/product-visibility-to-specific-user/

You can try taxonomy filter in to your post view, for example,
1) edit the post view:
in section "Query Filter" add a taxonomy filter:
Select posts with taxonomy:
privileges slug in one of those set by the View shortcode attribute wpvprivilege
eg. [wpv-view name="view-name" wpvprivilege="xxxx"]

2) Display above post view's shortcode, like this:

[wpv-conditional if="( '[wpv-current-user info='login']' ne '' )"]
[wpv-view name='your-post-view-slug' wpvprivilege='[wpv-current-user info='login']']
[/wpv-conditional]

More help:
https://toolset.com/documentation/user-guides/filtering-views-by-taxonomy/

#1457293

My issue is resolved now. Thank you!