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?
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.
I realised you were working on the file and I deleted it for you. I'm sorry.
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.
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.
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.
Thanks for that, but there's something wrong. I can see code that shouldn't be visible.
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.
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.
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
I will look at this tomorrow morning.
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!
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.
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Please feel free to close this ticket as well. 🙂
Super help! Thanks so much! My issue is resolved now. Thank you!