Custom page with events loop based on category.

Home Forums Calendar Products Events Calendar PRO Custom page with events loop based on category.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #962184
    victoria bell
    Participant

    I am trying to create a custom page template for the main events page which will display the next 4 events for each of 6 event categories. What loop code do I use for each category?

    I would also like to create a list view page for each of the 6 event categories. How do I do this?

    Couldn’t find the solution in the forums. Thank you!

    #962368
    Josh
    Participant

    Hey Victoria,

    Thanks for reaching out to us!

    To start, you can query the events by using the tribe_get_events() function. You can pass the same arguments you would for a normal get_posts() or WP_Query to this function. That way, you can run multiple queries and within each target the specific categories that you would like.

    To show list view archives of each of the categories you can take advantage of the default archives that are available for the event categories. You can find this by going to yourdomain.com/events/category/cat-slug and replacing the “cat-slug” with the slug for the category that you would like to view.

    Let me know if this helps.

    Thanks!

    #962506
    victoria bell
    Participant

    Thanks Josh. I understand how to display the archive of categories as a page, but I’m still stuck on displaying a specific number of events based on category on a single page.

    I essentially have 5 different categories (‘citywide’, ‘central’, ‘east’, ‘west’, ‘seasonal’) and I would like to display 4 events per category in a <div>.

    I pasted my code here: http://pastebin.com/sNwt6cBt and really appreciate further direction. I know how to work with custom post types but I can’t seem to wrap my head around these events.

    Thank you!

    #962833
    Josh
    Participant

    Hey Victoria,

    Here is a gist on how to set up the query for the events you would like to display https://gist.github.com/BeardedGinger/7886729d4a8db2360e40 (untested). This is the general direction and will also need to be filled out with the information and additional “foreach” loops that you can see in the examples here.

    This would replace the entire “WP_Query()” that you have set up on the code that you’re currently using for the page.

    Let me know if this helps.

    Thanks!

    #962951
    victoria bell
    Participant

    This reply is private.

    #963415
    Josh
    Participant

    Hey Victoria,

    I apologize for the confusion. I’ve just updated the gist with a little more structure, showing exactly where to add the markup you would like in controlling the layout for the loop.

    If you would like further assistance in getting the custom template set up, you can reach out to a recommended developer. If you send an email to support[at]theeventscalendar.com we’d be happy to supply a list of recommended developers.

    Thanks!

    #970864
    Hassen
    Participant

    This reply is private.

    #971412
    Josh
    Participant

    Hey Victoria,

    It’s been a while since we’ve heard from you. We’ll go ahead and close this thread and if you have any further questions, please don’t hesitate to open a new one.

    Hassen,

    If you would like some assistance in our forums, please don’t hesitate to open a new thread with your request.

    Thanks!

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Custom page with events loop based on category.’ is closed to new replies.