Title: get permalink post page
Last modified: August 20, 2016

---

# get permalink post page

 *  Resolved [royromviel](https://wordpress.org/support/users/royromviel/)
 * (@royromviel)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/get-permalink-post-page/)
 * Here is the thing:
 * I have a hyperlink in my template page that has to be linked to the page where
   all the posts are loaded (standard in wp = index.php)
 * But I have a static page and permalinks turned on. So the posts page is another
   page.
 * Is there a function (something like `the_permalink(postspage);`) that I can call
   that automaticly fill in the right permalink?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/get-permalink-post-page/#post-2889051)
 * You can get the id of the main posts page using `get_option('page_for_posts ')`
   followed by `get_permalink( $id )` to grab the permalink. So something like:
 *     ```
       <?php
       $my_posts_page_id = get_option('page_for_posts ');
       $my_posts_page_url = get_permalink( $my_posts_page_id );
       ?>
       ```
   
 * should work.
 *  Thread Starter [royromviel](https://wordpress.org/support/users/royromviel/)
 * (@royromviel)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/get-permalink-post-page/#post-2889065)
 * Thank you very much! That was exact what I was looking for.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘get permalink post page’ is closed to new replies.

 * 2 replies
 * 2 participants
 * Last reply from: [royromviel](https://wordpress.org/support/users/royromviel/)
 * Last activity: [13 years, 8 months ago](https://wordpress.org/support/topic/get-permalink-post-page/#post-2889065)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
