wordpress deafult paggination
//this is for post query with default paggination and
//post with comment only
<?php
$paged = ( get_query_var('paged') ) ? get_query_var( 'paged' ) : 1;
query_posts(
array (
'comment_count' => array(
'value' => 1,
'compare' => '>=',
),
'post_type' => 'gallery',
'posts_per_page' => 10,
'paged' => $paged )
);
// The Loop
while ( have_posts() ) : the_post();
?>
the_post_thumbnail() ;
etc etc
here you can call anyting you want
<?php
endwhile;
the_posts_pagination( array( 'mid_size' => 2 ) ); //this function is for calling the paggination on custom tempalate page
// Reset Query
wp_reset_query();
?>
Are there any code examples left?
New code examples in category Other
-
Other 2023-03-27 22:50:10 how to select the whole line in vscode with keyboard shortcut
-
Other 2022-03-27 22:45:24 income of a web developer
-
Other 2022-03-27 22:35:01 \pyrcc_main.py: File does not exist 'resources.qrc'
-
Other 2022-03-27 22:30:45 rick roll embed code
-
Other 2022-03-27 22:20:08 Circuit_04_Potentiometer
-
Other 2022-03-27 22:20:05 iterative power
-
Other 2022-03-27 22:15:11 flutter run all
-
Other 2022-03-27 22:10:05 when is karlson release
-
Other 2022-03-27 22:10:02 wp .htaccess example
-
Other 2022-03-27 22:00:08 bash pause in file read line by line