Is there a template tag/function for getting the URL (or slug or name or ID) of the blog page when using a “static” front page

wordpress.stackexchange https://wordpress.stackexchange.com/questions/19578

  •  22-10-2019
  •  | 
  •  

Question

Done some reasonable searching for this and don't think it's been asked before.

I've got a site which I'm developing a custom template/theme for. The site will use a page as the front page (rather than the list of posts), but I want to create a link in the template to the page of blog posts.

There are some functions for finding various URL's like site_url() and admin_url(), and, of course, there's bloginfo(), but I can see anything that will get me the name/slug/URL/ID of the page used as the blog page.

I'm sure I've seen this somewhere before but can't track it down now that I need it.

Any ideas?

Thanks RW

Was it helpful?

Solution

<?php $blog_link = get_page_link( get_option( 'page_for_posts' ) ); ?>

OTHER TIPS

yes there is since 3.0.0

    <?php get_home_url(); ?> 
Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top