[resolved] Get Page Permalink (3 posts)

  1. picard102
    Posted 6 years ago #

    Simply put I want to be able to get the permalink for a specific page ID and output it as a url with no formating or title.

    <a href="[page id X URL]"> My own text</a>

  2. stvwlf
    Posted 6 years ago #

    if within the WP loop
    <a href="<?php echo get_permalink(); ?>"> My own text</a>

    if outside the WP loop, or the permalink of a page/post that is not active, you must know the page ID. if the page ID # is 15, it looks like this
    <a href="<?php echo get_permalink(15); ?>"> My own text</a>

  3. picard102
    Posted 6 years ago #

    Awesome! You rock.

Topic Closed

This topic has been closed to new replies.

About this Topic