Conditionally Show Only On Home Page (Front Page)

Conditionally Show Only On Home Page (Front Page)

There a are two functions that are used quite a bit to conditionally show content on the very front page (home page or page 1 of your blog). First – we had the function is_home(), but in WordPress version 2.5 – a new function was introduced: is_front_page().

You might think both would conditionally only display content on the home page (front page, page 1 of your blog) – but you actually need to use the following code to accomplish showing something ONLY on the front page of your paged blog:


<p>Show this text only on the home page</p>

So – if you want to easily show something on what I would consider the front page – use the code above to successfully achieve that. (This is particularly helpful if you have ads that run speficically on the home page and others that are ROS (run of site).

Further reading:

3 thoughts on “Conditionally Show Only On Home Page (Front Page)”
  1. PaulC |

    Perfect, this is just what I was looking for on a theme I am currently working on worked a treat 😉

Leave a Reply

Your email address will not be published.
*
*

This site uses Akismet to reduce spam. Learn how your comment data is processed.