WordPress.org

Ready to get started?Download WordPress

Forums

Widget Logic
Can't get the widget to work on select pages only (12 posts)

  1. higginssm
    Member
    Posted 1 year ago #

    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.
    greenleafinspirations.com

    http://wordpress.org/extend/plugins/widget-logic/

  2. alanft
    Member
    Plugin Author

    Posted 1 year ago #

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

    http://codex.wordpress.org/Function_Reference/is_page_template

    you'll have to do

    is_page_template(X) || is_page_template(Y)

  3. dianabyron
    Member
    Posted 1 year ago #

    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)
    thanks

  4. alanft
    Member
    Plugin Author

    Posted 1 year ago #

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

  5. higginssm
    Member
    Posted 1 year ago #

    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?

  6. alanft
    Member
    Plugin Author

    Posted 1 year ago #

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

  7. dianabyron
    Member
    Posted 1 year ago #

    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?

  8. sachinwagar001
    Member
    Posted 1 year ago #

    Same problem here please solve anyone

  9. higginssm
    Member
    Posted 1 year ago #

    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!

  10. higginssm
    Member
    Posted 1 year ago #

    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:

    is_page(array(home,'about-us'))||is_post

    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!

  11. dianabyron
    Member
    Posted 1 year ago #

    THANKS HIGGINSSM!
    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.

  12. higginssm
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic