- This topic has 5 replies, 3 voices, and was last updated 5 years, 10 months ago by
Steve.
-
AuthorPosts
-
-
March 31, 2016 at 3:45 pm #6217
4michaelcolemanMemberOK, so I’m creating an event segment where I need to have multiple posts/pages. What this would look like is a main event page and then page for sponsors to sign up. What I would like is to be able for a user to create a new event, and within that new event the ability to fill out the event details (which I have already built), but also the ability to create a sponsor sign up. This could lead to more pages down the road for example exhibitors, etc.
What would be the best way to go about putting something like this together? These other pages would all sit under the same directory as the main event page.
Something like this:
/event-name/
/event-name/sponsors
/event-name/exhibitorsHow would I also setup the ability to edit these pages?
-
April 1, 2016 at 9:07 pm #6225
SteveKeymaster@4michaelcoleman– I don’t think I understand the question. Why are these pages different than the first?
-
April 2, 2016 at 12:44 am #6228
jrcreativeMember@4michaelcoleman
If I understand correctly, I think the first thing you need to do is set up your custom post type to act like a page by settinghierarchical => trueYou can add sub-pages to your custom post type programmatically with wp_insert_post() https://developer.wordpress.org/reference/functions/wp_insert_post/
You could create the sub-page when the page is created by running wp_insert_post() when the post is published, on hook in to some other event.
You can tie meta boxes to those pages by setting the “Template” variable in the comment block. You’ll need to make sure you add ‘page-attributes’ to the “supports” array when you setup the Custom Post type, and then create page templates to assign to those page types.
If you’re using front end forms for this, you’ll have to get creative about how to get the post ID into the query string so you’re updating the correct post.
One of the websites I maintain is a trade show site that has sponsors, exhibitors, and speakers associated with the shows, so I think I know what you’re going for. Best of Luck!
-
April 2, 2016 at 1:25 am #6229
4michaelcolemanMemberOriginally I had setup post for the event, but now they want additional pages for sponsors to register, and the same of exhibitors. So looking at how I can have these pages created when I create a new event. They will be simple information and credit card forms using authorize.net.
-
April 4, 2016 at 1:21 pm #6242
4michaelcolemanMemberThanks for the insight, will take a look at this and see if I can figure it out. If you have any examples that would help.
I also assume that I would be making these changes in the functions.php file correct?
-
April 4, 2016 at 10:34 pm #6246
SteveKeymasterfunctions.phpis a great place to make changes.
-
-
AuthorPosts
- You must be logged in to reply to this topic.