Skip Navigation

[Resolved] Advice in filtering related posts via dropdown selection

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

Problem:
Advice in filtering related posts via dropdown selection - how to filter view with specific custom field value

Solution:
You can filter your view with view's shortcode attribute and pass the custom field value as view's shortcode attribute.

You can find the proposed solution in this case with the following reply:
=> https://toolset.com/forums/topic/advice-in-filtering-related-posts-via-dropdown-selection/#post-1368399

Relevant Documentation:
=> https://toolset.com/documentation/user-guides/passing-arguments-to-views/#controlling-the-filter-with-shortcode-attributes

This support ticket is created 4 years, 6 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 6 replies, has 2 voices.

Last updated by Kirk 4 years, 6 months ago.

Assisted by: Minesh.

Author
Posts
#1368343

Hello,

I've created a custom post type named 'Hire Pumps'. I've also connected a content template to the post type for its single items/pages that will display the custom field values on the right side, and all the hire pumps of the same type (Ex. Wastewater) on the left side.

The problem is that it shows ALL other hire pumps even if its not of the same type. We only need to display the posts/hire pumps of the same type.

How can I do this?

Thanks in advance for any help you can offer.

#1368375

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

As I understand - you are displaying the single post of post type 'Hire Pumps' and you want to display the other related posts on the left sidebar that should be belong to the same post type 'Hire Pumps' but currently its displaying all posts from all post type - correct?

You need to create a view that should query the post type 'Hire Pumps' and add it using the view's widget on your sidebar. But before that, I need to check on your install to verify how your page/post is configured. Please share problem URL where I can see the post and sidebar and access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1368383

Hello, yes, I would just like to display the posts under 'Hire Pumps' that has the same type (Ex. Wastewater) on the left side of the content.

Thanks in advance.

#1368385

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I need to check your structure first before I can guide you further and in order to guide you in the right direction. I think you forget the share the access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1368399

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now: hidden link

I've added the Query filter and filter it by shortcode attribute:
hidden link

And within the content template where you added the view, I've passed the shortcode attribute as given under:

[wpv-view name="more-hire-pumps-view" pumptype="[types field='hire-pump-type'][/types]" view_display="layout"]

More info:
=> https://toolset.com/documentation/user-guides/passing-arguments-to-views/#controlling-the-filter-with-shortcode-attributes

#1368519

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please confirm now the view is working as expected.

#1373539

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.