Pagination with WP_query giving same items in each page

After digging for sometime I’ve managed to solve it. The issue was I wasn’t passing paged variable in the args. After passing it and tweaking the pagination logic it is working now. <?php $data = getData(); if(!empty($_REQUEST[‘posts’])){ $args = array( ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 15, ‘category_name’ => $_REQUEST[‘posts’], ‘paged’ => $paged … Read more

Category url; have it only answer to 1 category

Here’s how I did to fix it. Added this to my functions.php $url = $_SERVER[‘SERVER_NAME’].$_SERVER[‘REQUEST_URI’]; if($_SERVER[‘HTTPS’]){ $url=”https://”.$url; }else{ $url=”http://”.$url; } $id = url_to_postid( $url ); $url = parse_url($url,PHP_URL_PATH); $canonical = parse_url(wp_get_canonical_url($id),PHP_URL_PATH); if($url != $canonical){ wp_redirect(wp_get_canonical_url($id),302); } Basically if I hit an url that is not its own canonical, force a redirect. @Tom J Nowell, weird … Read more