WordPress.org

Support

Support » How-To and Troubleshooting » previous_post_link problem

previous_post_link problem

  • I have tried to edit my code so that the previous_post_link function displays the text “Previous” on my site instead of the actual title of the article. I’ve looked at http://codex.wordpress.org/Template_Tags/previous_post_link and tried to follow the directions there by editing the function accordingly in archives.php, but the changes are not showing up. Does anybody know what might be wrong?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Would you pastebin your existing code so we can see what you’re doing?

    thx

    The original code is as follows:

    <div class="navigation">
    			<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
    			<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
    		</div>

    Here’s what I tried (unsuccessfully) to get it to just say ‘next’ or ‘previous’:

    <div class="navigation">
             <div class="alignleft"><?php next_post_link('%link', 'Next', TRUE); ?></div>
             <div class="alignright"><?php previous_post_link('%link', 'Previous', TRUE); ?></div>
         </div>

    Again, I believe I followed the directions perfectly on http://codex.wordpress.org/Template_Tags/previous_post_link . These changes were made in the archives.php file. Is there another file that should be edited?

    Someone…anyone?

    The top code should work, except you need to use next_posts_link (posts plural, not posts singular).

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘previous_post_link problem’ is closed to new replies.
Skip to toolbar