for posts and comments.
add_theme_support( 'automatic-feed-links' );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded
tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
// Add support for custom background
$liveblog_bg_defaults = array(
'default-color' => 'ffffff',
'default-image' => get_template_directory_uri() . '/assets/images/bg.png',
);
add_theme_support( 'custom-background', $liveblog_bg_defaults );
// Add support for custom header
add_theme_support( 'custom-header' );
// Remove Header Text Color Option from Customizer
define( 'NO_HEADER_TEXT', true );
// This theme supports the following post formats.
add_theme_support( 'post-formats', array( 'gallery', 'link', 'quote', 'audio', 'video', 'image', 'status' ) );
// Register WordPress Custom Menus
register_nav_menu( 'main-menu', __( 'Main Menu', 'liveblog' ) );
// Register Post Thumbnails
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 150, 150, true );
add_image_size( 'liveblog-featured', 713, 330, true );
add_image_size( 'liveblog-slider', 1170, 470, true );
add_image_size( 'liveblog-featured390', 390, 210, true );
add_image_size( 'liveblog-related', 240, 185, true );
add_image_size( 'liveblog-widgetthumb', 90, 90, true );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'search-form', 'comment-form', 'comment-list', 'gallery', 'caption'
) );
// Load Localization Files
$lang_dir = get_template_directory() . '/lang';
load_theme_textdomain('liveblog', $lang_dir);
/*
* This theme styles the visual editor to resemble the theme style,
* specifically font, colors, icons, and column width.
*/
add_editor_style( array( 'assets/css/editor-style.css' ) );
}
endif; // twentyfifteen_setup
add_action( 'after_setup_theme', 'liveblog_theme_setup' );
/*
* favicon icon
*/
if ( ! function_exists( 'has_site_icon' ) || ! has_site_icon() ) {
function liveblog_favicon(){
$liveblog_favicon = get_theme_mod( 'liveblog_favicon' );
if ( !empty( $liveblog_favicon ) ) { ?>
=$limit) {
array_pop($excerpt);
$excerpt = implode(" ",$excerpt).'...';
} else {
$excerpt = implode(" ",$excerpt);
}
$excerpt = preg_replace('`[[^]]*]`','',$excerpt);
return $excerpt;
}
// Remove […] string
function liveblog_excerpt_more( $more ) {
return '';
}
add_filter('excerpt_more', 'liveblog_excerpt_more');
/*-----------------------------------------------------------------------------------*/
/* Register Theme Widgets
/*-----------------------------------------------------------------------------------*/
function liveblog_widgets_init() {
register_sidebar(array(
'name' => __('Primary Sidebar', 'liveblog'),
'id' => 'sidebar-1',
'before_widget' => '