| | #1 |
| I.C.Hope War Room Member Join Date: 2009
Posts: 2,777
Thanks: 457
Thanked 275 Times in 208 Posts
|
Ok Im using this Code: <?php if(is_home()) : ?>
<h1><a href="<?php echo get_option('home'); ?>"><?php bloginfo('name'); ?></a></h1>
<?php else : ?>
<span id="blogTitle">
<a href="<?php echo get_option('home'); ?>"><?php bloginfo('name'); ?></a>
</span>
<?php endif; ?> My homepage is a static wordpress page, so I need the blog title to be at least included on that page. It includes my blog title but doesnt put it in the code on that page or any other page. it's good that it's removed everything from my other pages as now I have a nice clean <H1> But for the homepage I want it to at least include this, any ideas.. What I do to that code to make it right? Oh the homepage is set via General settings in wordpress back office, so that it is the statci page I've selcted it to be. It is called home but i guess the if statement is wrong because it isn't picking it up. Cheers |
| | |
| |
| | #2 |
| Active Warrior War Room Member Join Date: 2009
Posts: 37
Thanks: 11
Thanked 5 Times in 5 Posts
|
Try this out instead: <?php if(is_home()) { ?> <h1><a href="<?php echo get_option('home'); ?>"><?php bloginfo('name'); ?></a></h1> <?php } else { ?> <span id="blogTitle"> <a href="<?php echo get_option('home'); ?>"><?php bloginfo('name'); ?></a> </span> <?php } ?> the open and close braces are key. wrap them around the entire contents of your if and else clauses. |
| |
| | #3 |
| Active Warrior War Room Member Join Date: 2009 Location: Maidens, VA
Posts: 42
Thanks: 21
Thanked 12 Times in 9 Posts
|
I'm not quite sure exactly what you mean in your description, but as for the code, have you tried replacing is_home() with is_front_page()? Is_front_page will handle a home page that is either a page or a post listing (default wordpress).
|
| |
| The Following User Says Thank You to esoomllub For This Useful Post: |
| | #4 |
| Active Warrior War Room Member Join Date: 2009 Location: Maidens, VA
Posts: 42
Thanks: 21
Thanked 12 Times in 9 Posts
|
I can't post links here yet (until I get to 15 posts), but if you search at google for "wordpress developer documentation" the first result will be their documentation. I sometimes find it less than easy to use. I often find that a google search for "wordpress" and then the function I am looking to find out about usually will put me at the right place within their documentation quicker. |
| |
| The Following User Says Thank You to esoomllub For This Useful Post: |
|
| Bookmarks |
| Tags |
| php, statement |
| |