Forums

quick widget logic help (2 posts)

  1. tyler_durdin
    Member
    Posted 8 months ago #

    I'm trying to do both categories and pages with one widget and I can't seem to get it to work.

    I'm trying

    is_category('18') && is_page(array(314,316,310,312,235,301,299,243,240,238,308,305))

    but I cannot get it to work

  2. alchymyth
    The Sweeper
    Posted 8 months ago #

    && stands for AND - being a category archive or a static page is mutually exclusive - therefore your condition will never be true;

    try to use || which stands for OR

    is_category('18') || is_page(array(314,316,310,312,235,301,299,243,240,238,308,305))

    this means:
    'if it is category archive of cat 18 OR any of the pages in the list'

Reply

You must log in to post.

About this Topic