Support » Themes and Templates » remove top before -next nav but Keep bottom twentyten

  • child of twentyten:

    So I don’t want the top before and next navigation on single.php
    I take this

    <?php /* Display navigation to next/previous pages when applicable */ ?>
    <?php if ( $wp_query->max_num_pages > 1 ) : ?>
    	<div id="nav-above" class="navigation">
    		<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' ) ); ?></div>
    		<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?></div>
    	</div><!-- #nav-above -->
    <?php endif; ?>

    out of the loop – call the page loop-single.php
    and all seems good…
    BUT there now is no bottom before and next navigation either?? Weird.

    I try adding the bottom nav

    <?php /* Display navigation to next/previous pages when applicable */ ?>
    <?php if (  $wp_query->max_num_pages > 1 ) : ?>
    				<div id="nav-below" class="navigation">
    					<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' ) ); ?></div>
    					<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?></div>
    				</div><!-- #nav-below -->
    <?php endif; ?>

    directly to single.php and that doesn’t pull it in either.

    I am confused. Why? Help?

Viewing 4 replies - 1 through 4 (of 4 total)
  • esmi

    (@esmi)

    Forum Moderator

    Um – shouldn’t you be creating a custom version of loop-single.php in your child theme? The code you quoted is from loop.php.

    Well I thought that was what I had done.
    I took the top nav part off of the loop and then made a file called loop-single.php in the child theme.

    It did take off the top nav..but also took off the bottom next-pre nav,
    even though that was still there in loop-single.php.

    Michael

    (@alchymyth)

    Forum Moderator

    the codes that you are showing, are for multipost pages, such as archives and the front page (see the s in next_posts_link ?)

    for the single post, it is this code:

    <div id="nav-below" class="navigation">
    					<div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?></div>
    					<div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'twentyten' ) . '</span>' ); ?></div>
    				</div><!-- #nav-below -->

    from loop-single.php of the original Twenty Ten.

    http://codex.wordpress.org/Function_Reference/next_post_link
    http://codex.wordpress.org/Function_Reference/previous_post_link

    Thank you alchymyth.. it’s always the little things like an ‘s’..LOL
    I’ve got it working now, thanks to you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘remove top before -next nav but Keep bottom twentyten’ is closed to new replies.