Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
function get_dynamic_sidebar( $name ) {
$contents = "";
ob_start();
dynamic_sidebar( $name );
$contents = ob_get_clean();
return $contents;
}
add_action( 'theme_footer', 'add_footer_navi' );
function add_footer_navi() {
$html = '';
if( is_active_sidebar( 'footer-1' ) ) {
$html .= '<div class="footer-nav-box each-box">';
$html .= get_dynamic_sidebar( 'footer-1' );
$html .= '</div>';
}
if( is_active_sidebar( 'footer-2' ) ) {
$html .= '<div class="footer-nav-box each-box">';
$html .= get_dynamic_sidebar( 'footer-2' );
$html .= '</div>';
}
echo $html;
}
@MikeiLL

This comment has been minimized.

Copy link

@MikeiLL MikeiLL commented Nov 26, 2016

Thanks for posting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment