• I’d like to retrieve the equivalent of previous_posts_link & next_posts_link but have it not return inside an anchor tag.

    I could go into the wp code, but obviously I’d prefer something that doesn’t break on upgrade.

    Anyone know how to do this? Thanks in advance… !

Viewing 4 replies - 1 through 4 (of 4 total)
  • so I guess you don’t want the URL, but the title, right?

    <?php
      $nextPost = get_next_post();
      echo get_the_title($nextPost->ID);
    ?>

    substitute the word ‘previous’ where appropriate.

    Thread Starter nykm

    (@nykm)

    Thanks… no, the URL

    Sorry if that wasn’t clear.

    Thread Starter nykm

    (@nykm)

    I’ve edited the source files, but it just seems silly. Thought maybe I missed a tag.

    <?php
      $nextPost = get_next_post();
      echo get_permalink($nextPost->ID);
    ?>

    yeah, was kind of hard to guess, with a link you have both a URL and a title, didn’t know which one you wanted… went with the title, because that’s what shows with the regular links.

    either way, this will give you the URL.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘return previous / next posts link NOT as anchor?’ is closed to new replies.