Pagination on custom wp_query in WordPress takes to 404 error page

前端 未结 3 1201
春和景丽
春和景丽 2020-12-20 19:10

Im have a loop with wp_query with the following code:

         


        
3条回答
  •  感情败类
    2020-12-20 19:47

    you can Change your query

    $wp_query= null; $wp_query = new WP_Query();
    $wp_query->query("showposts=2&paged=$paged");
    

    to

    $wp_query = new WP_Query("showposts=2");
    

    It's shown 2 Post per page and you can see and access your page 2.

提交回复
热议问题