Support » Fixing WordPress » next_posts_link() and previous_posts_link() not working

  • Resolved Praveen

    (@spraveenitpro)


    Hi I have the following code but the next _post_link and previous_posts_link are not printing the hyper link , it is rather printing text :

    <?php if (have_posts()) : ?>
    
            <?php while (have_posts()) : the_post() ;
            echo '<h2>';
            the_title();
            echo '</h2>';
            the_content();
            endwhile ;  ?>
    
            <?php next_post_link('Older Entries') ; ?>
            <?php previous_post_link('Newer Entries') ; ?>
    
        <?php else: ?>
    
             <h2>Nothing Found !!</h2>
    
    	 <?php endif; ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator keesiemeijer

    (@keesiemeijer)

    From which theme template file does the code come from (single.php)?

    Can you paste and submit the full code of the template file into a pastebin.com and post the link to it here? see the Forum Rules for posting code and using the pastebin.

    Praveen

    (@spraveenitpro)

    Hi

    I have only index.php and style.css as i am building it from scratching for learning purposes, here is the code at pastebin :

    http://pastebin.com/xD56WXXh

    Thanks

    Praveen

    Praveen

    (@spraveenitpro)

    Replaced with <?php previous_posts_link(‘Older Entries’); ?> <?php next_posts_link(‘Newer Entry’); ?> and it worked !!

    Thanks .

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘next_posts_link() and previous_posts_link() not working’ is closed to new replies.