Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Talk:Conditional Tags

We need at least two more examples on this - anyone jumping in?

One very simple, like the home and single comparison, and then another one - your pick. Lorelle 15:09, 25 Mar 2005 (UTC)


The is_home example in 3.1 Variable Sidebar Content works ONLY on index.php, but not if home.php is used as "homepage" Moshu 21:43, 5 Jun 2005 (UTC)

What version of WordPress? It works for me in 1.5.1.2. --MDAWaffe - Talk 23:49, 5 Jun 2005 (UTC)

We can specify the archive week using the 'w' parameter but there isn't a is_week() function. I use this instead: if ($wp_query->query_vars['w']){

Zapola 11:21, 1 Sep 2005 (GMT)


The first example under multiple conditionals doesn't work. is_author() looks for an author archive page, so is_single() and is_author() are never going to be true at the same time.

Nfn8 16:15, 14 July 2013 (UTC)

I couldn't think of a better example, so I just removed that one.
Jdgrimes 22:21, 14 July 2013 (UTC)