Skip Navigation

[Resolved] show a specific taxonomy in Views short code

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

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 7 replies, has 3 voices.

Last updated by ben 4 years, 2 months ago.

Assisted by: Luo Yang.

Author
Posts
#1522227

ben

Hi,

I have a CPT call FAQ and I created a few taxonomy (kind of tag) for that, and I created a Views for that (and please note that I didn't create any query filter for that Views), when use something like:

[wpv-view name="faq-list"] or [wpv-view name="faq-list" view_display="layout" limit="5"]

the frontend looks very good. However, for now, I only want to show a specific taxonomy on the frontend, is there a way I can add a parameter or data inside of the [wpv-view name="faq-list"] short code to make that happen?

thanks,
Ben

#1522297

Yes, add a Query Filter for the taxonomy and specify that the View shall only display Posts with the term specified in the ShortCode attribute of your choice.
Then you can insert the View in a page and pass the shortcode attribute you chose with the term you want.

Note, this will only work for Views that Query Posts, and have a Taxonomy Query Filter by ShortCode attribute.

See here a few more informations:
https://toolset.com/documentation/user-guides/views/passing-arguments-to-views/
https://toolset.com/documentation/user-guides/views/passing-arguments-to-views/#filters-by-taxonomies

#1522409

ben
screenshot-1.jpg

thank you Beda,

I tried that you suggested and my frontend still showing the posts from all categories instead of the specific category I set.

[wpv-view name="faq-list" view_display="layout" wpvfaqtag="payment"]

and for the query filter, I choose: View shortcode attribute.

Attached is a screenshot , but it's all Chinese characters. If you have problem to view it, maybe we can assign this ticket to Lou Yang, he can read Chinese.

Thank you.

#1522453

You chose to query the ShortCode attribute by NAME - but you've inserted the SLUG in the ShortCode, it seems to me.

Please change the View Query Filter to use "Slug" of the term, instead of "Name"

That should solve the issue

#1522461

ben

you are right, the screenshot is Name.

I tried both Slug and Name, but still no luck 🙁

#1522463

This is strange, but there are 2 more variables:

1. Order by default and secondary ordering, if those are by not native data, then it might be some terms do not have that data and won't show
2. Please try with inserting the entire view [wpv-view name="faq-list" wpvfaqtag="payment"] like so

If that does not work, can you share access?

#1526581

Ben 你好,

感谢你提供的信息,我可以登录到你的网站并看到改问题,下面是我的找到的问题:
编辑view "faq-list",
hidden link

在“查询过滤器”,我看到你设置了正确的过滤器:
选择分类文章:
FAQ标签 别名在一个,由视图简码属性wpvfaqtag设置
例如 [wpv-view name="view-name" wpvfaqtag="xxxx"]

但是在"搜索和分页"框内,你使用了代码:
[wpv-control-post-taxonomy taxonomy="faq-tag" type="checkboxes" url_param="wpvfaqtag"]
上面的代码会自动覆盖“查询过滤器”的设置。

也就是说,你只能添加一个基于"FAQ标签"的过滤,如果使用了[wpv-control-post-taxonomy taxonomy="faq-tag" ...], 那么在“查询过滤器”的设置就会失效。

你可以尝试移除 "搜索和分页"框内的代码:
[wpv-control-post-taxonomy taxonomy="faq-tag" type="checkboxes" url_param="wpvfaqtag"]
看看修复没有。

#1526605

ben

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.