
Hi
I have tried to replace the default post layout on the 'default' template with a custom layout.
The code used is similar to the code below.
I have tried several settings to get the pagination to work but the same posts in the grid refreshes all the time. The pagination page numbers appear but the first page post list displays regardless of the settings.
When I remove the custom loops the pagination works again.
I have set the default post loop to only show on mobile devices so that it doesn't show on desktops but the pagination issue remains.
What is the correct way to implement the pagination with custom post loops?
<?php wp_query arguments $args ( 'post_type'?> array( 'post' ),
'post_status' => array( 'publish' ),
'cat' => '193',
// 'category_name' => 'possimus-aliquid-beatae-eos-odit',
// 'fields' => 'ids',
// Skip SQL_CALC_FOUND_ROWS for performance (no pagination).
'no_found_rows' => true, // counts posts, remove if pagination required
// 'nopaging' => false,
// 'paged' => '1',
'posts_per_page' => '4',
'ignore_sticky_posts' => false,
'no_found_rows' => true,
// 'offset' => '1',
'order' => 'DESC',
'orderby' => 'date',
'cache_results' => false,
'update_post_term_cache' => false, // grabs terms, remove if terms required (category, tag...)
'update_post_meta_cache' => false, // grabs post meta, remove if post meta required
);
// The Query
query_posts($args);
//Get the Posts
theme_blog_9();
// Restore original Post Data
wp_reset_postdata();
?>
Regards
Bruce
Hi I have tried to replace the default post layout on the 'default' template with a custom layout. The code used is similar to the code below. I have tried several settings to get the pagination to work but the same posts in the grid refreshes all the time. The pagination page numbers appear but the first page post list displays regardless of the settings. When I remove the custom loops the pagination works again. I have set the default post loop to only show on mobile devices so that it doesn't show on desktops but the pagination issue remains. What is the correct way to implement the pagination with custom post loops? <?php wp_query arguments $args ( 'post_type'?> array( 'post' ), 'post_status' => array( 'publish' ), 'cat' => '193', // 'category_name' => 'possimus-aliquid-beatae-eos-odit', // 'fields' => 'ids', // Skip SQL_CALC_FOUND_ROWS for performance (no pagination). 'no_found_rows' => true, // counts posts, remove if pagination required // 'nopaging' => false, // 'paged' => '1', 'posts_per_page' => '4', 'ignore_sticky_posts' => false, 'no_found_rows' => true, // 'offset' => '1', 'order' => 'DESC', 'orderby' => 'date', 'cache_results' => false, 'update_post_term_cache' => false, // grabs terms, remove if terms required (category, tag...) 'update_post_meta_cache' => false, // grabs post meta, remove if post meta required ); // The Query query_posts($args); //Get the Posts theme_blog_9(); // Restore original Post Data wp_reset_postdata(); ?> Regards Bruce