PRIMARY_WIDGET,
'id' => 'primary-widget-area',
'description' => PRIMARY_WIDGET,
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
) );
register_sidebar( array(
'name' => SECONDRY_WIDGET,
'id' => 'secondary-widget-area',
'description' => SECONDRY_WIDGET,
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
) );
register_sidebar( array(
'name' => FIRST_FOOTER_WIDGET,
'id' => 'first-footer-widget-area',
'description' => FIRST_FOOTER_WIDGET,
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
) );
register_sidebar( array(
'name' => SECONDRY_FOOTER_WIDGET,
'id' => 'second-footer-widget-area',
'description' => SECONDRY_FOOTER_WIDGET,
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
) );
register_sidebar( array(
'name' => THIRD_FOOTER_WIDGET,
'id' => 'third-footer-widget-area',
'description' => THIRD_FOOTER_WIDGET,
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
) );
register_sidebar( array(
'name' => FOURTH_FOOTER_WIDGET,
'id' => 'fourth-footer-widget-area',
'description' => FOURTH_FOOTER_WIDGET,
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
) );
}
/** Register sidebars by running BeCrux_widgets_init() on the widgets_init hook. */
add_action( 'widgets_init', 'BeCrux_widgets_init' );
/* ----------------------------------------------------------------------------------- */
/* Menu Registration */
/* ----------------------------------------------------------------------------------- */
add_action( 'after_setup_theme', 'BeCrux_register_my_menu' );
function BeCrux_register_my_menu() {
register_nav_menus( array(
'header_menu' => HOME_MENU,
'frontpage-menu' => FRONT_MENU,
'footer-menu' => FOOTER_MENU
)
);
}
/* ----------------------------------------------------------------------------------- */
/* Page Navigation */
/* ----------------------------------------------------------------------------------- */
if ( !function_exists( 'BeCrux_content_nav' ) ) :
function BeCrux_content_nav( $html_id ) {
global $wp_query;
$html_id = esc_attr( $html_id );
if ( $wp_query->max_num_pages > 1 ) :
?>
'.the_title().'';
echo '';
}
/* ----------------------------------------------------------------------------------- */
/* Pagination for single post */
/* ----------------------------------------------------------------------------------- */
function BeCrux_numeric_posts_nav() {
if ( is_singular() )
return;
global $wp_query;
if ( $wp_query->max_num_pages <= 1 )
return;
$paged = get_query_var( 'paged' ) ? absint( get_query_var( 'paged' ) ) : 1;
$max = intval( $wp_query->max_num_pages );
if ( $paged >= 1 )
$links[] = $paged;
if ( $paged >= 3 ) {
$links[] = $paged - 1;
$links[] = $paged - 2;
}
if ( ( $paged + 2 ) <= $max ) {
$links[] = $paged + 2;
$links[] = $paged + 1;
}
echo '' . "\n";
}
/* --------------------------------------------------------------------- */
/* ****Responsive Menu***/
/* --------------------------------------------------------------------- */
function BeCrux_add_menuclass( $ulclass ) {
return preg_replace( '//', '', $ulclass, 1 );
}
add_filter( 'wp_page_menu', 'BeCrux_add_menuclass' );
add_action( 'init', 'register_custom_menu' );
function register_custom_menu() {
register_nav_menu( 'custom_menu', __( 'Main Menu', 'BeCrux' ) );
}
function BeCrux_nav() {
if ( function_exists( 'wp_nav_menu' ) )
wp_nav_menu( array( 'theme_location' => 'custom_menu', 'container' => 'nav', 'container_class' => 'menu','container_id' => 'navigation', 'menu_class' => 'menu', 'fallback_cb' => 'BeCrux_nav_fallback' ) );
else
BeCrux_nav_fallback();
}
function BeCrux_nav_fallback() {
?>
";
} else {
}
}
}
function BeCrux_new_nav_menu_items( $items ) {
if ( is_home() ) {
$homelink = BeCrux_get_current_menu() . '- ' . __( 'Home', 'BeCrux' ) . '
';
} else {
$homelink = BeCrux_get_current_menu() . '- ' . __( 'Home', 'BeCrux' ) . '
';
}
$items = $homelink . $items;
return $items;
}
add_filter( 'wp_list_pages', 'BeCrux_new_nav_menu_items' );
/* ----------------------------------------------------------------------------------- */
/* Required functions */
/* ----------------------------------------------------------------------------------- */
if ( !isset( $content_width ) )
$content_width = 1024;
function BeCrux_custom_my_theme_setup() {
add_editor_style( 'custom-editor-style.css' );
add_theme_support( 'automatic-feed-links' );
add_theme_support( "custom-background" );
add_theme_support( "custom-header" );
add_theme_support( 'html5', array( 'gallery', 'caption') );
add_theme_support( "post-thumbnails" );
add_theme_support( "title-tag" );
}
add_action( 'after_setup_theme', 'BeCrux_custom_my_theme_setup' );
?>