Amend query in list.php

Home Forums Calendar Products Events Calendar PRO Amend query in list.php

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #27344
    Stefhan
    Participant

    Hi, I’ve been trying to get the ECP plugin to show only one instance of recurring events in list view (see https://theeventscalendar.com/support/forums/topic/recurring-events-problem-2/#post-26355). I’ve managed to figure out how to query the database to achieve what I’m after, but when I try to apply this to the query in list.php it doesn’t return anything – the page is blank. I tried using query_posts and WP_Query but both returned nothing.

    Can someone explain how to amend the query in list.php? I’ve pasted the code I’ve tried in Pastebin: http://pastebin.com/R4i5NMVM.

    Many thanks

    #27389
    Barry
    Member

    Hi Stefhan: I can pretty much run the same query locally (at the top of the list.php template) and I still see events, it doesn’t result in a blank page.

    I’m guessing you’re not actually passing date as you have done in your paste and that’s just to give us a general idea of what you are doing … or have you actually defined this as a constant?

    #27630
    Stefhan
    Participant

    Thanks Barry – I’ve taken out the date bit but still can’t seem to make it return anything. I’ve tried every permutation I can think of but with no luck – the page loads but gives up when it gets to the query.

    I’ve created a new paste here: http://pastebin.com/2vLiP6HM – could you tell me where I’m going wrong?

    thanks!

    #27632
    Barry
    Member

    Hey Stefhan.

    No problem – if I use this code http://pastebin.com/0YAsSvs1 (the only real change to your code is it echoes out titles of events) it runs without any problems.

    I’m guessing you do have published events – so if you aren’t seeing anything then I can only guess that it is something to do with the context in which your code is running.

    Are you testing this out in isolation or might various other queries be running before and after this one? Have you shut down other plugins / changed to a default theme for testing purposes?

    #27732
    Barry
    Member

    Stefhan, I’m not sure there is going to be a huge amount of further support we can offer up for what is after all custom code – but I just wanted to check if you had any more questions relating to this that I might be able to help with before closing the thread?

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Amend query in list.php’ is closed to new replies.