Forums

[resolved] Current URL Under the Post (6 posts)

  1. RenFromPenn
    Member
    Posted 2 years ago #

    I want print the URL of the current page under the post. Does any one know how I might go about doing that?

  2. Mark / t31os
    Moderator
    Posted 2 years ago #

    Yeah, just plonk <?php the_permalink() ?> where you want it... :)

    If you have a problem using it, let me know some details about what file you're adding it to etc.... ;)

  3. RenFromPenn
    Member
    Posted 2 years ago #

    That worked perfectly. Thanks! :-)

  4. Mark / t31os
    Moderator
    Posted 2 years ago #

    You're welcome...

    Please mark as resolved.. (to the right --->)

  5. benz001
    Member
    Posted 2 years ago #

    Watch out - this will only work if the_permalink() is called from inside the loop. If you call it outside the loop you'll get a link, but it won't be for the current page!

  6. Mark / t31os
    Moderator
    Posted 2 years ago #

    Yes that's right, as we've found the codex isn't very clear on noting.

    You'd pass an ID into the function when used outside the loop.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags