• I have an issue with using multiple instances of WP_query through the php code widget, at least I think that’s the problem. I’m building a website for a roller derby team and on their landingpage I display the 5 latest news items. In the sidebar I want to show information about oncoming events.

    There are 3 types of events (fresh meat day, bouts and public events). I’ve made a custom post type (event) that can be used to add a new event. The user can choose from 3 different taxonomies (fresh_meat_day, bout and public_event) to put the event posts in.

    I’ve managed to get this al working, as well as creating a designated page to show all events. What I want is for the ‘Home’ page to display the next event for each event type, but I can’t seem to get this working. I’m trying to display them in my sidebar, by using the php code widget. The widget seems to work fine (if I assign a value to a variable and tell wordpress to display the variable, it does). But when I try to use WP_query it doesn’t give any output.

    My ‘Home’ page uses WP_query to pull the latest 5 news posts so I thought this could maybe be some sort of conflict between WP-queries, I tried to reset WP query and rewind posts, but this doesn’t do the trick. Any thoughts on this would be greatly appreciated!

The topic ‘Problem with multiple loops and custom post type’ is closed to new replies.