|
<?php
|
|
function kpress_setup() {
|
|
load_theme_textdomain('kpress', get_template_directory() . '/languages');
|
|
add_theme_support('automatic-feed-links');
|
|
add_theme_support('custom-header', array('width' => 960, 'height' => 120, 'header-text' => false,));
|
|
add_theme_support('custom-background', array('default-color' => '999999',));
|
|
register_nav_menu('main-nav', 'Main Navigation');
|
|
register_nav_menu('sub-nav', 'Sub Navigation');
|
|
}
|
|
add_action('after_setup_theme', 'kpress_setup');
|
|
|
|
wp_enqueue_style('kpress-style', get_stylesheet_uri());
|
|
|
|
function kpress_widgets_init() {
|
|
register_sidebar( array(
|
|
'name' => __('Main Sidebar','kpress'),
|
|
'id' => 'sidebar-1',
|
|
'description' => __('Shown everywhere on the right side', 'kpress' ),
|
|
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
|
|
'after_widget' => '</aside>',
|
|
'before_title' => '<h4 class="widget-title">',
|
|
'after_title' => '</h4>',
|
|
));
|
|
}
|
|
add_action( 'widgets_init', 'kpress_widgets_init' );
|
|
|
|
function kpress_search_form($form) {
|
|
$search = get_search_query() ? get_search_query() : "Search website";
|
|
$form = '<form method="get" class="searchform" action="' . home_url( '/' ) . '">
|
|
<input type="text" class="searchtext" placeholder="' . $search . '" name="s" >
|
|
<input type="submit" class="searchsubmit" value="Search">
|
|
</form>';
|
|
|
|
return $form;
|
|
}
|
|
add_filter('get_search_form', 'kpress_search_form');
|
|
|
|
function kpress_title($title, $sep) {
|
|
|
|
if(is_feed())
|
|
return $title;
|
|
|
|
$title = get_bloginfo('name') . $title;
|
|
|
|
$site_description = get_bloginfo('description', 'display');
|
|
if ($site_description && (is_home() || is_front_page()))
|
|
$title = "$title $sep $site_description";
|
|
|
|
return $title;
|
|
}
|
|
add_filter('wp_title', 'kpress_title', 10, 2);
|
|
?>
|