Hi guys, I want to add some links to my blog http://www.FinanceAdvisoryStop.com I would like to add them to the sidebars. Although, I would like them to ONLY appear on the homepage, and no other pages. How can I do this? Thanks in advance!
Hereyou go. Add below given code in sidebar where you want link (only on homepage). <?php if(is_home() && $post==$posts[0] && !is_paged()) { ?> [B]Your Link Here[/B] <?php } ?> Code (markup): DON.
Thanks guys, but I'm still having a little trouble. That does not seem to work. Is there some sort of widget available to do this?
<?php if(is_home() && $post==$posts[0] && !is_paged()) { ?> <a href="Your_link_here">Anchor-Text</a> <?php } ?> Code (markup):
<?php include(TEMPLATEPATH."/config.inc.php");?> <div id="l_sidebar"> [B]<?php if(is_home() && $post==$posts[0] && !is_paged()) { ?> <a href="Your_link_here">Anchor-Text</a> <?php } ?>[/B] <ul> <!--sidebar.php--> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(1) ) : ?> <!--list of categories, order by name, without children categories, no number of articles per category--> <li> <h3>Categories</h3> <ul> <?php $params = "orderby=name&title_li&exclude=" . $np_feature_cat . "," . $np_sidenotes_cat . "," . $np_pop_cat; ?> <?php wp_list_categories($params); ?> </ul> </li> <li> <h3>Archives</h3> <ul> <?php wp_get_archives('type=monthly&limit=12'); ?> </ul> </li> <!--Ad Unit--> <li> <img src="<?php bloginfo('template_url'); ?>/images/ad.png"></img> </li> <?php endif; ?> </ul> </div> Code (markup): I think this should work.