WordPress.org

Ready to get started?Download WordPress

Forums

next/previous not showing up (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.

    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? FWIW, I'm using the Compromise theme.

  2. stvwlf
    Member
    Posted 4 years ago #

    Hi

    I tried here what you are doing and it worked fine.

    I downloaded the Compromise theme - it has two sets of page links on the single page

    The set just below the content area uses wp_link_pages.
    The set you are working on is after the comments section ends.

    Make sure you are changing the code that creates the links you want to change.

  3. rjett
    Member
    Posted 4 years ago #

    Alright, it's still not happening for me. The site I'm working on is sabatoscrystalball.com . If you click on any article then scroll to the bottom, I want it to read Next | Previous instead of the title of the article. From what I understand, the wp_link_pages function you referenced manipulates the link text of articles that are multiple pages...right? I think I need to work with the next_post_link, but I'm not totally sure since everything I've done with it doesn't effect what I'm trying to accomplish.

  4. Shane G
    Member
    Posted 4 years ago #

  5. rjett
    Member
    Posted 4 years ago #

    Yea I've already seen this page and tried using these functions to no avail. I also have that plugin.

Topic Closed

This topic has been closed to new replies.

About this Topic