WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Custom Query and Pagination (3 posts)

  1. cmsnext
    Member
    Posted 3 years ago #

    I am trying to add pagination to the results of a custom query that I have created but am not able to do so.

    $querystr = "SELECT * wp_posts......;";
    $myValue = $wpdb->get_col($querystr);
    foreach ( $myValue as $theValue ) :
    here goes coding of getting the values and echo them
    endforeach;
    if(function_exists('wp_pagenavi')) { wp_pagenavi(); }

    using wppagenavi does not work and I understand that it will not work as it will not be getting the paged value.

    but considering the above query, how can I add pagination possibly via wp_pagenavi or any other method
    thanks in advance

  2. vtxyzzy
    Member
    Posted 3 years ago #

    See if this article can help: Pagination Using paginate_links()

  3. cmsnext
    Member
    Posted 3 years ago #

    perfect...

    thanks vtxyzzy

    after some trial / error and some mods made it to work

    thanks once again

Topic Closed

This topic has been closed to new replies.

About this Topic