WordPress.org

Ready to get started?Download WordPress

Forums

Nav links not working (1 post)

  1. Rohin
    Member
    Posted 6 months ago #

    <?php function my_content_nav( $nav_id ) {
    	global $wp_query;?>
    	<nav id="<?php	echo $nav_id;?>">
    		<?php if ( $wp_query->max_num_pages > 1 ) :?>
    		<h3 class="assistive-text"><?php _e('Post navigation', 'my');?></h3>
    		<?php next_posts_link(__('<span class="meta-nav nav-previous">&larr; Older posts</span>', 'my'));?>
    		<?php previous_posts_link(__('<span class="meta-nav nav-next">Newer posts &rarr;</span>', 'my'));?>
    		<div class="clear"></div>
    		<?php endif; ?>
    	</nav><!-- #nav-above -->
    <?php } ?>
    
    <?php function my_post_nav( $nav_id ) {
    	global $wp_query; ?>
    	<?php if ( $wp_query->max_num_pages > 1 ) :?>
    	<nav id="<?php	echo $nav_id;?>">
    		<h3 class="assistive-text"><?php _e('Post navigation', 'my');?></h3>
    		<?php previous_post_link( '%link', '<span class="meta-nav">&larr;</span> %title' )?>
    		<?php next_post_link( '%link', '%title <span class="meta-nav">&rarr;</span>' )?>
    		<div class="clear"></div>
    	</nav><!-- #nav-above -->
    <?php } ?>

    Please let me know what is wrong with the above code it is breaking my wordpress install.

Reply

You must log in to post.

About this Topic