Widget Logic Conditional Tags

Widget Logic Conditional Tags/

The skies the limit when it comes to using Widget Logic Conditional Tags!  Just maybe you’ve added a few new widgets to thy wordpress space recently?  Of course the content concerned is down to you at any given time and is most likely going to change over time.  What doesn’t?

Once you’ve added your content into any given widget, whether that be text, image, video, rss link or whatever.  Use the widget logic conditional tags to decide for thyself where you’d like the content to appear on your site?

textwidgetJust maybe you fancy one widget to appear on two or three pages of your web site instead of being on every single page?

Then again you may only want your content of choice to appear on the home page only?

Maybe just on a links page or about us page?

So many random choices depending on thy mood and how much coffee you’ve consumed at any given moment.

For the now we continue our personal journey of discovery with a desire for self learning and A Positive Can Do Attitude here on Black Eyed Admin.

Hopefully discovering more than a few new pitfalls of whatever along the way by jumping in with both feet, making those 101 mistakes and just maybe keeping a note or two of what went pete tong once in a while via www.blackeyedadmin.co.uk then again, maybe not!

Memo to Self:  Don’t stress, it’s just a blog post!

So what are the Widget Logic conditional tags for then?

According to those in the know the blurb goes something like this:

“All of the Conditional Tags test to see whether a certain condition is met, and then returns either TRUE or FALSE. The conditions under which various tags output TRUE is listed below. Those tags which can accept parameters are so noted.”

The Main Page: is_home()

The Front Page: is_front_page()

The Blog Page: is_front_page() and is home()

There is no conditional tag for the blog page. You have to use both is_home() and is_front_page() to detect this page, but those functions can be misused. In fact, a user can define a static page for the homepage, and another page to display the blog. This one will return true with is_home() function, even if it’s not the homepage. Here is what a user can define :

  • a default homepage (with the latest posts)
  • a static homepage and no blog page
  • a static homepage and a blog page

 

widgetlinkWhatever thy content may be in any particular widget is ultimately down to thee.

By using widget logic conditional tags, you can decide where your content appears on your site!

Whether your content is text, image, video, archive list or whatever it doesn’t matter, by using the widget logic conditional tags you have a tad more control over what goes where and that my friend, in my humble opinion, can’t ever be a bad thing for sure.

Do yourself  favour if your using widget logic conditional tags!

Check out the  codex page for yourself on the link below and have a go at figuring out whatever suits you best and where?

codex.wordpress.org/Conditional_Tags

Just in case?  Here’s the link to download the Widget Logic Plugin

Keep doin’ what you do, we’re learning something new everyday. Nice One for thy time.

~ Inabit ~