Skip Navigation

[Resolved] Coding Post Relationship (Parent of Child)

This support ticket is created 6 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.

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

Last updated by gabrielB 6 years, 1 month ago.

Assisted by: Minesh.

Author
Posts
#1118260

Hello again,

Sorry about this but apart from the above issue (I needed to show 2 related locations) I've got another issue related to this.

I also need to display related another CPT (Learning Partners). In this case however I will have one Learning partner that has the Custom Category "Awarding Body" and another "Accreditation". I was going to call these separately.

Could you take a look please?

#1118286

Minesh
Supporter

Languages: English (English )

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

Luo is on vacation. This is Minesh here and I will take care of this ticket. I hope this is OK.

Well - Could you please explain your issue and what is your expected output with problem URL. Please share as much information as you can that will help me to understand your issue that will help me to guide you in right direction.

*** 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 would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

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

#1118299

I realised you were working on the file and I deleted it for you. I'm sorry.

#1118300

Minesh
Supporter

Languages: English (English )

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

Well - If I'm right, you are talking about this page:
=> hidden link

I checked the page in backend and I see there are two entries there under post relationship meta box "Courses Locations":
=> hidden link

And I've added following to your template: File: parts/course-location.php

	echo "<pre>";
	print_r($related_locations);

I see its correctly fetching two entries. Could you please check where you are doing mistake as the function toolset_get_related_posts() returns correct related entries.

Note: please feel free to edit your PHP template, once you check the issue.

#1118312

Hi Minesh,

I'm terribly sorry. I must have saved over your work. I'm really sorry about this. Could you put the code you added, back?

I'm really sorry.

#1118314

Minesh
Supporter

Languages: English (English )

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

Ok - see this: hidden link

As you can see - the array contains two results. so I think there is no issue with Toolset and toolset function returns the correct related posts.

#1118327

Thanks for that, but there's something wrong. I can see code that shouldn't be visible.

#1118334

Minesh
Supporter

Languages: English (English )

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

Well - that code I made visible for you as a proof that the toolset function is correctly retrieving the related posts.

you can edit your template and remove the line:

echo "<pre>";
print_r($related_locations);

So, this doesn't seem to be the issue of Toolset.

#1118356
Screen Shot 2018-10-01 at 16.02.47.png

Hi Minesh,

thanks for all your help. However as you can see in the image, there is code that's being shown that is relative to the locations that shouldn't be shown. Could you have another look please?

Thank you so much.

#1118368

Minesh
Supporter

Languages: English (English )

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

I will look at this tomorrow morning.

#1118379

Hi Minesh,

I just realised that all I had to do was remove the following bit of code. That's done. Thank you so much.

	echo "<pre>";
	print_r($related_locations);

If it's possible, could you also take a look at the rest of my message? There were the following 2 points:

  • I can't seem to load the content of the related post. File: parts/course-location.php
  • I also need to display another related CPT (Learning Partners). In this case however I will have one Learning partner that has the Custom Category "Awarding Body" and another "Accreditation". I was going to call these separately. File: parts/course-accreditaion.php and parts/course-awarding-body.php

I can't thank you enough!

#1119003

Minesh
Supporter

Languages: English (English )

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

Ok - before this ticket becomes a long story, I split the tickets with your every new question and we will handle it separately.

Please feel free to close this ticket.

#1119041

Minesh
Supporter

Languages: English (English )

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

Please feel free to close this ticket as well. 🙂

#1119054

Super help! Thanks so much! My issue is resolved now. Thank you!