modify main loop for rss feed

Home Forums Calendar Products Events Calendar PRO modify main loop for rss feed

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #46117
    Sean
    Participant

    Hi all,

    I’m trying to modify the main loop in a custom rss feed (so that I can order events correctly while still honoring the event cat) however, I have run into a small problem. If I use tribe_get_events it returns everything and doesn’t honor the event cat. If I take out the tribe_get_events bit then the cats are honored, but the sorting is by post date. I know the solution is to modify the main query, but I cannot figure it out.
    So, my question is, can I use tribe_get_events with query_posts? If so, will that even work? And lastly, has anyone successfully created a useful event feed?

    Thanks, Sean

    #46123
    Sean
    Participant

    Update, the tribe_get_events does work with query_posts. It does honor the category and it does order correctly. What doesn’t work is the start date part, the query returns all events in April, starting on the 1st. Damn! so close. Any ideas?

    Sean

    #46124
    Jonah
    Participant

    Hi Sean,

    It would be helpful to get some examples of code you’re working with. You can share code here via http://snippi.com/

    tribe_get_events() and query_posts() both kind of do the same thing – they query for posts – so I don’t think you’d really want to use them together. Typically if you need to modify a query, you want to use pre_get_posts() (http://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts)

    Does that help?

    #46133
    Sean
    Participant

    Thanks for your response, Jonah. This stuff is giving me a headache 🙂
    Here’s my snippi:
    http://snippi.com/s/cqavp8h
    for some reason, once I use tribe_get_events, the category is no longer honored:
    http://sfrecpark.org/events/category/golden-gate-park-calendar/?feed=events

    Sean

    #46226
    Jonah
    Participant

    Hi Sean,

    Do you mean that when you are in an event category, the query is not honoring only showing events in the feed for that category? You probably need to modify the query to check if you are on a taxonomy archive (http://codex.wordpress.org/Function_Reference/is_tax) and then pass in an argument for that particular tax.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘modify main loop for rss feed’ is closed to new replies.