Posts are not showing up on next page.

For one thing, that plugin hasn’t been updated in 8 years (https://wordpress.org/plugins-wp/wp-page-numbers/). George W. Bush was still president when that code was written. You should never use plugins that are not actively maintained because they most likely won’t work. Try wp_page-navi (https://wordpress.org/plugins/wp-pagenavi/). It’s actively developed/maintained.

Style first 3 posts differently and use a 2nd loop to get rest of posts / offset and pagination broken

My advice would be to never use query_posts. Instead use a custom query or the pre_get_posts hook for both instances and always make sure you call wp_reset_postdata after your custom query. BUT becase your nav function references the global $wp_query, you would have to use query_posts passing the paged parameter to it. <?php get_header(); ?> … Read more

Second page of archive is empty

How is the archive.php of your own theme looks like? Are you creating your theme based on underscore? You probably missing the get content part after the pagination. For example, here is part of the archive.php based on underscore theme: if ( have_posts() ) : ?> <header class=”page-header”> <?php the_archive_title( ‘<h1 class=”page-title”>’, ‘</h1>’ ); the_archive_description( … Read more

Add pagination to custom page

You need to set up query for pagination, look at this example : $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $args = array( ‘post__in’ => $ids, ‘post_type’ => ‘product’, ‘paged’ => $paged, ‘posts_per_page’ => 15); query_posts($args);

Pagination not working on my archive page for a custom post type

So I got this to work by adding this function to functions.php // Custom query for events function set_posts_per_page_for_events_cpt( $query ) { if ( !is_admin() && $query->is_main_query() && is_post_type_archive( ‘events’ ) ) { // set date $currentdate = date(“Y-m-d”,mktime(0,0,0,date(“m”),date(“d”),date(“Y”))); $meta_query = array( array( ‘key’=>’event_date’, ‘compare’ => ‘>=’, ‘value’=> $currentdate, ‘type’ => ‘DATE’, ), ); $query->set(‘meta_query’, … Read more

How to fix pagination for custom loops?

The Problem By default, in any given context, WordPress uses the main query to determine pagination. The main query object is stored in the $wp_query global, which is also used to output the main query loop: if ( have_posts() ) : while ( have_posts() ) : the_post(); When you use a custom query, you create … Read more

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