Skip Navigation

[Resolved] Post query in Elementor based on current custom post type

This support ticket is created 4 years 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 – 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)

This topic contains 6 replies, has 2 voices.

Last updated by Shane 3 years, 12 months ago.

Assisted by: Shane.

Author
Posts
#2033313

Hi,

I have a page with custom post type: Physios.
On the single post page for the Physio setup with Elementor, I want to display blogposts tagged with the title of the custom post type.

As an example:

I have a single post page that shows as profile page for a Physio with the title "John Doe"
I have several blog posts tagged "John Doe".
On the single post page for John, I want to display all the blogs that is tagged with his name.

If I use the built in query the problem then is that they display on John's page, but they also will display on Jimmy's page which I don't want to happen.

#2033343

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Christine,

Thank you for getting in touch. In a case like this we may need to use a taxonomy query. Are the tags Taxonomies ?

Can you allow me to have admin access to the website so that I can have a look and a link to the page that you're trying to get the post lists to display ?

I've enabled the private fields for your next response.

Thanks,
Shane

#2034265

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Christine,

Thank you for the credentials, however i'm not able to log in.

Can you verify that these credentials work for you on your end ?

Thanks,
Shane

#2037413

Hi Shane,
Sorry for the delay, been working on a different project.

Yeah I reset the pwd to the one in the original message, so should work for you now. I have tested.

#2038289

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2021-04-30 at 10.20.57 AM.png
Screenshot 2021-04-30 at 10.20.50 AM.png
Screenshot 2021-04-30 at 10.20.41 AM.png

Hi Christine,

Thank you but I'm having a bit of trouble navigating. Where is the view that you are currently using to display the posts?

So for thisPhysio here.
hidden link

You will like to display this post below for them ?
hidden link

Essentially if the Physio's name is in the tags then display that post on their profile. Have you set up the view ? If so can you send me a link to the view on the backend ? Also if there is a template that you're using for the Physio please send me a link to this as well.

However when you create your view you can actually add a Query filter to the view for the Taxonomy. See Screenshot

Then select your Tags, now once the filter is added you will need to set it to filter by a shortcode attribute. See Screenshot

Finally you will set the filter to use the tag name instead of the slug. See Screenshot.

Now all that is needed to be done is after you've finished designed how you want you view to display is to add it to your page template using the shortcode format below.

[wpv-view name='my-view' wpvposttag='[wpv-post-title]' ]

Where the 'my-view' is the slug of your actual view.

Please let me know if this helps.
Thanks,
Shane

#2038427

Thank you Shane,

Yes you are correct that in the custom post page hidden link
I would like to display a blogpost with that is tagged with her name. I have tried setting this up in a new layout using elementor, the blogpost I would want to display under the social media icons in the right column: hidden link

I'm not using toolset to create the view, since I find elementor to be more flexible when it comes to styling without having to use css.

#2038559

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Christine,

You can use views to just create the list of blog posts and just add the view to the elementor template using the shortcode in my previous response.

Unless Elementor provides a way to query the posts and display other posts then you can use elementor, however the elementor team would need to provide you with the correct setup for this.

Thanks,
Shane