Add pagination to venue list

This topic contains 4 replies, has 2 voices, and was last updated by  Duarte Lourenco 9 years, 9 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #17006

    Hello, I have a foreach loop that creates a list of all the venues, with a linked name, description and thumbnail, if these exist. Like so:

    $venues = eo_get_venues();
    
    if( $venues ){
      foreach($venues as $venue){
        $venue_id = (int) $venue->term_id;
        printf('some html here', eo_get_venue_link($venue_id), esc_html($venue->name));
        echo 'html' . eo_get_venue_thumbnail( $venue_id ) . 'html';
        echo 'html' . eo_get_venue_description( $venue_id ) . 'html';
      }
    }
    

    Is it possible to add pagination to this? If so, how? If not, how can I have a paginated list of venues with titles, links, thumbnails and descriptions? I can’t figure this out… So thank you very much for any help

    Duarte Lourenco
    #17049

    Still trying to solve this 🙂

    I’m looking for something like the events listing, but for venues (and tags, etc)

    Duarte Lourenco
    #17071

    Loading, for example, 10 at a time should work as well.

    Or the hability to create an equivalent loop but with “query” or “wp_query”… I could work with that!

    I’m just trying to think of alternatives!…

    Duarte Lourenco
    #17075

    Hi Duarte,

    I had a snippet for creating a page template which lists venues. I’ve just updated it to support pagination: https://gist.github.com/stephenharris/4988324

    It’s perhaps not the neatest of solutions, but it is the easiest….

    Stephen Harris
    #17147

    Thank you, I really appreciate it.
    Ended up using it on a couple of pages 🙂

    Duarte Lourenco
Viewing 5 posts - 1 through 5 (of 5 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.