Websites for sale:
Used Cars for Sale - $175 and Car Sale.
If interested drop me a line at ken@kensfi.com. Thanks!

Have questions about Toronto? Check my latest project: Ask about Toronto!

How to add a link only to a specific page in WordPress

You can either add a link in index / home page or any other individual WordPress blog page using a short code, you have to place directly in the page template like in the example bellow.

In this example, I have been adding a link only to the first page / index page of the website. In my case, the home page is using a template which is used as well by another pages pointed out from next and previous button. It was useless to add the link, as it is, as a HTML chunk, into the template code because that link will appear (due the fact that other pages are using the same template) on other pages of my website, too.

[sourcecode language='php']< ?php if ( $paged < 2 ) { ?>Check my latest work, Top Best Web Hosting< ?php } ?>[/sourcecode]

paged < 2 means the first page which is using this template – my case, the home page
e.g. if you want to add a link on the second page which is using index template,too, you will use:

$paged = 2

In the same manner you can make the entire page looks different, not only adding a single link but adding different content, tags, divs, different colors and graphic elements, etc

Practically is not anymore a matter of template used. With this method you can manipulate entire pages in seconds.

If you enjoyed this post, make sure you subscribe to my RSS feed!

Related tech articles

Php

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Please read before commenting:

I don't tolerate spam comments. Be human and polite. If you are signing as "Computer repairing", "iPhone store" or other kind of bullshits you'll be marked as spam.
USE YOUR NAME! Thanks!

Comments

One Response to “How to add a link only to a specific page in WordPress”

Leave Comment

(required)

(required)