WordPress.org

Ready to get started?Download WordPress

Forums

Widget Logic
is_category() does not work (3 posts)

  1. Madddin
    Member
    Posted 11 months ago #

    Hi, I like your plugin very much. But one thing does not work. If I use e.g. is_single(array(3,112,17,55) it works. But if I use is_category(array(5,9,10,11) it does not work, nothing appears on sidebar. Why?

    I have another question. Is it possible to use several codes e.g. is_category(array(5,9,10,11) <u>and</u> is_page(array(3,112,17,55) for one widget? How is the correct syntax?

    Using Version Widget Logic 0.55 and WordPress 3.52
    Link: http://www.anbieter-vergleichen.de/blog.html

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

  2. alchymyth
    The Sweeper & Moderator
    Posted 11 months ago #

    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.

    http://codex.wordpress.org/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) ) )

  3. Madddin
    Member
    Posted 11 months ago #

    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!

Reply

You must log in to post.

About this Plugin

About this Topic