Created
December 15, 2016 15:20
-
-
Save ingozoell/32017b4f6efa3a06f637a720bdbc6b51 to your computer and use it in GitHub Desktop.
WordPress Widget
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function shop_widgets() { | |
register_sidebar( array( | |
'name' => 'Shop – Footer 1', | |
'id' => 'shop-footer-1', | |
'before_widget' => '<div id="%1$s" class="cb-footer-widget %2$s">', | |
'after_widget' => '</div>', | |
'before_title' => '<h3 class="cb-footer-widget-title"><span>', | |
'after_title' => '</span></h3>' | |
) ); | |
register_sidebar( array( | |
'name' => 'Shop – Footer 2', | |
'id' => 'shop-footer-2', | |
'before_widget' => '<div id="%1$s" class="cb-footer-widget %2$s">', | |
'after_widget' => '</div>', | |
'before_title' => '<h3 class="cb-footer-widget-title"><span>', | |
'after_title' => '</span></h3>' | |
) ); | |
register_sidebar( array( | |
'name' => 'Shop – Footer 3', | |
'id' => 'shop-footer-3', | |
'before_widget' => '<div id="%1$s" class="cb-footer-widget %2$s">', | |
'after_widget' => '</div>', | |
'before_title' => '<h3 class="cb-footer-widget-title"><span>', | |
'after_title' => '</span></h3>' | |
) ); | |
register_sidebar( array( | |
'name' => 'Shop – Footer 4', | |
'id' => 'shop-footer-4', | |
'before_widget' => '<div id="%1$s" class="cb-footer-widget %2$s">', | |
'after_widget' => '</div>', | |
'before_title' => '<h3 class="cb-footer-widget-title"><span>', | |
'after_title' => '</span></h3>' | |
) ); | |
} | |
add_action( 'widgets_init', 'shop_widgets' ); | |
/* TEMPLATE */ | |
<?php if ( is_active_sidebar( 'shop-footer-1' ) ) : ?> | |
<div class="cb-one cb-column clearfix"> | |
<?php dynamic_sidebar('shop-footer-1'); ?> | |
</div> | |
<?php endif; ?> | |
<?php if ( is_active_sidebar( 'shop-footer-4' ) ) : ?> | |
<div class="zahlungsmethoden cb-one cb-column clearfix"> | |
<?php dynamic_sidebar('shop-footer-4'); ?> | |
</div> | |
<?php endif; ?> | |
<?php if ( is_active_sidebar( 'shop-footer-2' ) ) : ?> | |
<div class="cb-one cb-column clearfix"> | |
<?php dynamic_sidebar('shop-footer-2'); ?> | |
</div> | |
<?php endif; ?> | |
<?php if ( is_active_sidebar( 'shop-footer-3' ) ) : ?> | |
<div class="cb-one cb-column clearfix"> | |
<?php dynamic_sidebar('shop-footer-3'); ?> | |
</div> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment