Ask your WordPress questions! Pay money and get answers fast! (more info)

How to get the permalink of is_home()?


Hi There,

I'm building a custom function for breadcrumbs and I need to retrieve the permalink value for the is_home() function.

I went to 'Settings > Reading' and set a 'static front page' and chose my 'posts page'.

is_home() is working as expected, returning the page name for my 'posts page' which was manually set up above.

I just need to know how to retrieve the url or permalink of the is_home() function?

btw: bloginfo(url) and bloginfo(siteurl) are both returning the URL of the static homepage. Can't seem to figure out how to return the value of the posts page?

I greatly appreciate your help.


Answers (5)


Pippin Williamson answers:

Use the home_url() function:

[[LINK href=""]][[/LINK]]

WP Answers comments:

home_url() is returning the URL of the static homepage (ie:

looking to retrieve my 'posts page' url which is:

Pippin Williamson comments:

Here you go:

[[LINK href=""]][[/LINK]]

WP Answers comments:

Awesome. Just figured it out. Thank you brother!


Andrzej answers:

can you tell me how your hard-coded post page permalink looks like? you can hide domain name i.e. ?

WP Answers comments:

Sure thing.


juan manuel incaurgarat answers:

try <?php echo home_url(); ?>
that would return the url for home :)


Ali Hussain answers:

You could use a simple php code
<a href="<?php ($_SERVER['REQUEST_URI']=='/') ;?>">your home page link</a>

<?php ($_SERVER['REQUEST_URI']=='/') ;?>


Ryan Riatno answers:

I'm not sure about your code, but I think get_permalink($id) maybe solve your problem