October 5, 2010 at 12:49 pm #1462
With the great help of “Extra Widget Areas for specific Pages”, I’ve made specific widget area for some page section.
My question : I have many sub-pages in these page section, is there any easy way to display the mother page specific widget area, without having to recreate one for each of these sub-pages, so that an “Extra Widget Areas for specific Pages” would be common for specific pages and its sub-pages (like the option “Display Widget areas for categories on posts of that category”).
Any hint ?October 6, 2010 at 7:58 am #35313
This could be pretty involved. First you’ll want to look into the theme’s widget.php file and see how you specify a custom widget category. Then you’ll create a template file for each “category” and include those widgets. I’m not exactly an expert on how to work with custom widget groups, but perhaps another member of support could help you there.October 6, 2010 at 6:03 pm #35314
Ummm … after some extra thoughts and works, I’ve tried something and it works more or less :D
Well actually, it’s working but I’m not sure if it’s the best way to do it, and specially, I don’t know if it could work in all configuration.
Anyway, here it goes :
1. Created an extra widget area for the specific page
2. Changed the file frameworkhelper_functionslots_of_small_helpers.php (line 44) :Code:function check_custom_widget()
global $custom_widget_area, $k_option, $post;
//special widget area
$specialpage = explode(‘,’,$k_option[‘includes’][‘multi_widget_final’]);
$specialcat = explode(‘,’,$k_option[‘includes’][‘multi_widget_cat_final’]);
$custom_widget_area = get_the_title();
else if(is_page() && $post->post_parent)
$custom_widget_area = get_the_title($post->post_parent);
else if(is_category($specialcat) || ($k_option[‘includes’][‘single_post_multi_widget_cat’] != 2 && in_category($specialcat)))
$custom_widget_area = get_the_category();
$custom_widget_area = $custom_widget_area->cat_name;
as you see, it’s not perfect because it’s just testing if it’s a sub-page wether the parent page as a specific widget area or not, but it seems to work coz’ if the “$custom_widget_area” doesn’t fit a “real value”, it displays the default widget zone
So I’d like to have the author’s opinion if he has a few moment ^^ … or another support member :)
The topic ‘Page and sub-page widget area’ is closed to new replies.