/ Published in: PHP
How to use a widgetized header and footer together, Headway Themes.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
add_action('init','register_custom_sidebars', 0); function register_custom_sidebars() { // Header Sidebar if(function_exists('register_sidebar')) register_sidebar(array( 'name' => 'Header Widget', 'before_widget' => '<li class="widget %2$s" id="%1$s">', 'after_widget' => '</li>', 'before_title' => '<span class="widget-title">', 'after_title' => '</span>', 'id' => 'header-1', )); // Footer Sidebar if(function_exists('register_sidebar')) register_sidebar(array( 'name' => 'Footer Widgets', 'before_widget' => '<div class="footer-item">', 'after_widget' => '</div>', 'before_title' => '<h2>', 'after_title' => '</h2>', 'id' => 'footer-1', )); } function change_copyright(){ return '<p class="copyright">Powered by WordPress and <a href="http://headwaythemes.com/">Headway</a> - Copyright �© '.date('Y').' '.get_bloginfo('name').' | <a href="'.get_bloginfo('url').'/contact-us/">Contact Us</a> | <a href="'.get_bloginfo('url').'/privacy-policy/">Privacy Policy</a> | <a href="'.get_bloginfo('url').'/terms-and-conditions/">Terms & Conditions</a> | <a href="'.get_bloginfo('url').'/sitemap/">Sitemap</a> </p>'; } add_filter('headway_copyright', 'change_copyright'); /*Define Header Widget*/ function header_widget() { ?> <div id="header_widget" class="sidebar"> <ul class="sidebar"> <li class="widget"><h3><?php _e('Header Widget', 'headway'); ?></h3>No widgets yet!</li><?php } ?> </ul> </div> <?php } add_action('headway_before_header_link', 'header_widget', '1');
URL: http://codex.headwaythemes.com/index.php?title=How_to_Use_a_Widgetized_Header_and_Footer_Together