add_theme_support( 'title-tag' );
// custom editor style support
add_editor_style( 'editor-style.css' );
// This theme uses Featured Images (also known as post thumbnails)
add_theme_support('post-thumbnails');
set_post_thumbnail_size( 150, 150 );
// Add default posts and comments RSS feed links to head
add_theme_support('automatic-feed-links');
// language support - add your translation
load_theme_textdomain('betilu', get_template_directory() . '/languages');
// This theme uses wp_nav_menu in one location.
register_nav_menus(array(
'primary' => __('Primary Navigation - below header', 'betilu'),
'secondary' => __('Secondary Top Navigation - NO DROPDOWNS', 'betilu')
));
}
add_action('after_setup_theme', 'betilu_setup');
function betilu_add_theme_scripts() {
// Loads default main stylesheet.
wp_enqueue_style( 'style', get_stylesheet_uri() );
/**
* Adds JavaScript to pages with the comment form to support
* sites with threaded comments (when in use).
*/
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
wp_enqueue_script( 'comment-reply' );
}
add_action( 'wp_enqueue_scripts', 'betilu_add_theme_scripts' );
// add ie conditional html5 shim to header
function betilu_add_ie_html5_shim () {
echo "\n";
}
add_action('wp_head', 'betilu_add_ie_html5_shim');
/**
* customer background color and image support
*/
add_theme_support( 'custom-background' );
$args = array(
'default-color' => 'FAFAFB',
'default-image' => get_template_directory_uri() . '/images/default-background.jpg',
);
add_theme_support( 'custom-background', $args );
/**
* customer header image banner support
*/
add_theme_support( 'custom-header' );
$defaults = array(
'default-image' => get_template_directory_uri() . '/images/default-header.png',
'random-default' => false,
'width' => 176,
'height' => 176,
'flex-height' => true,
'flex-width' => true,
'repeat' => 'no-repeat',
'default-text-color' => 'FFFFFF',
'header-text' => false,
'uploads' => true,
'wp-head-callback' => '',
'admin-head-callback' => '',
'admin-preview-callback' => '',
);
add_theme_support( 'custom-header', $defaults );
/**
* reformat the more link for excerpts
*/
function betilu_excerpt_more($more) {
global $post;
return
'' . __( '
View Full Article...', 'betilu' ) . '';
}
add_filter('excerpt_more', 'betilu_excerpt_more');
// numeric pagination
function betilu_numeric_posts_nav() {
if( is_singular() )
return;
global $wp_query;
/** Stop execution if there's only 1 page */
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 );
/** 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 '