Skip Navigation

[Resolved] Filtering data by taxonomy relationship

This support ticket is created 6 years, 8 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 – 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 11 replies, has 2 voices.

Last updated by rainman 6 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#812882
award.png
badge.png

Can you make this thread private?

I have a custom template taxonomy-practice-area.php which does a very complicated display of cata from several custom post types. I have already provided a duplicator copy of my website in this ticket thread
https://toolset.com/forums/topic/filtering-custom-post-type-loop-output/page/2/#post-803218

I was working on localhost at that time, but have since made the revised website live. In that support thread I provided descriptions of my custom posts and how they are related along with screenshots.

In my template I'm using this code

<?php echo do_shortcode( '[wpv-view name="view-for-award-badges"]' ); ?>

And here is the "view-for-award-badges" code:

[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
	<wpv-loop>
		[wpv-post-body view_template="Loop item in View for Award Badges"]
	</wpv-loop>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
	[/wpv-no-items-found]
[wpv-layout-end]

My Problem
As you can see on this page:
hidden link
The wrong award badge is being displayed (see screenshot). It is for a different attorney.

See screenshot of the Award Badge custom post (which is being displayed on the page) showing the taxonomy set to "Rubin" and the relationship set to Rubin also.

I want the page to reference the URL query string "?l=441" and pull in only award badges which share the same 'Attorneys' taxonomy as attorney associated with that query string.

#816679

Shane
Supporter

Languages: English (English )

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

Hello,

Since this is your initial thread i'm not able to make it private.

However I can download the duplicator package and see whats up.

Could you let me know the correct information that should be displayed here.

Thanks,
Shane

#817049

The purple badge is for the wrong lawyer. It should be showing an orange badge for this lawyer. In the duplicator package there are only two badges. You may have to create one or two new test badges for your experimentation. But when you go to Attorneys > Doug Peters, you get a page with his photo and his award badge.

Then scroll to bottom and choose any of the other page listed under More About .... and you get a new sub-page for him and it too has his photo and his award badge.

If you go to Notable Cases > Doug Peters, you get his photo and award badge, but it is not working properly when you go to and of the sub-page options from there, like Child Sexual Molestation. The photo is correct, but the award badge is not.

#844288

Shane
Supporter

Languages: English (English )

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

Hello,

I've downloaded the duplicator package but it seems that it's not reflecting what is currently on your live site.

Could you recreate the duplicator package and upload it so that I can have an exact replica ?

Thanks,
Shane

#848195

Shane
Supporter

Languages: English (English )

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

Hello,

I believe that you may need to create a new view for this and use a different method of filtering it.

Because this page hidden link is a taxonomy archive.

I'm not sure how this page was build so i'm not able to do a proper trace but from what I can see this is going to require a completely different view filter to display the correct information.

Thanks,
Shane

#848427

Most of the development on this was done by Toolset staff (Ana Couto) as a paid custom job. So I don't understand it either. I really never did any of the Toolset stuff until I started to work on this.

Can you help me figure out how to do the new view?

#848506

Shane
Supporter

Languages: English (English )

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

Hello,

I would need to do some more investigation to see how this page was built, then we can move from there.

Thanks,
Shane

#872586

What is status? I really need to get this working.

#872771

Shane
Supporter

Languages: English (English )

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

Hello,

Sorry for the delay in response.

I was able to resolve this for you and it should now be filtering for the correct post.

Thanks,
Shane

#872814

You fixed it on the live site? What did you do? Did you edit any files?

#872845

Shane
Supporter

Languages: English (English )

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

Hello,

Yes I did.

What I actually did was to create a duplicate of the original awards view and then set this view to be filtered by a shortcode parameter.

Then I modified the code in the php file to reflect the following.

<div class="award-badges tablet-right">
						<?php 
						$term = wp_get_post_terms( $_GET['l'], 'attorney-tax' );

						echo do_shortcode( '[wpv-view name="view-for-award-badges-2" wpvattorneytax='.$term[0]->slug.']' ); 

						?>
					</div>

Thanks,
Shane

#872870

Awesome. Thanks!!!