简体   繁体   中英

WordPress - Choose From A List Of Posts To Display On A Page

I am fairly experienced in the ways of WordPress but have come across something that has me stumped.

I have a number of pages which are 'Treatments' and a custom post type called 'Staff'.

Everytime I create a treatment I want to be able to choose 1 or more staff members who are qualified to carry out that treatment.

So my question is, how do I set up WordPress to allow me to select from a number of staff members?

What the staff post contains is essentially a profile and I want to be able to pull that into the treatment.

In my mind I am envisaging it as either a series of check boxes within each of the events that displays all staff members

OR

That might be overkill if staff numbers grow significantly and therefore maybe some kind of repeater field with a drop down that displays the staff names.

I know I could do this with a number of different templates for the treatments and some categories or tags attached to the staff members, but it is better to do this with one generic template.

All thoughts to help me towards a solution are greatly appreciated.

Thanks for your time and help in advance.

Perhaps an easy alternative solution would be to use a plugin such as this . It's for managing participants, but it also works for things like keeping track of staff.

As for putting the staff information in posts, that plugin has a shortcode [pdb_single] that will list a single person's information. You can find out more information on shortcodes by reading the "other notes" page on the plugin page.

Super easy.

Create a custom function holding all of your staff members information. When creating a new 'treatment' post, call the appropriate staff members information using the custom fields. If the staff member is provided in the custom field, and if the staff member is found it will output the staff members information. You'll have to modified your treatment page to output the custom fields output.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM