• Resolved royromviel

    (@royromviel)


    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)
  • 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

    (@royromviel)

    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.