注册侧边栏
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了注册侧边栏相关的知识,希望对你有一定的参考价值。
//REGISTER SIDEBAR 'name' => 'Footer Area One', 'id' => 'sidebar-3', 'description' => 'An optional widget area for your site footer', 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => "</aside>", 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); 'name' => 'Footer Area Two', 'id' => 'sidebar-4', 'description' => 'An optional widget area for your site footer', 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => "</aside>", 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); 'name' => 'Footer Area Three', 'id' => 'sidebar-5', 'description' => 'An optional widget area for your site footer', 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => "</aside>", 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); //COUND THE NUMBER OF FOOTER SIDEBARS TO ENABLE DYNAMIC CLASSES FOR THE FOOTER function custom_footer_sidebar_class() { $count = 0; if ( is_active_sidebar( 'sidebar-3' ) ) $count++; if ( is_active_sidebar( 'sidebar-4' ) ) $count++; if ( is_active_sidebar( 'sidebar-5' ) ) $count++; $class = ''; switch ( $count ) { case '1': $class = 'one'; break; case '2': $class = 'two'; break; case '3': $class = 'three'; break; } if ( $class ) echo 'class="' . $class . '"'; }
以上是关于注册侧边栏的主要内容,如果未能解决你的问题,请参考以下文章