Skip Navigation

[Resolved] Pulling custom post type entries into the default 'add new' WP page template

This support ticket is created 5 years, 7 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 1 reply, has 2 voices.

Last updated by Beda 5 years, 7 months ago.

Assisted by: Beda.

Author
Posts
#1274693

We've built a newsletter-type page template that will display 'upcoming events' on the right rail. I'd like to be able to display a drop down or multi-select list of available events that have been created using the custom post type on the page editor screen so that a user can create a page the standard way (title, content, featured image, etc.) but also be able to select events from a menu to include within the new page. Hopefully that makes sense. 🙂

Is this something that your plug-in supports directly or is it something that we would have to custom code?

Thanks in advance for your assistance.

#1274867

Toolset could help you to have a "Select" input (dropdown) in the backend when editing a post, so you can select another post, and this will "relate" that post to the edited post.
This means later you can also display those related posts within the edited post.

To achieve this you probably want to create a Post Relationship.
Probably you will need a "One To Many" Relationship, where the "one" end is the post Type you edit and plan to add other, related posts to it in the select field.
The "Many" end is the Post Type of which you want to choose options (events).

After setting up this relationship, let's say you create it between pages and events, then you'll be able to edit a page, and add as many Events you want by selecting them (if existing) from a Select input.
This is a Post Relationship, it can later be displayed using Views.

We have some information about this as well starting here:
https://toolset.com/documentation/post-relationships/

Please let me know if this is what you imagined after you've set up such a relationship, I can then show you how to display that data if you want to show the related events on the front end.

Note, you could maybe also use the Post Reference Field, this is similar to the posts relationships, but not as powerful.
However, if you simply need to refer to other posts it may be enough:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/using-post-reference-fields-to-display-information-from-a-related-post/