Hi,
I want to add specific widget areas on custom category pages to override thematic_blogdescription().
Here is what I have done:
1. registerd new sidebars in childtheme library/widget-areas.php
function lul_home_tagline() {
register_sidebar(array(
'admin_menu_order' => 210,
'name' => 'lul-home-tagline',
'id' => 'lul-home-tagline',
'description' => __('some text', 'thematic'),
'before_widget' => thematic_before_widget(),
'after_widget' => thematic_after_widget(),
'before_title' => thematic_before_title(),
'after_title' => thematic_after_title(),
'priority' => 1,)
);
}
add_action('init', 'lul_home_tagline');
function lul_magazin_tagline() {
register_sidebar(array(
'admin_menu_order' => 220,
'name' => 'lul-magazin-tagline',
'id' => 'lul-magazin-tagline',
'description' => __('some text.', 'thematic'),
'before_widget' => thematic_before_widget(),
'after_widget' => thematic_after_widget(),
'before_title' => thematic_before_title(),
'after_title' => thematic_after_title(),
'priority' => 2,)
);
}
add_action('init', 'lul_magazin_tagline');
function lul_ekologija_tagline() {
register_sidebar(array(
'admin_menu_order' => 230,
'name' => 'lul-ekologija-tagline',
'id' => 'lul-ekologija-tagline',
'description' => __('Prostor u koji se unosi tekst, slike, kod za prostor pored logoa na stranama kategorije ekologija.', 'thematic'),
'before_widget' => thematic_before_widget(),
'after_widget' => thematic_after_widget(),
'before_title' => thematic_before_title(),
'after_title' => thematic_after_title(),
'priority' => 3,)
);
}
add_action('init', 'lul_ekologija_tagline');
2. Added childtheme_override_blogdescription() in my childetheme functions.php
function childtheme_override_blogdescription() {
if (is_category('ekologija')) {
echo "<div id=\"blog-description\">" . thematic_before_widget_area('lul-ekologija-tagline') . dynamic_sidebar('lul-ekologija-tagline') . thematic_after_widget_area('lul-ekologija-tagline') . "</div>";
}
elseif (is_category('magazin')) {
echo "<div id=\"blog-description\">". dynamic_sidebar('lul-magazin-tagline') . "</div>";
}
elseif (is_category('aktivart')) {
echo "<div id=\"blog-description\">" . thematic_before_widget_area('lul-aktivart-tagline') . dynamic_sidebar('lul-aktivart-tagline') . thematic_after_widget_area('lul-aktivart-tagline') . "</div>";
} else {
echo "<div id=\"blog-description\">" . thematic_before_widget_area('lul-home-tagline') . dynamic_sidebar('lul-home-tagline') . thematic_after_widget_area('lul-home-tagline') . "</div>";
}
}
add_action('thematic_header','childtheme_override_blogdescription',4);
3. For some reason widget area outputs widget twice, with weird mark-up like so:
<li id="text-2" class="widgetcontainer widget_text">
<div class="textwidget">text widget text</div>
// this was the first one
<div id="blog-description">
<div id="lul-home-tagline" class="aside">
<ul class="xoxo">
1
// this was the second one, and this is the markup I created in override function but it only pulls this weird '1'
</div><!-- #lul-home-tagline .aside -->
I was adding block of code by block of code in my override function to try to track when the duplication occurres and it happens when I call dynamic_sidebar('lul-ekologija-tagline')
.
I was poking around this all day, I don't have any plugins instaled, so if anyone has idea what coulde have gone wrong, I would apreciate it if you could help me out.
Many thanks in advance!
Sheky