WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] next_posts_link() and previous_posts_link() not working (4 posts)

  1. spraveenitpro
    Member
    Posted 1 year ago #

    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; ?>
  2. keesiemeijer
    moderator
    Posted 1 year ago #

    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.

  3. spraveenitpro
    Member
    Posted 1 year ago #

    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

  4. spraveenitpro
    Member
    Posted 1 year ago #

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

    Thanks .

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags