Headway Themes Widgetized Header and Footer Together


/ Published in: PHP
Save to your folder(s)

How to use a widgetized header and footer together, Headway Themes.


Copy this code and paste it in your HTML
  1. add_action('init','register_custom_sidebars', 0);
  2. function register_custom_sidebars() {
  3. // Header Sidebar
  4. if(function_exists('register_sidebar'))
  5. register_sidebar(array(
  6. 'name' => 'Header Widget',
  7. 'before_widget' => '<li class="widget %2$s" id="%1$s">',
  8. 'after_widget' => '</li>',
  9. 'before_title' => '<span class="widget-title">',
  10. 'after_title' => '</span>',
  11. 'id' => 'header-1',
  12. ));
  13. // Footer Sidebar
  14. if(function_exists('register_sidebar'))
  15. register_sidebar(array(
  16. 'name' => 'Footer Widgets',
  17. 'before_widget' => '<div class="footer-item">',
  18. 'after_widget' => '</div>',
  19. 'before_title' => '<h2>',
  20. 'after_title' => '</h2>',
  21. 'id' => 'footer-1',
  22. ));
  23. }
  24.  
  25. function change_copyright(){
  26. 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>';
  27. }
  28. add_filter('headway_copyright', 'change_copyright');
  29. /*Define Header Widget*/
  30. function header_widget() { ?>
  31. <div id="header_widget" class="sidebar">
  32. <ul class="sidebar">
  33. <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Header Widget') ){ ?>
  34. <li class="widget"><h3><?php _e('Header Widget', 'headway'); ?></h3>No widgets yet!</li><?php } ?>
  35. </ul>
  36. </div>
  37. <?php }
  38. 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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.