Skip Navigation

[Waiting for user confirmation] How to get the taxonomy link from the other Post type

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 3 replies, has 1 voice.

Last updated by Minesh 1 day, 6 hours ago.

Assisted by: Minesh.

Author
Posts
#2835925
Capture.PNG

Hi Support, I need your help as I'm struggling how to implement this.

I have Custom Post Types:
Clinic → slug: /clinic/
Doctor → slug: /doctors/
Clinic Booking → slug: /clinic-bookings/
Clinic Contact→ slug: /clinic-contact/

I have taxonomy on the Doctor post type:
Doctor Location Assign → slug: /doctor-location-assign/

Relationships:
Doctor ↔ Clinic → many-to-many (doctor-clinic intermediary post), slug: /doctor-clinic/
Clinic Booking ↔ Clinic → one-to-one (/clinic-bookings/)
Clinic Contact ↔ Clinic → one-to-one (/clinic-contact/)

On the Clinic page (hidden link), I have a menu (I used custom header so that I can insert html)

Menu:
Doctors: (link to doctor taxonomy page),
Afterhours: link to other page
Policies: Anchor link on the clinic page
Contact: (link to another page but connected on the clinic ),
Book Button: (link to another page but connected on the clinic ).

Pls focus on these 3 menus items: Doctors, Contact, & Book Now Button

By the way, I used this shorcode on the "Doctors Menu" to landed on the doctor taxonomy page and it worked if I'm inside on the clinic page.

/doctor-location/[wpv-post-slug]" inside on the link

[ Doctors]

The "Doctors menu" linked to the doctor taxonomy page which here: hidden link. (These show all doctors connected on this clinic.)

Now, here is the challenge:

If I'm on Contact or Booking page (that related on the clinic & same menu instructure ) if I click the 'Doctors Menu', how to ge the url on the Doctor taxonomy page?

Can you provide me shortcode if you have like I did on the clinic page.? Or any idea how to implement? My goal only is, the 'Doctors Menu' on the contact or booking page neeedd to landed on the Doctor Taxonomy Page same as the clinic page which here: hidden link.

We have 100+ clinics to upload but on the demo site just only 1 for now.

Note: Contact and Booking page are relationship on the Clinic. While the Doctors page I mentioned is taxonomy page for Doctors.

Hopefully you find a solutions!

#2835963

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

You saild:

If I'm on Contact or Booking page (that related on the clinic & same menu instructure ) if I click the 'Doctors Menu', how to ge the url on the Doctor taxonomy page?

Can you please share couple of links of Contact and Booking page and tell me on what URL you want to redirect user when user click on what and on what taxonomy page you want to redirect user.

#2836031
Capture.PNG

Hi, you can click the Contact menu or the Book Now button. (See attached screenshot)

Here is the contact clinic page for (mcintyre): hidden link
Here is the Booking clinic page for (mcintyre): hidden link

The challenge:
If you are on that following pages (clinic contact or Booking page)and if you click the 'Doctors Menu' (that I circled on the screenshot), it need to redirect to the Doctor taxonomy page here: hidden link

#2836111

Minesh
Supporter

Languages: English (English )

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

I understand what you need now but we will require bit of matching between slugs you use so that we can connect two entities that is doctor-location and (clinic or booking).

For instance, you use using the following taxonomy and term you added is "McIntyre Medical Centre" and slug of this term is "mcintyre-medical-centre":
- hidden link

Now the challenge is, how to identify that when you are on contact-clinic page:
- hidden link

You need to match the "doctor-location" taxonomy term name with "contact-clinic" post slug "mcintyre".

Either we can search post slug "mcintyre" within the "doctor-location" taxonomy terms and if found for instance, "mcintyre-medical-centre", then we will build that URL based on the found slug or there should be exact match of the slug so "doctor-location" taxonomy term slug "mcintyre-medical-centre" should be renamed to "mcintyre" then we can find "doctor-location" taxonomy term slug equal to "contact-clinic" post slug that is: "mcintyre" (taxonomy term slug) = "mcintyre" ("contact-clinic" post slug).

In both cases you will be have to really careful with the term slug "doctor-location" and post slug of "contact-clinic" or "clinic-bookings".