How to Add Home Page Only Links in WordPress?

Spread the love

Before i faced the problem about inserting a link in the homepage of my WordPress blog, i was not aware that this kind of problem may happen. Some days back one of my client wanted me to put a couple of home page only links. But i did not get his requirement at that time. I just put links in my main sidebar. But that link was site wide link. My client was not asking for a site wide link because there are some disadvantages of site wide links. So, i told him that i am not getting his requirement and then the provided me some guidance about how to put home page only link.

Home_Page_Only_Links

What is Home Page Only Link?

Home Page only links are those backlinks or links which stays only in the home page. You will not be able to see those links on the other webpages of your site. As you will be able to see those links in other page of your site then that is site wide link. There are some disadvantages of site wide links because Google does not like Site Wide links and treat those links as unnatural links.

You can also check my other tips about WordPress which are:

Add Adsense Below Post Title In WordPress 3.2 Twenty Eleven

*Add Google Adsense Below Blog Header In WordPress 3.2 Twenty Eleven

Earn Money With Disqus Comment System Plugin in WordPress

How to Add a Home Page Only Links in WordPress Blog?

This is not a difficult task to add a home page only link after you know how to do it. Using two ways you can add a home page only link in your wordpress blog. The procedures are below:

1. Using PHP codes:

Using PHP codes you will be able to add home page only links, actually not only links, if you want to show other contents, you will be able to show those only in homepage. The PHP script is below:

<?php if(is_home() && $post==$posts[0] && !is_paged()) { ?>
HOMEPAGE-ONLY LINK OR CONTENT HERE
<?php } ?>

You just need to replace “HOMEPAGE-ONLY LINK OR CONTENT HERE” with your link code or content code. Then you need to add this script in the “Theme Editor” file. You can put the script according to your choice where you want to show the link or content.

If you observe the procedure a bit hard then there is another very easy procedure for you below.

But please remember that the script will not work if you add it in a widget because Widget in WordPress does not support PHP script, it only supports HTML scripts.

2. Add Home Page Only Link in WordPress Blog Using Plugin:

a. At first you need to install the Exec-PHP plugin.

b. Now you need to enable and configure it in your WordPress blog.

c. Now you need to add the below PHP script to the widget and then you just save it and you are done! Please change “HOMEPAGE-ONLY LINK OR CONTENT HERE” with your link code or content code.

<?php if(is_home() && $post==$posts[0] && !is_paged()) { ?>
HOMEPAGE-ONLY LINK OR CONTENT HERE
<?php } ?>

Hope that now you will be able to do it by yourself without any problem. If you still face any problem then do not hesitate to contact me through email, Twitter or Facebook fan page or YouTube Channel.

Himadri Subrah Saha

Himadri is an ICT Professional who writes for his technology tips & tricks related blog TechnTechie. Though it is hard to balance time in between professional life and blogging, he still manages time to work for his own blog and writes almost regularly. The dashboard of this WordPress is the only place where he does not feel tired! Read my other blogs @ PetCare and Teleinfo

0 0 votes
Article Rating

Subscribe
Notify of
guest

2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
LEX
LEX
5 years ago

Not working here. Put the code in footer with my text and nothing appears

2
0
Would love your thoughts, please comment.x
()
x