Skip Navigation

[Resolved] How to show only tags from posts that are in the View results?

This support ticket is created 5 years, 11 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/Karachi (GMT+05:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by StanleyT8485 5 years, 11 months ago.

Assisted by: Waqar.

Author
Posts
#1190862

Tell us what you are trying to do?
I want to show only tags from posts that are in the View results.
The posts in the View results are children of the page where the Views is placed.

Additional info.
Results are under Woocommerce "Products"
The page where the Views is placed is under custom post type "Company"

What is the link to your site?
Localhost

#1191059

Hi Stanley,

Thanks for asking! I'd be happy to help.

If I understand what you've shared correctly, your current view is set to show a list of child posts, of the current page.

To show only tags from those child posts separately, you can duplicate your current view, and in the content template section, only add the tags shortcode, so that this particular view only shows tags of the participating posts.

In case you have a different requirement, you're welcome to share a link to your online website or some screenshots from the locally hosted website, to make it more clear.

regards,
Waqar

#1192321

Hey Waqar,
New tags will be constantly added. I don't think saving tags is the best way to do it.

We need something that will automatically update because there will be hundreds of tags and new ones getting added every single month.

More info.
Each Company (CPT) will have multiple tags and new tags will be added over time.
Each Company (CPT) will have their own company page where they can filter their own posts by tags.

Ideally, we use one view that will be able to cater to all the Companies' tags.

#1192542

Hi Stanley,

Thank you for clarifying that.

You can use a single view for this and the setup will require that:

1. Your "Company" CPT is connected to "Posts" CPT, through a one-to-many relationship.
(i.e. each company can have multiple posts)

2. Your view on a company page will have a fixed query filter to show only those posts which are connected to the currently logged-in user's company.

This will assume that you've already implemented what is suggested in the other ticket ( https://toolset.com/forums/topic/how-to-show-specific-pages-to-specific-users/#post-1192372 ) and each user holds the ID of a related company CPT in a user meta field.

3. Using a custom shortcode, you can extract that company's ID from the currently logged-in user and pass it to the view:
https://toolset.com/documentation/user-guides/passing-arguments-to-views/

4. As a result, your company page will always show only posts related to a specific company (connected to a logged-in user). To further allow a user to filter posts based on tags, you can add a front-end taxonomy filter:
https://toolset.com/documentation/user-guides/front-page-filters/

I hope this helps and please let me know if you need any further assistance around any of the above points.

regards,
Waqar

#1195721

My issue is resolved now. Thank you!