• Could someone please tell me how to add custom post type pagination (I’m also using taxonomy)

    If anyone knows please send me the complete working code.
    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi, use the paged parameter in your custom query.

    Thread Starter Faisal Ramzan

    (@faisal-ramzan)

    Here is my code and i am also using it please send me complete code which i replace and thats going to show pagination at my home page.

    Thank you

    <?php $slider = new WP_Query(
    array (
    ‘post_type’ => ‘sliders’,
    ‘posts_per_page’ => 3,
    ‘orderby’ => ‘ID’,
    ‘order’ => ‘ASC’,
    )
    );?>
    ?>

    Here is:

    <?php
    $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
    
    $slider = new WP_Query(
    			array(  'post_type' => 'sliders',
    				'posts_per_page' => 3,
    				'paged' => $paged,
    				'orderby' => 'ID',
    				'order' => 'ASC' ) );
    ?>
    
    Thread Starter Faisal Ramzan

    (@faisal-ramzan)

    https://noheelajewellers.com/new/
    its not working above link show html pagination but i want to show dynamic i complete web site but stuck at this point please help me

    below code showing nothing
    another way you know please..

    <?php
    $paged = ( get_query_var( ‘paged’ ) ) ? get_query_var( ‘paged’ ) : 1;

    $slider = new WP_Query(
    array( ‘post_type’ => ‘sliders’,
    ‘posts_per_page’ => 3,
    ‘paged’ => $paged,
    ‘orderby’ => ‘ID’,
    ‘order’ => ‘ASC’ ) );
    ?>

    <div class=”alignleft”><?php previous_posts_link(‘? Previous’) ?></div>
    <div class=”alignright”><?php next_posts_link(‘More ?’) ?></div>

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom post type pagination’ is closed to new replies.