Pagination for event query

posts_nav_link() works off the main query. Instead of invoking your own $upcoming, just use query_posts( … ) to temporarily overwrite it, and the corresponding template tags… query_posts( array( ‘post_type’ => ‘tribe_events’, ‘eventDisplay’ => ‘upcoming’, ‘posts_per_page’ => 1, ) ); if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php tribe_get_template_part( ‘list/single’, ‘event’ … Read more

WordPress: Getting “Newer Posts” and “Older Posts” links on a Specialized Page Template

You can achieve this using WP_Query as shown in the following code. To know more information on this visit this page. <?php $paged = ( get_query_var( ‘paged’ ) ) ? get_query_var( ‘paged’ ) : 1; $the_query = new WP_Query( ‘posts_per_page=5&paged=’ . $paged ); if ( $the_query->have_posts() ) : // the loop while ( $the_query->have_posts() ) … Read more

Pagination for user list

You can use WP_User_Query class instead of get_users() function to achieve this. The new modified code will similar to following code. <?php /* * We start by doing a query to retrieve all users * We need a total user count so that we can calculate how many pages there are */ $count_args = array( … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)