Using $paged redirects /page/2 to page 1

I’ve setup a custom query for my posts (single.php) with pagination, which by the way is working great with the default permalink structure. domain.com/p=ID&paged=2 if I switch the permalinks to /%postname%/ the page/2/ redirects to the first page. <?php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $args=array( ‘connected_type’=> ‘posts_to_posts’, ‘posts_per_page’ => 3, ‘paged’ => $paged, … Read more

Customising rewrite rules for CPT single post URL to work as paged URL

I’ve got a CPT called Service registered as following: $args = array( ‘public’ => true, ‘publicly_queryable’ => true, ‘show_ui’ => true, ‘has_archive’ => false, ‘rewrite’ => array(‘slug’ => ‘services’, ‘with_front’ => false), ‘query_var’ => true, ‘capability_type’ => ‘post’, ‘hierarchical’ => false, ‘show_in_nav_menus’ => false, ‘menu_position’ => 20, ‘supports’ => array( ‘title’ ‘editor’, ‘thumbnail’, ‘author’, ‘revisions’ … Read more

Paginate_links won’t create the right links on a taxonomy filtered custom post type archive

after hours and dozen of tests and messes… i’m face to the wall and fed up searching (mainly cuz my google’s answers are already all clicked !) I’m trying to display paginate_link with a filters taxonomy form (AGAIN ????? ;). With all solutions here, I’ve found how to get the right numbered pagination in a … Read more

Merged two WP_Queries, posts per page and pagination not working

I merged two WP_Queries with the code below, it has pagination setup as well as posts per page in the final combined object but those settings aren’t working. My page shows 24 posts, where is it getting this number from and why isn’t pagination working? $args1 = array( ‘post_type’ => ‘post’, ‘posts_per_page’ => -1 ); … Read more

Customized first post techniques

There doesn’t seem to be a standard technique for differentiating first/top posts. After looking around, I found this method: $current_query = new WP_Query(‘post_type=current&post_status=publish’); // Pull out top/first post $first_post = ( $paged == 0 ) ? $posts[0]->ID : ”; while ($current_query->have_posts()) : $current_query->the_post(); if ($first_post == $post->ID) { echo ‘<div class=”post top-post-special” id=”post-‘ . get_the_ID() … Read more

Change page /2 to /transcript with a Rewrite

I set up this rule (in functions.php) function custom_rewrite_basic() { add_rewrite_rule( ‘episode/([^/]+)/transcript’, ‘index.php?post_type=episodes&episodes=$matches[1]&page=2’, ‘top’); } add_action(‘init’, ‘custom_rewrite_basic’); expecting it to redirect www.domain.com/episode/postname/2/ over to www.domain.com/episode/postname/transcript/ but it’s still going to /2/. Interestingly enough, if I type in www.domain.com/episode/postname/transcript/ it still works, but does a redirect to /2/. I have installed the Rewrite Analyzer plugin and … Read more