__( 'Main Navigation', 'care' ), 'footer' => __( 'Footer Navigation', 'care' ), ) ); /* Shortcodes in menu */ add_filter('wp_nav_menu', 'do_shortcode'); /* Thumbnails */ add_theme_support( 'post-thumbnails' ); /* Feeds */ add_theme_support( 'automatic-feed-links' ); /* Custom WordPress login */ function custom_login_head() { $login_logo = get_option_tree('login_logo', ''); if($login_logo){ echo " "; } } add_action('login_head', 'custom_login_head'); function custom_login_url() { return site_url(); } add_filter( 'login_headerurl', 'custom_login_url', 10, 4 ); function custom_login_title() { return get_bloginfo('name'); } add_filter('login_headertitle', 'custom_login_title'); /* Exclude category from blog */ function excludeCat($query) { if ( $query->is_home ) { $excludeCat = get_option_tree('exclude_categories_from_blog', ''); if($excludeCat){ $query->set('cat', $excludeCat); } } return $query; } add_filter('pre_get_posts', 'excludeCat'); /* Custom post count in search page */ function post_count($query) { if ($query->is_search) { $query->set('posts_per_page', '10'); } return $query; } add_filter('pre_get_posts', 'post_count'); /* Custom excerpts */ function excerpt($limit) { $excerpt = explode(' ', get_the_excerpt(), $limit); if (count($excerpt)>=$limit) { array_pop($excerpt); $excerpt = implode(" ",$excerpt).' ...'; } else { $excerpt = implode(" ",$excerpt); } $excerpt = preg_replace('`\[[^\]]*\]`','',$excerpt); return $excerpt; } /* Custom editor buttons */ function enable_more_buttons($buttons) { $buttons[] = 'hr'; $buttons[] = 'sub'; $buttons[] = 'sup'; $buttons[] = 'fontselect'; $buttons[] = 'fontsizeselect'; return $buttons; } add_filter("mce_buttons_3", "enable_more_buttons"); /* Validation for category tag */ add_filter( 'the_category', 'add_nofollow_cat' ); function add_nofollow_cat( $text ) { $text = str_replace('rel="category tag"', "", $text); return $text; } /* Languages */ function theme_language(){ load_theme_textdomain('care', get_template_directory() . '/languages'); } add_action('after_setup_theme', 'theme_language'); /* Add editor style */ add_editor_style('style.css'); ?>