WordPress.org

Ready to get started?Download WordPress

Forums

Widget Logic
Same widget on multiple sidebars (5 posts)

  1. skylacking
    Member
    Posted 1 year ago #

    I have multiple Sidebars. is there anyway to use widget logic, to show the same widget on different sidebars?

    I have 100 sidebars, that are linked to specific categories. They will have different widgets for their own custom menus, however I want them to also share the same widget, like, advertising, social plugin etc.

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

  2. alanft
    Member
    Plugin Author

    Posted 1 year ago #

    I don't think so, no. Could you just have one sidebar that's persistent and appears above/below the others?

  3. skylacking
    Member
    Posted 1 year ago #

    Hey thanks for the reponse. Issue was, I was going to have a lot of widgets, and categories, was looking for a way to organize it in back end as well, since my current sidebars are assigned to categories, and sub categories, and I don't think there is a condition to set if "is_subcategory" for widget logic.... unless there is?

    I am going to have to use: So that my widget will be visible on page 10219, or if viewing category page books, any subcategory of books. Also, if viewing a post in books category or subcategory.

    is_page(10219) || is_category(array('books','books-2013')) || (is_single( ) && in_category(array('books','books-2013')))

    'books-2013' is the subcategory of 'books'

    is there a way to not use arrays, so that I won't have to keep editing array, when I add new categories.

    I didn't have any luck with the "post_is_in_descedant" I kept getting an error, saying call to undefined function.

  4. alanft
    Member
    Plugin Author

    Posted 1 year ago #

    You can use get_term_children to get an array of categories, so you could do something like in_category(get_term_children(5, 'category')). I've not tried it, but that sounds convincing.

  5. skylacking
    Member
    Posted 1 year ago #

    cool, will give it a shot

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.