WordPress.org

Ready to get started?Download WordPress

Forums

older and newer entries links url is wrong (14 posts)

  1. mikeysyd
    Member
    Posted 3 years ago #

    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.

  2. boryanka
    Member
    Posted 3 years ago #

    can you paste the php code from the template file, please? only the code for the next and previous links...

  3. mikeysyd
    Member
    Posted 3 years ago #

    `<?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; ?>

  4. mikeysyd
    Member
    Posted 3 years ago #

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

  5. mikeysyd
    Member
    Posted 3 years ago #

    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; ?>

  6. boryanka
    Member
    Posted 3 years ago #

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

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

  7. mikeysyd
    Member
    Posted 3 years ago #

  8. alchymyth
    Forum Moderator
    Posted 3 years ago #

    also check your permalinks:
    http://codex.wordpress.org/Using_Permalinks

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

  9. boryanka
    Member
    Posted 3 years ago #

    plus a double slash

    yoursite.com//blog

  10. mikeysyd
    Member
    Posted 3 years ago #

    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.

  11. mikeysyd
    Member
    Posted 3 years ago #

    I am just having a look at my .htacess

  12. mikeysyd
    Member
    Posted 3 years ago #

    hmm I really can't figure this out.

  13. boryanka
    Member
    Posted 3 years ago #

    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

  14. mikeysyd
    Member
    Posted 3 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic