Last active
December 23, 2015 12:59
-
-
Save scottnix/6639057 to your computer and use it in GitHub Desktop.
Thematic Widget above header.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// reference http://thematictheme.com/forums/topic/add-custom-widget-area-to-top-of-website/ | |
// add a widget to the top of the site | |
function childtheme_add_thematic_aboveheader_widget($content) { | |
$content['Top of site widget'] = array( | |
'admin_menu_order' => 232, | |
'args' => array ( | |
'name' => 'Top Of Site Widget (Twitter)', | |
'id' => 'tweets', | |
'description' => __('The widget area above the subs/footer.', 'thematic'), | |
'before_widget' => thematic_before_widget(), | |
'after_widget' => thematic_after_widget(), | |
'before_title' => thematic_before_title(), | |
'after_title' => thematic_after_title(), | |
), | |
'action_hook' => 'thematic_aboveheader', | |
'function' => 'childtheme_above_footer_aside_widget4', | |
'priority' => 1 | |
); | |
return $content; | |
} | |
add_filter('thematic_widgetized_areas', 'childtheme_add_thematic_aboveheader_widget'); | |
// set structure for the aside widget above the footer | |
function childtheme_above_footer_aside_widget4() { | |
if ( is_active_sidebar('tweets') ) { | |
echo "\n".'<div id="tweets">' . "\n" . "\t" . '<ul>' . "\n"; | |
dynamic_sidebar('tweets'); | |
echo "\n" . "\t" . '</ul>' ."\n" . '</div>' . "\n"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment