Posted By

PM-Webdesign on 10/08/10


Tagged

wordpress sidebar widget


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

baczoni


Sidebar Widgets in Wordpress hinzufüegn


 / Published in: PHP
 

URL: http://www.wpbeginner.com/wp-tutorials/25-extremely-useful-tricks-for-the-wordpress-functions-file/

  1. <!-- Code in functions.php einfuegen -->
  2. <!-- Fuegt zwei Sidebars hinzu -->
  3.  
  4. if ( function_exists('register_sidebar') )
  5. register_sidebar(array('name'=>'MiddleSidebar',
  6. 'before_widget' => '<li class="widget">',
  7. 'after_widget' => '</li>',
  8. 'before_title' => '<h2 class="widgettitle">',
  9. 'after_title' => '</h3>',
  10. ));
  11. register_sidebar(array('name'=>'FooterSidebar',
  12. 'before_widget' => '<li class="widget">',
  13. 'after_widget' => '</li>',
  14. 'before_title' => '<h2 class="widgettitle">',
  15. 'after_title' => '</h3>',
  16. ));
  17.  
  18.  
  19. <!-- Code in Template Datei einfuegen -->
  20.  
  21. <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('MiddleSidebar') ) : ?>
  22. <!–Default sidebar info goes here–>
  23.  
  24. <?php endif; ?>

Report this snippet  

You need to login to post a comment.