Home › Forums › Calendar Products › Events Calendar PRO › Custom setup for list view
- This topic has 11 replies, 3 voices, and was last updated 12 years, 12 months ago by
Barry.
-
AuthorPosts
-
April 26, 2013 at 1:14 pm #46963
Joshua
ParticipantHello, I would like to edit the list.php view so that it would separate events by category. For example, category 1 on top and Category 2 on the bottom. How should I proceed with this?
April 27, 2013 at 5:37 am #47002Stefan
ParticipantHi, also would like to be able to do this. Ideally create separate list views by category. In other words link to list of just category 1 entries and link to list of just category 2 entries.
April 27, 2013 at 7:07 am #47005Joshua
ParticipantHey Stefan, to do what you’d like you need to set up two page templates with wp_query for pulling in an event category. I don’t remember now, but the forum has a tutorial on this. What I want is a little bit different, I want to divide multiple categories on the same page.
April 27, 2013 at 4:33 pm #47030Stefan
ParticipantThanks for this Joshua, very appreciated. Will try and find this tutorial. Hope you get some help soon with your query.
April 29, 2013 at 9:18 am #47134Barry
MemberStefan: a list view relating to a specific category already exists, you can reach it using the following pattern of URL:
example.com/events/category/CATEGORY_SLUG/upcoming/
So it may be that that will fit your needs without having to build your own queries.
April 29, 2013 at 9:23 am #47136Barry
MemberJoshua: what you want is a little more involved. It sounds like you don’t really want to modify the upcoming events list (which simply lists future events chronologically) but rather you want to build a new form of list view where all future events from Category A are listed first, then all future events from Category B, etc.
I’d imagine that to be fairly involved and would have various complexities relating to pagination and so on.
So unfortunately we can’t really offer much help on this one, but we can definitely leave this open in case other members of the community can comment and/or if you do arrive at a solution it would be great if you considered posting an update and sharing it 🙂
Thanks!
April 29, 2013 at 9:28 am #47140Joshua
ParticipantHey Barry. I currently have two seperate pages that list upcoming by category. Wouldn’t it be possible to list on one page both sets of events? You can see one category here: http://www.escoladabiblia.com/cursos-de-idiomas/
Second category here: http://www.escoladabiblia.com/cursos-biblicos/
I would like to view both in this fashion on one page.April 30, 2013 at 3:48 pm #47295Barry
MemberAhh, I see. You could probably leverage tribe_get_events() to query for and build two separate lists. Here is an example that pulls events from a specific category (using a tax query, just as you would do with WP_Query) and a specific date range.
The date range elements you could remove – and basically you could tweak it to fit your specific needs.
Does that help at all here?
April 30, 2013 at 6:56 pm #47308Stefan
ParticipantThanks Barry, that was exactly what I was after.
May 1, 2013 at 7:03 am #47344Barry
MemberExcellent. Joshua – does that give you what you need, too?
May 1, 2013 at 7:23 am #47348Joshua
ParticipantHey Barry. I believe so. I’m not learned in PHP so I’ve managed to get things working using trial and error. In this case I may have to get a friend who does to help me. I’ll see if he can use your instructions to get a list.php view that orders upcoming events by category and I need it to display a warning when there are no upcoming events (such as, check back later). thanks.
May 1, 2013 at 5:04 pm #47408Barry
MemberNo problem, I hope your friend can help you out there 🙂
-
AuthorPosts
- The topic ‘Custom setup for list view’ is closed to new replies.
