Using WordPress conditional tags

by

in

I recently wrote a new post on WPexplorer about WordPress conditional tags. Actually i wrote quiet often on WPexplorer, but most part of the time i’m teaching how to create a small plugin. But this time i wanted to present a very useful system that are conditional tags.WordPress uses a very powerful hierarchy templates system loading specific page templates depending on the requested URL. With conditional tags you can add action or content depending on various parameters: if the visitor is on a specific page, if the user has a specific role, if a user is connected, if a code is loaded within the loop etc… And i love that. As AJ Clarke says:

Conditional tags are crucial in any theme…I don’t think there is a single WordPress product where I haven’t used them. One of the first things any person learning WordPress should know.

And that’s true, anyone working WordPress has to know conditional tags. I wasn’t able to list them all in my post, because there are so many, but i listed the most popular and the most used. But that’s not all, some plugins like BBpress for example have applied the same conditional tags system. You can also find this method applied in Easy Digital Downloads by Pippin Williamson.

If all developers were using core conditional tags and custom conditional tags we would certainly live in a better world! ;-)

Read the post on WPeplorer

Leave a Reply