Forums

[Plugin: Widget Logic] Can I use more than one array? (8 posts)

  1. seaofghosts
    Member
    Posted 3 months ago #

    I need different links to show up in different pages. I am using the text widget to make a list of links, and widget-logic to specify which pages should display which set of links.

    Ok I have edited this post because I have figured out a bit more about my error.

    For some reason my second set of links won't load if I use the code
    is-page(array('one-option','another-option'))

    but it does work if I use
    is-page('one-option')

    I have already used two arrays that work, and one array in the text widget. Why is the second array not working?

  2. alanft
    Member
    Posted 3 months ago #

    could it be simply that you need is_page not is-page? (underscore, not dash/hyphen)

  3. seaofghosts
    Member
    Posted 3 months ago #

    Ugh sorry, I must have mistyped it in this thread, it is definitely an underscore in my widget and it's not working properly when I array it.

    is_page('ordering-paying') works!
    is_page('ordering-paying','shipping-returns','contact-us')) does not work!

  4. rsciw
    Member
    Posted 3 months ago #

    /edit:
    nevermind, misread intro post wrong
    move along, move along.

  5. alanft
    Member
    Posted 3 months ago #

    can you check your typing. it should be

    is_page(array('ordering-paying','shipping-returns','contact-us'))

  6. seaofghosts
    Member
    Posted 3 months ago #

    Oh my god, I'm so so sorry - I keep putting the wrong thing here in the thread. I've got such a headache over all this coding!

    Yes what you have typed is what is on my page. You can check it out here:

    http://www.drinkmealice.com.au/blog/
    http://www.drinkmealice.com.au/blog/shop/ -works
    http://www.drinkmealice.com.au/blog/about/ -works
    http://www.drinkmealice.com.au/blog/ordering-paying/ -not working

    the actual code in the customer care text widget is:
    is_page(array('ordering-paying','shipping-returns','jewellery-care','our-guarantee','faqs'))

    and the actual code in the about us text widget is:
    is_page(array('about','press','stockists','wholesale','contact-us'))

    they look identical except for the page names, but only the about us text widget works.

  7. seaofghosts
    Member
    Posted 3 months ago #

    Ok because I am kind of in a rush I've actually changed plugins. Thanks anyway, I appreciate you taking the time to try and help even though I clearly didn't make it very easy for you!!

  8. alanft
    Member
    Posted 3 months ago #

    ah well. btw, the ordering-paying URL is coming up as a 404!

Reply

You must log in to post.

About this Topic