K
K
Konstantin2022-04-20 20:21:36
WordPress
Konstantin, 2022-04-20 20:21:36

How to link posts?

I have headings "Doctors" and "Clinics".

Accordingly, in each heading, an entry is either a doctor or a clinic.

How to connect them, in one place? (so that changes can be made in one record)

So that, for example, a doctor using ACF (there is an Attitude - records field) I can indicate that he belongs to a specific clinic and display it in the card. And in order not to do the same with the clinic, and the clinic automatically brought out a doctor who belongs to her.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
KingAnton, 2022-04-20
@gradk

In the doctor's card, enter the id of the clinic (you can use the text field, select, ratio) and, based on the id of the clinic, display information about it in the doctor's card:

echo get_the_title( $id );
echo get_field( 'field_name', $id );

Same with the clinic.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question