Support » Fixing WordPress » Get Page Permalink

  • Resolved John Leschinski


    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>

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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>

    Awesome! You rock.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Get Page Permalink’ is closed to new replies.