Support » Themes and Templates » How can I remove Previous/Next?

  • Hi all,

    If you check out you’ll see that the navigation on the home page has a “previous” link followed by a tiny grey box which will change to orange when you pass your mouse over it. That tiny grey box is the “next” link, but because there is no “next” it shouldn’t be there at all. Also, if you click on the previous link you’ll be taken to the previous entry (which is the first entry) and there will be a “next” link but the “previous” link is now a tiny grey box.

    What I really want is for there to be no tiny grey box when there is no “next” or “previous” entry so that the navigation will collapse properly.

    Can someone help me fix this?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Look in your “header.php” and remove or comment out the call.

    Isn’t that in the index.php file? Depending on theme, it may be inside the “else” part of the loop, or outside it.

    samboll —

    I’m not sure I understand how your suggestion would help. Commenting out or removing the call for the “Previous” or “Next” link would defeat the purpose of having that link in the first place. In effect, if I comment out “Next” then there won’t be a “Next” link when I need it.

    I think my problem is rather simple;

    The tag I’m using to display the next and previous links is this one (, which seems to auto-magically display the “Previous” link when there is a previous entry and the “Next” link when there is a next entry and both when there is both a next and a previous entry. The problem then is that my unordered list, which is how those links are being displayed, is still displaying an empty list item (the tiny grey box) when there is no link to display. What I need to do is somehow make that list item itself (the tiny grey box) disappear when there is no actual content for it.

    Simply put, even though there is no text to display, my unordered list is still displaying an empty list item. How can I remove that empty list item yet have it appear when it isn’t empty?

    Did that explaination help, or is everyone totally confused?

    Ahhhhh…. maybe knowing what theme you’re using would help.

    vkaryl —

    I’m actually attempting to create my own theme. If you check out this website you can see what I’m trying to accomplish. None of the other links work yet, but the previous and next links do.

    Yah…. I looked…. nice, but all I’m really seeing is a duplicated li tagset with either “paged=2” or “index.php” in it when I view source of either index.php or paged=2.

    Which was why I asked about theme…. sometimes you need to look at the vanilla code from the author. But if you’re coding this from scratch, I don’t know what to tell you without digging a lot deeper (which I personally haven’t time to do – I’m off elk hunting early in the morning….)

    vkaryl —

    Thanks for your help and good hunting! Anyone else have any suggestions for me? If it might help, here’s the actual code in my index.php for my main navigation (I haven’t broken everything up yet);

    <div id="mainNav">
    <li><a href="<?php bloginfo('url'); ?>/copy/" title="Copyright">&copy;</a></li>
    <li><a href="<?php bloginfo('url'); ?>/about/" title="About">About</a></li>
    <li><a href="<?php bloginfo('url'); ?>/archives/" title="Archives">Archives</a></li>
    <li><a href="<?php bloginfo('url'); ?>/" title="Home">Home</a></li>
    <li><?php posts_nav_link('','Next &raquo;','') ?></li>
    <li><?php posts_nav_link('','','&laquo; Previous') ?></li>

    code edited and removed by myself as I find that it wont work.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How can I remove Previous/Next?’ is closed to new replies.