Sidebar Widgets in Wordpress hinzufüegn


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



Copy this code and paste it in your HTML
  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; ?>

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.