Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get_home_url() just returns current URL

My problem is simple, I need a "home" link for my WP template, and the function get_home_url() is simply returning the current url. So if I'm on "example.com/?cat=2", that's the url I get for my home button .

Any ideas what I'm doing wrong? I'm pulling my hair out.

like image 744
Sophistifunk Avatar asked Apr 29 '12 14:04

Sophistifunk


2 Answers

It's just home_url(). So:

echo home_url();

Will output the homepage of your Wordpress installation.

like image 107
maiorano84 Avatar answered Sep 28 '22 11:09

maiorano84


Have you tried:

echo get_bloginfo('url')
like image 39
Tom Walters Avatar answered Sep 28 '22 12:09

Tom Walters