__( 'Primary Menu', 'base' ),
) );
// Enable support for Post Formats.
add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) );
// Allows theme developers to link a custom stylesheet file to the TinyMCE visual editor.
function base_add_editor_styles() {
add_editor_style( 'custom-editor-style.css' );
}
add_action( 'init', 'base_add_editor_styles' );
// Setup the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'base_custom_background_args', array(
'default-color' => 'f9f9f9',
'default-image' => '',
) ) );
// Enable support for HTML5 markup.
add_theme_support( 'html5', array( 'comment-list', 'search-form', 'comment-form', ) );
}
endif; // base_setup
add_action( 'after_setup_theme', 'base_setup' );
/**
* Register widgetized area and update sidebar with default widgets.
*/
function base_widgets_init() {
register_sidebar( array(
'name' => __( 'Sidebar', 'base' ),
'id' => 'sidebar-1',
'before_widget' => '',
'before_title' => '
',
) );
// Area footer 1, located in the footer. Empty by default.
register_sidebar( array(
'name' => __( 'First Footer Widget Area', 'base' ),
'id' => 'first-footer-widget-area',
'description' => __( 'The first footer widget area', 'base' ),
'before_widget' => '',
'before_title' => '',
) );
// Area footer 2, located in the footer. Empty by default.
register_sidebar( array(
'name' => __( 'Second Footer Widget Area', 'base' ),
'id' => 'second-footer-widget-area',
'description' => __( 'The second footer widget area', 'base' ),
'before_widget' => '',
'before_title' => '',
) );
// Area footer 3, located in the footer. Empty by default.
register_sidebar( array(
'name' => __( 'Third Footer Widget Area', 'base' ),
'id' => 'third-footer-widget-area',
'description' => __( 'The third footer widget area', 'base' ),
'before_widget' => '',
'before_title' => '',
) );
// Area footer 4, located in the footer. Empty by default.
register_sidebar( array(
'name' => __( 'Fourth Footer Widget Area', 'base' ),
'id' => 'fourth-footer-widget-area',
'description' => __( 'The fourth footer widget area', 'base' ),
'before_widget' => '',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'base_widgets_init' );
/**
* Enqueue scripts and styles.
*/
function base_scripts() {
wp_enqueue_style( 'base-style', get_stylesheet_uri() );
wp_enqueue_style( 'skeleton', get_template_directory_uri().'/css/skeleton.css' );
wp_enqueue_style( 'layout', get_template_directory_uri().'/css/layout.css' );
wp_enqueue_script( 'base-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true );
wp_enqueue_script( 'base-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );
wp_enqueue_style( 'google-arvo', 'http://fonts.googleapis.com/css?family=Arvo:400,400italic' );
wp_enqueue_style( 'google-opensams', 'http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,700,300' );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'base_scripts' );
function base_wp_head(){
?>
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";
}
/*
* Breadcrumb
*/
function BaseBreadcrumb() {
echo '';
if (!is_home()) {
echo '
';
echo 'Home';
echo " » ";
if (is_category() || is_single()) {
the_category(' » ');
if (is_single()) {
echo " » ";
the_title();
}
} elseif (is_page()) {
echo the_title();
}
}
echo '
';
}
/*
* Add favicon.
*/
function base_favicon() { ?>
'. __('Read more →' ,'base') . ' ';
}
add_filter('excerpt_more', 'new_excerpt_more');
/*
* Woocommerce support.
*/
remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
add_action('woocommerce_before_main_content', 'base_wrapper_start', 10);
add_action('woocommerce_after_main_content', 'base_wrapper_end', 10);
function base_wrapper_start() {
echo '';
}
function base_wrapper_end() {
echo ' ';
}
add_theme_support( 'woocommerce' );