Viewing 5 reply threads
  • Author
    Posts
    • #6217

      OK, 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/exhibitors

      How would I also setup the ability to edit these pages?

    • #6225
      Steve
      Keymaster

      @4michaelcoleman– I don’t think I understand the question. Why are these pages different than the first?

    • #6228
      jrcreative
      Member

      @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 setting hierarchical => true

      You 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!

    • #6229

      Originally 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.

    • #6242

      @jrcreative

      Thanks 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?

    • #6246
      Steve
      Keymaster

      functions.php is a great place to make changes.

Viewing 5 reply threads
  • You must be logged in to reply to this topic.