• mikeysyd

    (@michael-stephan)


    The older and newer entries links are not working, when clicked they lead to the following error page:

    Not Found
    The requested URL /blog/blog/ was not found on this server.

    The url has the word ‘/blog’ written twice instead of once as part of the url.

    the blog is here:

    Please help! I have spent ages trying to figure out what the problem is but since I am not a php programmer it seems it maybe out of my grasp. I have identified where the code is that relates to this and compared it to another theme and I can’t seem to see any errors. why is it doing that? how can I fix it?

    thanks.

Viewing 13 replies - 1 through 13 (of 13 total)
  • can you paste the php code from the template file, please? only the code for the next and previous links…

    Thread Starter mikeysyd

    (@michael-stephan)

    `<?php query_posts(“posts_per_page=1”) ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <div <?php post_class() ?> id=”post-<?php the_ID(); ?>”>

    <h2><a href=”<?php the_permalink() ?>”><?php the_title(); ?></a></h2>

    <?php include (TEMPLATEPATH . ‘/inc/meta.php’ ); ?>

    <div class=”entry”>
    <?php the_content(); ?>
    </div>
    <div id=”comments”>
    <div class=”postmetadata”>
    <div class=”tags”>
    <?php the_tags(‘Tags: ‘, ‘, ‘, ‘<br />’); ?>
    </div>
    <?php comments_popup_link(‘No Comments »’, ‘1 Comment »’, ‘% Comments »’); ?>
    </div>
    </div>
    </div>

    <?php endwhile; ?>

    <?php include (TEMPLATEPATH . ‘/inc/nav.php’ ); ?>

    <?php else : ?>

    <h2>Not Found</h2>

    <?php endif; ?>

    Thread Starter mikeysyd

    (@michael-stephan)

    `<div class=”next-posts”><?php next_posts_link(‘« Older Entries’) ?></div>
    <div class=”prev-posts”><?php previous_posts_link(‘Newer Entries »’) ?></div>

    Thread Starter mikeysyd

    (@michael-stephan)

    page.php `<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <div class=”post” id=”post-<?php the_ID(); ?>”>

    <h2><?php the_title(); ?></h2>

    <?php include (TEMPLATEPATH . ‘/inc/meta.php’ ); ?>

    <div class=”entry”>

    <?php the_content(); ?>

    <?php wp_link_pages(array(‘before’ => ‘Pages: ‘, ‘next_or_number’ => ‘number’)); ?>

    </div>

    <?php edit_post_link(‘Edit this entry.’, ‘<p>’, ‘</p>’); ?>

    </div>

    <?php // comments_template(); ?>

    <?php endwhile; endif; ?>

    It seems correct.
    Please, check in wp-admin under Settings > General,

    what are your settings for:
    – WordPress address (URL)
    and
    – Site address (URL)

    Thread Starter mikeysyd

    (@michael-stephan)

    also check your permalinks:
    https://codex.www.ads-software.com/Using_Permalinks

    you have a weird double /blog/ in the link:
    https://yoursite.com//blog/blog/?paged=3

    plus a double slash

    yoursite.com//blog

    Thread Starter mikeysyd

    (@michael-stephan)

    I have removed the extra slash and now it has stopped the above error but now all it dose is visit the current post when I click older or newer entry.

    I originally had a nicer permalink but it was giving me problems when I first started so I put it back to the ugly one.

    Thread Starter mikeysyd

    (@michael-stephan)

    I am just having a look at my .htacess

    Thread Starter mikeysyd

    (@michael-stephan)

    hmm I really can’t figure this out.

    I would remove the first line in the index.php template.

    This one:
    <?php query_posts("posts_per_page=1") ?>

    After that, try setting the number of posts in wp-admin > settings > reading > Blog pages show at most… to 1

    Thread Starter mikeysyd

    (@michael-stephan)

    thank you! that did it! I originally added that line by the instruction of an online course.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘older and newer entries links url is wrong’ is closed to new replies.