Dodanie widgetów do kodu strony
W kodzie zamieszczamy:
- functions.php
if ( function_exists('register_sidebar') ) { register_sidebar(array( 'name'=>'Widget Name1', 'before_widget' => '<li>', 'after_widget' => '</li>', 'before_title' => '<h2>', 'after_title' => '</h2>', )); register_sidebar(array( 'name'=>'Widget Name2', 'before_widget' => '<li>', 'after_widget' => '</li>', 'before_title' => '<h2>', 'after_title' => '</h2>', )); }
- w kodzie strony
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Widget Name1') ) : ?><?php endif; ?> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Widget Name2') ) : ?><?php endif; ?>
Hope this helps and happy coding :)