WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Page navigation doesn't work (9 posts)

  1. radjavi
    Member
    Posted 1 year ago #

    Hello, I recently installed a new theme and it's working perfectly except that the page navigation doesn't work, when I click page 2 it sends me back to page 1 even though the URL is /page/2.

    My index.php: http://pastebin.com/R44VeaUM

  2. srcnix
    Member
    Posted 1 year ago #

    First things first, reload your rewrite rules as they may have been obscured by the themes functions.

    To do this go to settings -> permalinks -> save.

    If this doesn't solve the issue let me know.

    Note: I haven't looked at your code as not enough time right now.

  3. radjavi
    Member
    Posted 1 year ago #

    I have already tried the permalinks but it does not fix it.

    I have read other posts about this issue and they have fixed the issue by people giving them the right coding for the index.php, but I'm not that good in coding so..

    I have tried their fixes as well but it doesn't work for me.

  4. Good Guy
    Member
    Posted 1 year ago #

    Have you got a live link for us to see it in action?

    If you have changed the permalinks, you also need to check if the .htaccess file has also made the necessary changes. This should be in the WordPress folder and sometimes it is hidden.

  5. radjavi
    Member
    Posted 1 year ago #

    Here is the website: http://www.fgnews.hostzi.com/

    Scroll down to the bottom of the homepage.

  6. keesiemeijer
    moderator
    Posted 1 year ago #

    I think your home page is using a Page template to show the posts (page-blog-3.php?).

    Look in that page template for this:

    $paged = (get_query_var("paged")) ? get_query_var("paged") : 1;

    and change it to:

    $paged = (get_query_var("page")) ? get_query_var("page") : 1;

    http://codex.wordpress.org/Pagination#Troubleshooting_Broken_Pagination

    As this is a premium theme which you paid for, your purchase should have included support from either the theme author or where you purchased the theme from. It would be best to contact them for specific instructions on how solve this issue.

  7. radjavi
    Member
    Posted 1 year ago #

    There is no such code in the page template, here is my page-blog-3.php: http://pastebin.com/hbJwQdfe

  8. keesiemeijer
    moderator
    Posted 1 year ago #

    Try changing this:

    $args=array(
        'cat' => $select_blog_category,
        'orderby' => 'date',
        'order' => 'DESC',
        'paged' => $paged
        );

    to this:

    if ( get_query_var('paged') ) { $paged = get_query_var('paged'); }
    elseif ( get_query_var('page') ) { $paged = get_query_var('page'); }
    else { $paged = 1; }
    $args=array(
        'cat' => $select_blog_category,
        'orderby' => 'date',
        'order' => 'DESC',
        'paged' => $paged
        );
  9. radjavi
    Member
    Posted 1 year ago #

    It worked, thanks a lot!!

Topic Closed

This topic has been closed to new replies.

About this Topic