tibe_get_events() only gets the four events

Home Forums Calendar Products Events Calendar PRO tibe_get_events() only gets the four events

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1152391
    Sunil
    Participant

    I’ve built a plugin for publishing events.
    I built the plugin using a test site with dummy events. Once I got it working I installed the plugin a local development version of a website that I’ve got in production.

    In my dummy test site, the plugin works as expected. There’s a template that gets events and publishes html.
    That full template can be seen here: https://github.com/sunilw/events-grid/blob/master/loop/grid_loop.php

    On the development site ( a clone of a production website ) tribe_get_events() only gets four events even though eight events have been created and are in ‘published’ mode.

    To make sure that the WordPress settings weren’t over-riding the number of events published, I went to ‘settings’->’reading’ and set ‘blog pages show at most’ to ’12’.
    This didn’t change anything.

    To test my call to tribe_get_events(), I added this line to my template:

    Hello from Events Grid. We got <?php echo count(tribe_get_events()) ?> posts

    This echos the number ‘4’.

    What could be stopping tribe_get_events() from getting all events?

    #1152395
    Sunil
    Participant

    Figured it out…

    A closer look at the this page tells me what the issue is: https://theeventscalendar.com/knowledgebase/using-tribe_get_events/

    In the plugin settings I had left a default option.
    Under ‘General’ -> ‘Settings’ -> ‘Number of events to show per page’ the default option is ‘4’.

    I set that higher.

    I guess alternatively I could override that in my $args.

    #1152415
    Cliff
    Member

    Hi Sunil.

    Yes, it does use the posts_per_page argument.

    Thanks for letting us know your issue is resolved.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘tibe_get_events() only gets the four events’ is closed to new replies.