Help with a line on page.php

by 3 replies
4
Hi There,

I have recently had a Wordpress theme made that needs a slight improvement before it can be given away.

At the moment there is a problem line of code which needs to be changed for each site that it is installed on:

Code:
if($path== 'http://yourdomain.com/')
                            {
How do I change this so that it automatically finds the the site that it is on and if it is the home page?

Really appreciate your help

Pete
#programming #line #pagephp
  • Wordpress has a few of these

    is_home(), is_single(), is_page(), etc...

    so to see if you are on the home page you can do

    if(is_home())...
    Function Reference/is home « WordPress Codex
    • [ 1 ] Thanks
    • [1] reply
    • Thanks Unomateo,

      Unfortunately that doesn't work with this theme. Oh well, it isn't that much hassle to change the URL round.

      Thanks for your help though

      Pete
  • Banned
    [DELETED]
  • use get_bloginfo('url') ,this will outputs homepage url
    more info:
    Code:
    http://codex.wordpress.org/Function_Reference/get_bloginfo

Next Topics on Trending Feed