'My First Widget',
'id' => 'primary-widget-area',
'description' => 'My First Widget',
'before_widget' => '
',
'before_title' => '',
'after_title' => '
',
));
// Area 2, located below the Primary Widget Area in the sidebar. Empty by default.
register_sidebar(array(
'name' => 'My Second Widget',
'id' => 'secondary-widget-area',
'description' => 'My second widget',
'before_widget' => '',
'before_title' => '',
'after_title' => '
',
));
// Area 3, located in the footer. Empty by default.
register_sidebar(array(
'name' => BFRONT_FIRST_FOOTER_WIDGET,
'id' => 'first-footer-widget-area',
'description' => BFRONT_THE_FIRST_FOOTER_WIDGET,
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '
',
));
// Area 4, located in the footer. Empty by default.
register_sidebar(array(
'name' => BFRONT_SECONDRY_FOOTER_WIDGET,
'id' => 'second-footer-widget-area',
'description' => BFRONT_THE_SECONDRY_FOOTER_WIDGET,
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '
',
));
// Area 5, located in the footer. Empty by default.
register_sidebar(array(
'name' => BFRONT_THIRD_FOOTER_WIDGET,
'id' => 'third-footer-widget-area',
'description' => BFRONT_THE_THIRD_FOOTER_WIDGET,
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '
',
));
// Area 6, located in the footer. Empty by default.
register_sidebar(array(
'name' => BFRONT_FOURTH_FOOTER_WIDGET,
'id' => 'fourth-footer-widget-area',
'description' => BFRONT_THE_FOURTH_FOOTER_WIDGET,
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '
',
));
}
/** Register sidebars by running bfront_widgets_init() on the widgets_init hook. */
add_action('widgets_init', 'bfront_widgets_init');
//Menu for desktop view
function bfront_nav() {
if (function_exists('wp_nav_menu')){
wp_nav_menu(array('theme_location' => 'custom_menu', 'menu_class' => 'sf-menu snip1155', 'menu_id' => 'menu', 'fallback_cb' => 'bfront_nav_fallback'));
}else{
bfront_nav_fallback();
}
}
function bfront_nav_fallback() {
?>
'custom_menu', 'menu_class' => '', 'menu_id' => '', 'fallback_cb' => 'bfront_mobile_nav_fallback'));
}else{
bfront_nav_fallback();
}
}
function bfront_mobile_nav_fallback() {
?>
max_num_pages <= 1 )
return;
$paged = get_query_var( 'paged' ) ? absint( get_query_var( 'paged' ) ) : 1;
$max = intval( $wp_query->max_num_pages );
/** Add current page to the array */
if ( $paged >= 1 )
$links[] = $paged;
/** Add the pages around the current page to the array */
if ( $paged >= 3 ) {
$links[] = $paged - 1;
$links[] = $paged - 2;
}
if ( ( $paged + 2 ) <= $max ) {
$links[] = $paged + 2;
$links[] = $paged + 1;
}
echo '' . "\n";
/** Previous Post Link */
if ( get_previous_posts_link() )
printf( '- %s
' . "\n", get_previous_posts_link() );
/** Link to first page, plus ellipses if necessary */
if ( ! in_array( 1, $links ) ) {
$class = 1 == $paged ? ' class="active"' : '';
printf( '- %s
' . "\n", $class, esc_url( get_pagenum_link( 1 ) ), '1' );
if ( ! in_array( 2, $links ) )
echo '- ←
';
}
/** Link to current page, plus 2 pages in either direction if necessary */
sort( $links );
foreach ( (array) $links as $link ) {
$class = $paged == $link ? ' class="active"' : '';
printf( '- %s
' . "\n", $class, esc_url( get_pagenum_link( $link ) ), $link );
}
/** Link to last page, plus ellipses if necessary */
if ( ! in_array( $max, $links ) ) {
if ( ! in_array( $max - 1, $links ) )
echo '- →
' . "\n";
$class = $paged == $max ? ' class="active"' : '';
printf( '- %s
' . "\n", $class, esc_url( get_pagenum_link( $max ) ), $max );
}
/** Next Post Link */
if ( get_next_posts_link() )
printf( '- %s
' . "\n", get_next_posts_link() );
echo '
' . "\n";
}
if ( ! isset( $content_width ) ) $content_width = 900;
if ( is_singular() ) wp_enqueue_script( "comment-reply" );
function custom_css(){
$custom_css = esc_attr( get_theme_mod('custom_css') );
echo '';
}
add_action('wp_head', 'custom_css');