WordPress.org

Ready to get started?Download WordPress

Forums

Pagination not working 404 (6 posts)

  1. Amedi
    Member
    Posted 1 year ago #

    My pagination is not working, it only displays the current page 1 when clicking 2 or 3 .. I get 404 error, below is the code :

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args = array(
    'post_type' => 'estate',
    'paged' => $paged,
    'posts_per_page' => $showposts);

    When I change 1 to 3 for example, it shows the third page correctly and clicking page 1 (only) also works fine but clicking back 3 I get 404 error. As:
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 3;

    Any Solution please I spent 3 days googeling.

  2. KaugKo
    Member
    Posted 1 year ago #

    could you try 'page' instead of 'paged'.

    (get_query_var('page')) ? get_query_var('page') : 1;

    Could you show me the current showing url here pls. and could you check this link.

    http://wordpress.stackexchange.com/questions/44537/why-is-page-2-not-working

  3. Amedi
    Member
    Posted 1 year ago #

    I tried this I didn't work. It is not online .. it is on localhost..
    By the way it is custom type..

  4. KaugKo
    Member
    Posted 1 year ago #

    @Amedi, could you show me your url pls. It doesn't need to be online because I want to check the structure. and also that blog post tell, you can't give same slug for page and custom post type.

  5. Amedi
    Member
    Posted 1 year ago #

    Thanks KaugKo, here is the URL:
    http://localhost:16001/All/?paged=2 // this gives 404
    http://localhost:16001/All/?paged=1 // this is ok

    where can I change the Slug for the custom type or the page?

  6. KaugKo
    Member
    Posted 1 year ago #

    you can change the page's slug by editing the page and underneath the page title input box there is a link to edit and you can edit the name there.

    For custom post type. it is depend on whether you used plugin or wrote in the function.php. If you used plugin, try to find that plugin and change there. if you used function.php change from function.php

Topic Closed

This topic has been closed to new replies.

About this Topic