__('Menu Primary','kciaotime'),
'top-menu' => __('Menu Top','kciaotime')
) );
// Custom backgrounds support
$defaults_bg = array(
'default-color' => 'F4F4F4',
'default-image' => get_template_directory_uri() . '/images/background.png',
'wp-head-callback' => 'kciaotime_custom_background_cb',
'admin_head_callback' => '',
'admin_preview_callback' => ''
);
add_theme_support ( 'custom-background', apply_filters( kciaotime_custom_background_args, $defaults_bg ) );
// Custom header support
$defaults_hd = array(
'default-text-color' => '7E7E7E',
'default-image' => '',
'upload' => true,
'wp-head-callback' => 'kciaotime_header_style',
'admin_head_callback' => 'kciaotime_admin_header_style',
'admin_preview_callback' => 'kciaotime_admin_header_img'
);
add_theme_support ( 'custom-header', apply_filters( kciaotime_custom_header_args, $defaults_hd ) );
}
endif;
add_action( 'after_setup_theme', 'kciaotime_setup' );
/*----------------------------------------------------------------------------------------*/
/* Function custom background callback
/*----------------------------------------------------------------------------------------*/
function kciaotime_custom_background_cb() {
// Get the background image.
$image_bg = get_background_image();
// If there's an image, just call the normal WordPress callback. We won't do anything here.
if ( !empty( $image_bg ) ) {
_custom_background_cb();
return;
// Get the background color.
$color_bg = get_background_color();
// If no background color, return.
if ( empty( $color_bg ) )
return;
// Use 'background' instead of 'background-color'.
$style_bg = "background: {color};";
?>
Header admin panel.
*
* @see kciaotime_custom_header_setup().
*/
function kciaotime_admin_header_style() {
?>
Header admin panel.
*
* @see kciaotime_custom_header_setup().
*/
function kciaotime_admin_header_image() {
$style = sprintf( ' style="color:#%s;"', get_header_textcolor() );
?>
urlencode( 'Fauna One:300,400,700,900,300italic,400italic,700italic' ),
'subset' => urlencode( 'latin,latin-ext' ),
);
$font_url = add_query_arg( $query_args, '//fonts.googleapis.com/css' );
}
return $font_url;
}
function kciaotime_enqueue_scripts()
{
wp_enqueue_script('kciaotime_dropdown', get_template_directory_uri() . '/lib/js/dropdown.js', array('jquery'));
wp_enqueue_script('kciaotime_touchdown', get_template_directory_uri() . '/lib/js/touchdown.js', array('jquery'));
wp_enqueue_script('kciaotime_script_js', get_template_directory_uri() . '/lib/js/script.js', array('jquery'), '2015', true);
wp_enqueue_script('kciaotime_flexslider', get_template_directory_uri() . '/lib/js/jquery.flexslider.js', array('jquery'));
wp_enqueue_script('kciaotime_scriptsmin', get_template_directory_uri() . '/lib/js/scripts.min.js', array('jquery'));
wp_enqueue_script('kciaotime_hoverIntent', get_template_directory_uri() . '/lib/js/hoverIntent.js');
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action('wp_enqueue_scripts', 'kciaotime_enqueue_scripts');
function kciaotime_enqueue_css() {
wp_enqueue_style('fontawesome', get_template_directory_uri() . '/lib/css/font-awesome.css');
wp_enqueue_style('top_menu', get_template_directory_uri() . '/top-menu.css');
wp_enqueue_style('fauna-one', kciaotime_font_url(), array(), null);
wp_enqueue_style('ie_css', get_template_directory_uri() . '/lib/css/ie.css');
wp_enqueue_style('default_css', get_template_directory_uri() . '/lib/css/defaults.css');
wp_enqueue_style('default_stylesheet', get_stylesheet_directory_uri() . '/style.css');
}
add_action('wp_print_styles', 'kciaotime_enqueue_css');
/*-----------------------------------------------------------------------------------*/
/* Display tag
/*-----------------------------------------------------------------------------------*/
if( version_compare( $GLOBALS['wp_version'], '4.1', '<' ) ) :
// filter function for wp_title
function kciaotime_filter_wp_title( $old_title, $sep, $sep_location ){
// add padding to the sep
$ssep = ' ' . $sep . ' ';
// find the type of index page this is
if( is_category() ) $insert = $ssep . __('Category','kciaotime');
elseif( is_tag() ) $insert = $ssep . __('Tag','kciaotime');
elseif( is_author() ) $insert = $ssep . __('Author','kciaotime');
elseif( is_year() || is_month() || is_day() ) $insert = $ssep . __('Archives','kciaotime');
elseif( is_home() ) $insert = $ssep . get_bloginfo('description');
else $insert = NULL;
// get the page number we're on (index)
if( get_query_var( 'paged' ) )
$num = $ssep . __('Page ','kciaotime') . get_query_var( 'paged' );
// get the page number we're on (multipage post)
elseif( get_query_var( 'page' ) )
$num = $ssep . __('Page ','kciaotime') . get_query_var( 'page' );
// else
else $num = NULL;
// concoct and return new title
return get_bloginfo( 'name' ) . $insert . $old_title . $num;
}
add_filter( 'wp_title', 'kciaotime_filter_wp_title', 10, 3 );
function kciaotime_rss_title($title) {
/* need to fix our add a | blog name to wp_title */
$ft = str_replace(' | ','',$title);
return str_replace(get_bloginfo('name'),'',$ft);
}
add_filter('get_wp_title_rss', 'kciaotime_rss_title',10,1);
// Adding Title for site older than WordPress 4.1
function kciaotime_render_title() {
?>
Continue reading »';
}
add_filter('excerpt_length', 'kciaotime_excerptlength_themes');
add_filter('excerpt_more', 'kciaotime_excerptmore');
/*-----------------------------------------------------------------------------------*/
/* Append post content pagination right after post content
/*-----------------------------------------------------------------------------------*/
function kciaotime_post_pagination($content) {
if ( is_single() ) {
$content .= wp_link_pages( array( 'before' => '' . __( 'Pages:', 'kciaotime' ), 'after' => '
', 'echo' => 1 ) );
}
return $content;
}
add_filter('the_content','kciaotime_post_pagination', 10);
add_filter('use_default_gallery_style', '__return_false' ); // Remove inline style of WordPress Gallery Shortcode
/*-----------------------------------------------------------------------------------*/
/* Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
/*-----------------------------------------------------------------------------------*/
function kciaotime_page_menu_args( $args ) {
$args['show_home'] = true;
return $args;
}
add_filter( 'wp_page_menu_args', 'kciaotime_page_menu_args' );
/*-----------------------------------------------------------------------------------*/
/* Register widgetized area and update sidebar with default widgets
/*-----------------------------------------------------------------------------------*/
function kciaotime_widgets_init() {
register_sidebar( array(
'name' => __('Main Sidebar', 'kciaotime'),
'id' => 'main-sidebar',
'before_widget' => '',
'before_title' => '',
));
register_sidebar( array(
'name' => __('Top Widget', 'kciaotime'),
'id' => 'top-widget',
'before_widget' => '',
'before_title' => '',
));
register_sidebar( array(
'name' => __('Footer Left', 'kciaotime'),
'id' => 'footer-left',
'before_widget' => '',
'before_title' => '',
));
register_sidebar( array(
'name' => __('Footer Middle', 'kciaotime'),
'id' => 'footer-middle',
'before_widget' => '',
'before_title' => '',
));
register_sidebar( array(
'name' => __('Footer Right', 'kciaotime'),
'id' => 'footer-right',
'before_widget' => '',
'before_title' => '',
));
}
add_action('widgets_init', 'kciaotime_widgets_init');
// Include functions
include(get_template_directory() . "/admin/widgets/social-widget.php");
include(get_template_directory() . "/admin/widgets/contact-info.php");
include(get_template_directory() . "/admin/widgets/ultimate-post.php");
/*-----------------------------------------------------------------------------------*/
/* Comments
/*-----------------------------------------------------------------------------------*/
if ( ! function_exists( 'kciaotime_comment' ) ) :
function kciaotime_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
?>
class="depth-1" id="">