Skip to content

Instantly share code, notes, and snippets.

@marushu
Last active November 26, 2016 00:43
Show Gist options
  • Save marushu/e5628f26f62f507fefa6 to your computer and use it in GitHub Desktop.
Save marushu/e5628f26f62f507fefa6 to your computer and use it in GitHub Desktop.
<?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
Copy link

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