• Hello!

    The Older entries link at the bottom of my home page is now in a loop, bringing me to page 2 but displaying the same posts as page 1. Also, the older entries link on page 2 directs to page 2 when it should be page 3.

    Here’s the code on my .php page

    global $wp_query, $suffusion_unified_options, $page_of_posts;
    foreach ($suffusion_unified_options as $id => $value) {
    	$$id = $value;
    }
    $page_of_posts = true;
    
    get_header();
    
    $paged = get_query_var('paged');
    if (!isset($paged) || empty($paged)) {
    	$paged = 1;
    }
    //$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    
    $category_exclusive = get_post_meta($posts[0]->ID, 'category', true );
    
    if( $category_exclusive )
    {
    $cat = get_cat_ID($category_exclusive);
    $args = array(
    	'category__in' => array( $cat ),
    	'orderby' => 'date',
    	'order' => 'DESC',
    	'paged' => $paged,
    );
    }
    else
    {
    $args = array(
    	'orderby' => 'date',
    	'order' => 'DESC',
    	'paged' => $paged,
    );
    }
    $temp = $wp_query;  // assign original query to temp variable for later use
    //$wp_query = null; // Resetting this to null was causing a PHP Notice to pop up
    $wp_query = new WP_Query($args);
    
    suffusion_query_posts();
    ?>

    website is https://www.fredericsanchez.com

    It only does it on this particuliar page, not the others.

    Any idea what’s wrong ? Thanks a lot.

  • The topic ‘Older entries link not working anymore’ is closed to new replies.