• I have the following code as a link in my sidebar to display a link to my latest log entry:

    <div class="taglinks">
      <?php query_posts('showposts=1'); ?>
      <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
        <p><a href="<?php the_permalink(); ?>">Read our latest log entry</a></p>
      <?php endwhile; else: ?><p>no latest article!</p><?php endif; ?><br />
    </div>

    Whilst this works on my homepage it does not work when the sidebar is within a post. I recently changed my permalinks from non-pretty to pretty. Would this have confused things?

    You can see the problem here under Quick Links in the sidebar, under the link ‘Read our latest log entry’.

    As an added complication I’m working on this site ‘behind closed doors’ and have kept the original ‘index.asp’ file in the root so the public can’t see the site. ‘index.php’ also exists but .asp takes precedent, which is why if you just go to the root you still see the old site. This means in order to see the new site ‘/index.php’ has to be added after ‘.com’ to any new WordPress page. This should not, however, confuse the above-mentioned permalink. The only thing that is confused is me. Please help!

  • The topic ‘Permalink confusion: the_permalink not working outside of root’ is closed to new replies.