How to reset query on events list page

Home Forums Calendar Products Events Calendar PRO How to reset query on events list page

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #130527
    Adrian Cumpanasu
    Participant

    I made a widget for listing todays events. It works well.
    In the events list page… instead, it lists the same events as the list’s query,
    even if I put reset query before and after the code.

    here is the code: http://pastebin.com/B5Ma3Q1A
    I have stripped down the event’s details for clarity

    #130926
    Barry
    Member

    Hi! Great to see things like custom widgets being built 🙂

    Can I ask you to share your code via a service such as Pastebin or Gist, though? The forum by itself isn’t great at handling code and I’m a little worried some of what you posted has been inadvertently stripped out.

    #131008
    Adrian Cumpanasu
    Participant

    Thanks you! I have edited the post.

    #131147
    Barry
    Member

    OK – can you try adding an eventDisplay property to your query arguments with a value of custom – does that help?

    #131180
    Adrian Cumpanasu
    Participant

    This reply is private.

    #132423
    Barry
    Member

    That’s right, ‘custom’ is a string literal: can I ask you to share your updated code so I can take a look and see what you are currently using?

    #132862
    Adrian Cumpanasu
    Participant
    #133046
    Barry
    Member

    OK, so right now I see:

    $events_today = tribe_get_events(
    	array(
    		'start_date'=>$CurrentDate,
    		'end_date'=>$CurrentDate
    	)
    );

    Can you try:

    $events_today = tribe_get_events(
    	array(
    		'eventDisplay' => 'custom',
    		'start_date' => $CurrentDate,
    		'end_date' => $CurrentDate
    	)
    );
    #134084
    Adrian Cumpanasu
    Participant

    this way it lists only one event that doesn’t make sense.
    If you want a backend login I will post it private next.

    #134090
    Adrian Cumpanasu
    Participant

    admin1
    provisorio

    This way you can see the site

    #134096
    Adrian Cumpanasu
    Participant

    This reply is private.

    #135204
    Barry
    Member

    We can’t help too much with custom development questions, I’m afraid. Basically what I wanted to illustrate is that you need to use the custom eventDisplay argument if you want to avoid your own query from being in some aspects “taken over” by the main events query (such as in list view).

    We’ll need to leave the rest to you – good luck!

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘How to reset query on events list page’ is closed to new replies.