Viewing 2 replies - 1 through 2 (of 2 total)
  • if I use is_category(array(5,9,10,11) it does not work, nothing appears on sidebar

    unless your code here in teh forum is a typing eror, the correct syntax would need another closing bracket:

    is_category(array(5,9,10,11))

    this also only targets category archive pages, not single posts with those categories.

    https://codex.www.ads-software.com/Conditional_Tags

    Is it possible to use several codes e.g. is_category(array(5,9,10,11) and is_page(array(3,112,17,55) for one widget?

    an AND operation would never result in true; if you mean to use OR, try:

    ( is_category( array(5,9,10,11) ) || is_page( array(3,112,17,55) ) )

    Thread Starter Madddin

    (@madddin)

    O.k. I understand my mistake. It will only show widget on category view, not the included posts. So I have to use in_category(array(5,9,10,11))

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘is_category() does not work’ is closed to new replies.