Custom Query Pagination. Can anyone help me fixing this code ?

  • Author
    Posts
  • #56981

    I don’t know whether the code is not working or i am doing something wrong. I have done all the steps but still might be i am not doing anything right. I have found this code on https://www.wpblog.com/use-wp_query-to-create-pagination/ and i have followed all the steps but still having problem.

    <?php
    get_header(); ?>
     
    <?php
    $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
    $args = array(
      'posts_per_page' => 4,
      'paged' => $paged
    );
    $custom_query = new WP_Query( $args );
    ?>
              <!----start-------->
    
    
    
     
    have_posts()) :
          $custom_query->the_post();
    ?>
           
            
    • " >
        "> </ul> <ul> <p><?php echo the_content(); ?></p> </ul> </div>
    <!-- end blog posts --> <?php endwhile; ?> <?php if (function_exists("pagination")) { pagination($custom_query->max_num_pages); } ?> </main><!-- #main --> </div><!-- #primary --> </div><!-- .wrap --> <!----end--------> <?php get_footer();
    #57072
    Zed
    Cryout Creations mastermind

    What file are you placing this code in?


    If you like our creations, help us share by rating them on WordPress.org.
    Please check the available documentation and search the forums before starting a topic.
Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Custom Query Pagination. Can anyone help me fixing this code ?’ is closed to new replies.