WordPress.org

Ready to get started?Download WordPress

Forums

previous_post_link problem (5 posts)

  1. rjett
    Member
    Posted 4 years ago #

    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?

  2. Jonathan Dingman
    Member
    Posted 4 years ago #

    Would you pastebin your existing code so we can see what you're doing?

    thx

  3. rjett
    Member
    Posted 4 years ago #

    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?

  4. rjett
    Member
    Posted 4 years ago #

    Someone...anyone?

  5. elainevdw
    Member
    Posted 4 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic