Category: Blog

If like many other people you use the excellent Widget Logic to control what URLs your sidebar content displays on, this may come in handy for you.

How do I know this?

Well, I just spent a solid 2 hours looking for it myself!

If you want content to appear on the homepage only the code to enter into the Widget Logic field is:

is_home()

Everyone knows that though, right?

Well, if you display your latest posts on the homepage and only want a particular widget to display on the front page not paginated versions e.g.

http://www.yourdomain.com/page/2

Then the code you need is this:

is_home() && $post==$posts[0] && !is_paged()

Hope that helps someone out! :)

Ping me a comment if you make good use of it. Always cool to know.