• Amedi

    (@amedi)


    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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • 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.

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

    Thread Starter Amedi

    (@amedi)

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

    @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.

    Thread Starter Amedi

    (@amedi)

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

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

    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

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Pagination not working 404’ is closed to new replies.