URL rewrite breaking pagination

This works: mysite.com/sermon/term/childterm/page2/ This does not: mysite.com/sermon/term/childterm/page2/ according to your rewrite rule, I guess what you mean is This works: mysite.com/sermon/term/page2/ This does not: mysite.com/sermon/term/childterm/page2/ I’m not a regex expert so I only come up with adding another rewrite rule to handle the childterm situaion add_rewrite_rule( ‘sermon/(.*?)/(.*?)/page/?([0-9]{1,})/?$’, ‘index.php?post_type=”.$cpt.”&’.$tax.’=$matches[2]&paged=$matches[3]’, ‘top’ );

pagination for blog landing page

This works for me with no 404s <?php $args = array ( ‘posts_per_page’ => 5 , ‘paged’ => $paged, ‘ignore_sticky_posts’ => true ); $blog_query = new WP_Query($args); if ( $blog_query->max_num_pages > 1 ) { next_posts_link(‘&larr; Older posts’, $blog_query->max_num_pages); previous_posts_link(‘Newer posts &rarr;’, $blog_query->max_num_pages); } while ( $blog_query->have_posts() ) { $blog_query->the_post(); // STUFF } if ( $blog_query->max_num_pages … Read more

One post on frontpage and an archive page

Alter the main query for the front/home page with is_front_page() and/or is_home(), like shown below: add_action(‘pre_get_posts’,’wpse104878_alter_main_query’); function wpse104878_alter_main_query($query){ if ( is_admin() || ! $query->is_main_query() ) { return; } if( $query->is_main_query() && is_front_page() || is_home() ){ $query->query_vars[‘posts_per_page’] = ‘1’; } } The archive page should work, if underscore starter theme has an template for it. You … Read more

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