Support » Fixing WordPress » Trouble with posts_nav_link() (don’t show anything)

  • Resolved Kiezkicker

    (@kiezkicker)


    Hi,
    I have some trouble with my postings. On my blog- http://www.kiezkicker.de/blog/ – just a single page was showing. At the position where I’d added
    <?php posts_nav_link('','','&laquo; vorherige Eintr&auml;ge') ?>
    nothing was shown- and the result was that nobody could browse to older postings without using the searchengine.

    This problem was the same in the category-archiv as on the mainpage.

    I read at http://codex.wordpress.org/Next_and_Previous_Links that it wouldn’ work on version 2.0.4 – but I run 2.2
    On this page I could read that I should use “Use the alternative links –>. Previous Post (http://codex.wordpress.org/Template_Tags/previous_post_link) Next Post” instead.

    But I wouldn’t display just a single post on each click?!

    Could you explain what I have to do to display the “next page” – link on the mainpage and the archive, again?

Viewing 7 replies - 1 through 7 (of 7 total)
  • To clarify:
    the next/prev is to be used only on single post view (i.e. in your single.php file)!

    the post_nav_link is to be used on multipost views – index, archive, category, search.

    Now, if you have a custom, modified Loop, it will stop working.

    Does it work if you switch to the default theme?

    Ah.

    No. After I changed it back to “WordPress Default 1.6” it doesn’t work, too.

    But – why it would stop working if I change the default-loop?
    And – what’s the default one?

    Hm. Maybee any other suggestions?

    The_Loop – that’s the standard. If anything is used to change its default behaviour (like query_posts, get_post etc.) the next/prev doesn’t work.

    Sorry that I mentonied again – but it still don’t working for me at http://www.kiezkicker.de/kiezkicker

    My index.php of my theme looks like the following:

    <?php get_header(); ?>
    
    	<div id="content" class="startseite">
    
    	<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    
    		<div class="post">
    
    			<h2 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    
    			<p class="date"><?php the_time('d. F') ?><br /><?php the_time('H:i') ?> Uhr <!-- von <?php the_author() ?> --></p>
    
    			<div class="entry"><div class="rubrik"><?php the_category(', ') ?></div><?php the_content('Read the rest of this entry &raquo;'); ?>
    
    			</div>
    
          <p class="postmetadata"><?php edit_post_link('bearbeiten','','<strong>|</strong>'); ?>  <?php comments_popup_link('Kommentieren »', '1 Kommentar »', '% Kommentare »'); ?></p>
    
    			<!--
    
    			<?php trackback_rdf(); ?>
    
    			-->
    
    		</div>
    		<?php posts_nav_link(); echo "Before this echo there was the posts_nav_link(); - funcion"; ?>
    
        <?php endwhile; else: ?>
        <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
        <?php endif; ?>
    	</div>	
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

    As you could see on my page the echo behind posts_nav_link(); was shown on the end of the page. But there wasn’t any “Next page” or “Prev page” – link.
    I installed http://www.jenst.se/2008/03/29/wp-page-numbers for test-reasons. Even this plugin displayed me a link for this single indexpage – no other pages before.
    It seemed that the function wasn’t there?!

    Ahm. Changing `
    <?php posts_nav_link(); echo “Before this echo there was the posts_nav_link(); – funcion”; ?>

    <?php endwhile; else: ?>`
    to

    <?php endwhile; else: ?>
        <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
        <?php endif; ?>
    		<?php posts_nav_link(' — ', __('&laquo; Older Posts'), __('Newer Posts &raquo;')); ?>

    wouldn’t helped, too. 😉
    And I have re- upload wp-includes fresh from the 2.5 tar.gz

    Kiezkicker

    (@kiezkicker)

    OK, it’s resolved. I had installed the plugin Adhesive which makes posts sticky. After deactivating the plugin the “next posts” and previous post” – link would re-appear.
    The developer of Adhesive would be informed about this bug.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Trouble with posts_nav_link() (don’t show anything)’ is closed to new replies.