Title: Widget Logic on 2.8
Last modified: August 19, 2016

---

# Widget Logic on 2.8

 *  Resolved [alanft](https://wordpress.org/support/users/alanft/)
 * (@alanft)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/widget-logic-on-28/)
 * Just to announce that the current release of WL doesn’t work fully on 2.8. When
   you hit ‘Save’ in a widget the AJAX way, the widget comes back without the WL
   field. refresh the page and it’s there again (and the changes have saved??) –
   but it’s still teh suck.
 * so I have updated the code to make it work with this new bit of 2.8, and it’s
   available as v 0.46 in the ‘development version’ on the [versions page](http://wordpress.org/extend/plugins/widget-logic/download/).
 * If I don’t hear anything adverse about it (say if it breaks anything important
   in 2.7, or there’s something else new in 2.8 that i’ve missed) in the next couple
   of days, I will tag it up as an official update.

Viewing 15 replies - 1 through 15 (of 19 total)

1 [2](https://wordpress.org/support/topic/widget-logic-on-28/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/widget-logic-on-28/page/2/?output_format=md)

 *  [doctoraa](https://wordpress.org/support/users/doctoraa/)
 * (@doctoraa)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/widget-logic-on-28/#post-1106380)
 * I’ve discovered that the logic can only handle simple cases such as Is_home();
   anything more complex doesn’t work for me. I’m trying to have a widget appear
   only on the home page and two other pages, but it is completely unresponsive 
   to the “or” || operator. I haven’t tried the “and” && operator. It’s also not
   clear what number to give to a widget when some of the widgets aren’t supposed
   to appear on every page. Can they be clashing with each other? I’m not sure if
   these problems are due to the upgrade to 2.8 since I never tried out compound
   logical statements before today.
 *  [Justin Tadlock](https://wordpress.org/support/users/greenshady/)
 * (@greenshady)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/widget-logic-on-28/#post-1106397)
 * Thanks for the update. I recommend this to pretty much all my theme users, and
   I’ll let them know an update will be ready soon.
 *  Thread Starter [alanft](https://wordpress.org/support/users/alanft/)
 * (@alanft)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/widget-logic-on-28/#post-1106403)
 * doctoraa. give me an example of a complex case that isn’t working. Also “what
   number to give to a widget”. Where do you give numbers to a widget?
 * (if you mean the order in the sidebar in the non-javascript admin interface, 
   it’s the order of the widgets regardless of whether they appear.)
 * greenshady – it would be great if you could try out the ‘dev’ version and let
   me know what you think.
 * cheers all.
 *  [Justin Tadlock](https://wordpress.org/support/users/greenshady/)
 * (@greenshady)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/widget-logic-on-28/#post-1106405)
 * [@alanft](https://wordpress.org/support/users/alanft/)
 * Will do just as soon as I wake up tomorrow.
 *  [demetris (Demetris Kikizas)](https://wordpress.org/support/users/demetris/)
 * (@demetris)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/widget-logic-on-28/#post-1106421)
 * [@alanft](https://wordpress.org/support/users/alanft/): Thanks for the update.
   I’m currently testing it on 2.8 with one widget and a condition like this:
 * `is_singular() && in_category('foo') && in_category('bar')`
 * … and it seems to work fine.
 *  [doctoraa](https://wordpress.org/support/users/doctoraa/)
 * (@doctoraa)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/widget-logic-on-28/#post-1106426)
 * Here’s an example of a complex statement that I haven’t had any success with:
 * is_home() || is_page(‘Page One’) || is_page(‘Page Two’)
 * I also tried
 * (is_home() || is_page(‘Page One’) || is_page(‘Page Two’))
 * and
 * (is_home()) || (is_page(‘Page One’)) || (is_page(‘Page Two’))
 * In each case, the widget only appeared on the home page. Maybe I am misuing the
   syntax; clearly, it is not reacting to the || symbols.
 * With the numbering scheme, if I have three widgets in Sidebar 1 on the homepage,
   but I only want the first two plus a new one on Page One, would I rank the new
   widget as 3 or 4 in Sidebar 1? I tried both with no success.
 *  [doctoraa](https://wordpress.org/support/users/doctoraa/)
 * (@doctoraa)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/widget-logic-on-28/#post-1106427)
 * OK, I finally discovered where the problem was. There were two screwups on my
   part. I was using the name that appears on the tab of each page, which is a shortened
   version of the actual page name. Now I see that the actual page name must be 
   used. Also, I wasn’t paying close enough attention to the case of the page name.
   I used upper case for the page name, but upper and lower on the tabs. The case
   has to match the actual page name.
 * Thanks for your time, alanft!
 *  Thread Starter [alanft](https://wordpress.org/support/users/alanft/)
 * (@alanft)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/widget-logic-on-28/#post-1106432)
 * thanks everyone.
 * doctoraa, glad the logic sorted out for you in the end. wrt numbering scheme –
   i’m still not sure what that means – do you just mean the order of appearance
   in the sidebar in the admin interface?
 * if you want ABC on is_home() and ABD on is_page(X), then you just define widgets
   ABCD with C set to appear on is_home() and D set to appear on is_page(X) with
   A and B defined as normal with no logic (or more complicatedly: is_home() || 
   is_page(X))
 * a couple of bonus tips wrt [is_page](http://codex.wordpress.org/Conditional_Tags#A_PAGE_Page),
   you can use the page ID, slug or title, and you can even give it an array of 
   mixed IDs/slugs/titles to check against.
 *  [Justin Tadlock](https://wordpress.org/support/users/greenshady/)
 * (@greenshady)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/widget-logic-on-28/#post-1106439)
 * So far, everything seems fine to me. I’ve tried several different complex mixtures
   of tags and all has been well.
 *  Thread Starter [alanft](https://wordpress.org/support/users/alanft/)
 * (@alanft)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/widget-logic-on-28/#post-1106443)
 * cool. it’s good to know the logic is working as before.
 * what was worrying me was the behaviour of the WL fields in the new 2.8 widget
   admin interface. I spotted just the one problem (described above) and I’ve fixed
   that. If anyone spots any other issues, holler.
 * I’m going to try and test the new wp_query_reset code myself, and then I’ll make
   the release official tomorrow I guess.
 * Thanks again greenshady, and all here on the forums.
 *  Thread Starter [alanft](https://wordpress.org/support/users/alanft/)
 * (@alanft)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/widget-logic-on-28/#post-1106526)
 * in case you hadn’t noticed I did tag up 0.46 as a full release.
 * I’ve also added a donate URL for the first time – it’s a justgiving.com page 
   to raise money for Cancer Research UK. It would be wonderful if even just a fraction
   of the downloads WL gets would donate 5 UKP/USD.
 * Thanks to everyone again for all your feedback.
 *  [dwhitedesign](https://wordpress.org/support/users/dwhitedesign/)
 * (@dwhitedesign)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/widget-logic-on-28/#post-1106672)
 * Hi Alan,
 * I am having a problem that has appeared to others as well. I have a home page
   specified as Home (slug “home”) and a blog page set as a page titled Blog (slug“
   blog”).
 * Using the is_page(‘blog’) the widget does not appear on the blog page. I also
   took the approach of using:
 *  !is_page(home) || !is_page(about) … etc. for the other pages
 * to try and exclude the widget from pages other than the blog page but I must 
   be doing something wrong. it does not work either.
 * I have tried the page ID option too, but I am not sure I am actually using the
   page ID.
 * Do you have any ideas why this is not working?
 * —-
    WP 2.8.1 Theme K2
 *  Thread Starter [alanft](https://wordpress.org/support/users/alanft/)
 * (@alanft)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/widget-logic-on-28/#post-1106673)
 * read about is_home() and is_front_page() here
 * [http://codex.wordpress.org/Conditional_Tags#The_Main_Page](http://codex.wordpress.org/Conditional_Tags#The_Main_Page)
 *  [zerostreet](https://wordpress.org/support/users/zerostreet/)
 * (@zerostreet)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/widget-logic-on-28/#post-1106724)
 * I’ve got the same issue dwhitedesign speaks of. I can add any widget to the page
   I have designted “Blog” when not using WL, but when using it no widget appears.
   I have read about home vs front page but have not had any success with that.
 * Any help would be greatly appreciated!
 *  [Dave333](https://wordpress.org/support/users/dave333/)
 * (@dave333)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/widget-logic-on-28/#post-1106777)
 * Just a tip for anyone who is trying to use Widget Logic only on the home page:
 * I tried the is_home() to put a widget only on my home page but it never worked
   no matter how I tried it. The solution is to NOT use that conditional tag. Instead
   use this:
 * is_front_page()
 * That will work. WordPress seems to have a hard time determining which page is
   the Home page for some reason but it knows which page is the front page.

Viewing 15 replies - 1 through 15 (of 19 total)

1 [2](https://wordpress.org/support/topic/widget-logic-on-28/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/widget-logic-on-28/page/2/?output_format=md)

The topic ‘Widget Logic on 2.8’ is closed to new replies.

 * 19 replies
 * 8 participants
 * Last reply from: [alanft](https://wordpress.org/support/users/alanft/)
 * Last activity: [16 years, 2 months ago](https://wordpress.org/support/topic/widget-logic-on-28/page/2/#post-1106783)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
