WordPress.org

Support

Support » Plugins and Hacks » Display Widgets » [Plugin: Display Widgets] Logic missing to handle pages with categories

[Plugin: Display Widgets] Logic missing to handle pages with categories

  • Perhaps there is a better way of doing this, but I am using the “Map Categories to Pages” plugin to assign categories to various static pages. I’m then trying to use the “Display Widgets” plugin to decide which widgets show up with which pages. Unfortunately, the logic seems to be missing in the “Display Widgets” plugin to handle the check for whether static pages have a category.

    In function show_dw_widget($instance), just before the check for:

    }else if (is_404()){

    I’ve added the following code locally:

    }else if (is_page()){
    	$show = false;
            $cats = get_the_category();
            foreach($cats as $cat){
                if ($show) continue;
                $cat_id = dw_get_lang_id($cat->cat_ID, 'category');
                if (isset($instance['cat-'. $cat_id]))
                    $show = $instance['cat-'. $cat_id];
            }

    This seems to work great. It would be super if we could get this (or something like it) into the main trunk.

    http://wordpress.org/extend/plugins/display-widgets/

Viewing 1 replies (of 1 total)
  • Hi there,

    I find this plugin extremely useful, but unless I’m missing something, it only works for posts, not pages. I put this request in 7 months ago and there have been 2 releases since. Is there a reason to not put in this support for pages?

    Thanks very much.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Display Widgets] Logic missing to handle pages with categories’ is closed to new replies.
Skip to toolbar