Forums

Next/Previous Links not working (37 posts)

  1. jberghem
    Member
    Posted 3 years ago #

    @Davex

    :: MOST IMPORTANT STEP!!! Went to http://YOUR BLOG NAME/blog/wp-admin/options-permalink.php and made sure DEFAULT is chose under COMMON SETTINGS

    Yes but some people prefer, and have been using custom permalinks. Changing this permalink back to default creates a whole lot of broken links on other websites that link to your posts or pages using the permalink. I noticed this same problem occurred on my blog after upgrading to 2.6.3

    The previous steps you mention are the proper steps to take when upgrading. That last step may be a solution to this problem, but is not the solution. I somehow get the feeling there is some sort of bug in WP 2.6.3 with the permalinks.

    This is however a completely different problem than the one this post started out with.

  2. dannyfoo
    Member
    Posted 3 years ago #

    I'm facing difficulty with this too. And it took me a really long time to just get the blog working especially with custom permalinks so my posts would display /blog/post-name/.

    This is what I'm currently using; http://pastebin.com/f12a445fb.

    Anyone got a solution yet?

  3. Donbert
    Member
    Posted 3 years ago #

    Fix: paging in WordPress under IIS

    For the last few minutes, I have been trying to figure out why next_posts_link() did not work on a template for a clients’ blog, under IIS.

    I found a great tip, but I prefer standard functions over things that work.

    Then I found out under IIS, PHP returns a wrong value for $_SERVER["REQUEST_URI"]. The link to the previous page was index.php/Index.php/page/2/. Notice there are two “index.php” (for Windows, index and Index are just the same.)

    The real, working, clean and easy solution is to add a simple line of code in the clean_url() function in wp-includes/formatting.php:

    $url = str_replace('index.php/Index.php','index.php',$url);

    just put this at the beginning of the function before any "if Statements" only thing is you have to remember to do this again if you upgrade word press.

    Hope this helps you out.

    My Site http://blog.ebookzones.com you will see my PageNav now works great.

    Don

  4. rizwanashraf
    Member
    Posted 3 years ago #

    Ok, this has bothered me for a long time and now i have finally found a solution on a website.

    Where's the problem? query_posts() is a powerful function, but in this situation it has a flaw: it overrides nearly everything in the standard posts object query, including what the paged offset is.

    How to fix it? To get proper pagination with query_posts() we need to recreate it through the 'paged' parameter or query. Best way to do this is to ask WordPress for the "page" we happen to be on, and use that as our 'paged' value. There's the code for it

    <?php if (have_posts()) : ?>
    <?php query_posts("category_name=somecat"); ?>
    <?php while (have_posts()) : the_post(); ?>

    replace with

    <?php if (have_posts()) : ?>
    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("category_name=somecat&paged=$paged"); ?>
    <?php while (have_posts()) : the_post(); ?>

    And that's it! The $paged = line above uses what's called a ternary operator to test whether the 'paged' query variable is available. If it is, $paged receives its value. If it isn't, we assume we're on the first page and assign it '1'. Then we tell query_posts() what page we're on with the addition of &paged=$paged.

  5. exiledesigns
    Member
    Posted 3 years ago #

    Many thanks rizwanashraf! That did it perfectly for me :)

  6. LastDragon
    Member
    Posted 3 years ago #

    Hi rizwanashraf, I use Original Premium News theme, I have the same problems with page navigation and I didn't find the code you were talking about. Where should I look for it, in the theme's pages or in WordPress pages? I have tried everything I read on this forum, but still I can't figure it out.

    Please, if you have the time to look at the problem, I'll be happy to give you more details. My blog is http://www.movietrailerworld.com

    Thank you.

  7. LastDragon
    Member
    Posted 3 years ago #

    Sorry for the mistype that's http://www.movietrailersworld.com

Topic Closed

This topic has been closed to new replies.

About this Topic