Wondering How to Add a Link to Home Page Only in Wordpress Blogs? Great coz, in this article we will discuss the easiest way to Add a Link to Home Page Only.
Overview:
Most of the bloggers use Blogroll feature of Wordpress to add a link to their site. While this is pretty simple, the links so generated appear on every single post of the blog. For a small blog this may not a worrying factor but as a blog gets bigger the number of outbound links may become a barrier in achieving higher search engine rankings. To avoid this scenario, it is always recommended to add links to homepage only.
How to Add Links to Homepage Only
Though it would require a bit of coding, we will try to make it as simple as possible. In this step by step tutorial, we are assuming that you are adding links in Sidebar (Generally sidebar.php file).
1. Open the sidebar.php file (if add links offline) or navigate to sidebar.php file Appearance> Editor > sidebar.php in WP 2.7 + and Design > Theme Editor > sidebar.php in WP 2.3 +
2 . Add the following code to sidebar at your desired place.
<?php if(is_home()){ ?>
<h2> Title of Links e.g. Homepage Blogroll </h2>
<ul>
<li><a href="http://www.example1.com"Anchor text1</a></li>
<li><a href="http://www.example2.com "Anchor text2</a><li>
<li><a href="http://www.example3.com "Anchor text3</a></li>
</ul>
<?php } ?>
This is an example where we have added three links to our sidebar. To add the number of links, just add the code <li><a href=" http://www.example.com "> Anchor text </a></li> in between the <ul> and </ul> tags as many times as you want.
To add a title to your links, you can change the text between <h2> and </h2> tags. You can use anything like Homepage Blogroll.
Hope that adding a link to Homepage only won’t be a problem now.



23. October 2009 at 6:29 am
As the title suggests, an introduction to statistics for novices. ,
Reply