Support » Plugins and Hacks » Can't get the widget to work on select pages only

Can't get the widget to work on select pages only

  • Trying to use the widget logic to have something appear only on two of my pages. I’m using:

    is_page_template ( array (‘ laundry.php ‘, ‘ blog.php ‘ ) )

    and nothing is appearing. If I give it just is_page and numbers, then I get syntax errors.
    Not a programmer, so if you could help, I’d be grateful.


Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author alanft


    It doesn’t looks like is_page_template can take a list in an array I’m afraid


    you’ll have to do

    is_page_template(X) || is_page_template(Y)

    Me too! I used Widget Logic on my previous sites but it doesn’t work on the new one. There’s something I don’t understand. Previously, I did not have to change the coding in my wordpress files. In my Dashboard under the widget text box I just had to put the page number in the Widget Logic box and the widget would appear only on that page! Isn’t that how it’s supposed to work for the simple job of displaying the widget on a particular page? Why now all this coding necessary? (which I don’t know how to do yet)

    Plugin Author alanft


    no that’s not how it works – maybe there’s another plugin you are thinking of.

    Alan – not sure I understand your response above. Isn’t the purpose of the widget logic to allow me to only have certain widgets appear on certain pages?

    Or is your response from 2 days ago correct?

    Plugin Author alanft


    sorry, that was a reply just to dianabryon. the response 2 days ago still applies to your issue – have you tried that out yet?

    Hi Alanft, ah. So how do I do the simple thing of telling a particular widget to appear only on one particular static page, page #2?

    Same problem here please solve anyone

    Ok, so far I have been able to get this format to work:

    is_page(‘Laundry Soap’)

    this is placed in the widget logic box. I used it with two separate buttons on two separate pages and all seems to be working just fine.

    Now, on to the third button that I want to appear on all pages except the two above.

    I’ll try to post the solution for that if I get it working!

    Whoo, hoo — I figured it out.

    So, to get it to show on a single page, I entered this code in the widget logic box:

    is_page(‘Laundry Soap’) (fill in your page name)

    To get my button to appear on specific, multiple pages, I entered this code in the widget box:


    the site is: http://www.greenleafinspirations.com — you will see product specific pay pal buttons on my product pages versus a different (all inclusive) pay pal button on home, about us and blog pages.

    Hope this helps others with the same question!

    Great that you shared with us; I’ll do that for my site too.

    May I suggest something for your site from a marketing perspective? On your Laundry Soap page, the BUY section is way down the bottom. How about putting the BUY section at the very top of your widget, so the call-to-action is instantly visible to busy customers?
    Then SUBSCRIBE underneath that.
    Once they’ve gotten to your laundry soap, my feeling is they would no longer be prioritizing archives and blog posts, which just distract them away from buying your product.

    Thanks for the suggestion, Dianabyron! I see what you mean and took you up on it.

    Alan — once I did that, now the general buy button is showing on those pages. Any idea why? How to correct? The only thing I did was change the order of the widgets.

    I need to get that corrected quickly.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Can't get the widget to work on select pages only’ is closed to new replies.