tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support( 'title-tag' ); /* * Enable support for Post Thumbnails on posts and pages. * * See: https://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails */ add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 825, 510, true ); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'primary' => __( 'Primary Menu', 'quidus' ), ) ); /* * 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' ) ); /* * Enable support for Post Formats. * * See: https://codex.wordpress.org/Post_Formats */ add_theme_support( 'post-formats', array( 'image', 'video', 'quote', 'link', 'gallery', 'audio' ) ); // Setup the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'quidus_custom_background_args', array( 'default-attachment' => 'fixed' ) ) ); } endif; // quidus_setup add_action( 'after_setup_theme', 'quidus_setup' ); global $excerpt_length_quidus; if ( get_theme_mod('quidus_excerpt_length') == '' ) : $excerpt_length_quidus = 55; else : $excerpt_length_quidus = esc_attr(get_theme_mod('quidus_excerpt_length')); endif; function quidus_custom_excerpt_length( $length ) { global $excerpt_length_quidus; return $excerpt_length_quidus; } add_filter( 'excerpt_length', 'quidus_custom_excerpt_length', 999 ); /** * Register widget area. * * * @link https://codex.wordpress.org/Function_Reference/register_sidebar */ function quidus_widgets_init() { register_sidebar( array( 'name' => __( 'Sidebar', 'quidus' ), 'id' => 'sidebar-1', 'description' => __( 'Add widgets here to appear in your sidebar.', 'quidus' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); if ( get_theme_mod('quidus_enable_footer_widgets') == 1) { if ( get_theme_mod('quidus_footer_widgets_count') == 'twocolumn') { register_sidebar( array( 'name' => __( 'Footer Widget One', 'quidus' ), 'id' => 'footer-widget-1', 'description' => __( 'Add widgets here to appear in your footer.', 'quidus' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Widget Two', 'quidus' ), 'id' => 'footer-widget-2', 'description' => __( 'Add widgets here to appear in your footer.', 'quidus' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } if ( get_theme_mod('quidus_footer_widgets_count') == 'threecolumn') { register_sidebar( array( 'name' => __( 'Footer Widget One', 'quidus' ), 'id' => 'footer-widget-1', 'description' => __( 'Add widgets here to appear in your footer.', 'quidus' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Widget Two', 'quidus' ), 'id' => 'footer-widget-2', 'description' => __( 'Add widgets here to appear in your footer.', 'quidus' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Widget Three', 'quidus' ), 'id' => 'footer-widget-3', 'description' => __( 'Add widgets here to appear in your footer.', 'quidus' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } } } add_action( 'widgets_init', 'quidus_widgets_init' ); if ( ! function_exists( 'quidus_fonts_url' ) ) : /** * Register Google fonts. * * * @return string Google fonts URL for the theme. */ function quidus_fonts_url() { $fonts_url = ''; $fonts = array(); $subsets = 'latin,latin-ext'; /* translators: If there are characters in your language that are not supported by Noto Sans, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Noto Sans font: on or off', 'quidus' ) ) { $fonts[] = 'Noto Sans:400italic,700italic,400,700'; } /* translators: If there are characters in your language that are not supported by Noto Serif, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Noto Serif font: on or off', 'quidus' ) ) { $fonts[] = 'Noto Serif:400italic,700italic,400,700'; } /* translators: If there are characters in your language that are not supported by Inconsolata, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Inconsolata font: on or off', 'quidus' ) ) { $fonts[] = 'Inconsolata:400,700'; } /* translators: To add an additional character subset specific to your language, translate this to 'greek', 'cyrillic', 'devanagari' or 'vietnamese'. Do not translate into your own language. */ $subset = _x( 'no-subset', 'Add new subset (greek, cyrillic, devanagari, vietnamese)', 'quidus' ); if ( 'cyrillic' == $subset ) { $subsets .= ',cyrillic,cyrillic-ext'; } elseif ( 'greek' == $subset ) { $subsets .= ',greek,greek-ext'; } elseif ( 'devanagari' == $subset ) { $subsets .= ',devanagari'; } elseif ( 'vietnamese' == $subset ) { $subsets .= ',vietnamese'; } if ( $fonts ) { $fonts_url = add_query_arg( array( 'family' => urlencode( implode( '|', $fonts ) ), 'subset' => urlencode( $subsets ), ), '//fonts.googleapis.com/css' ); } return $fonts_url; } endif; function quidus_load_fonts() { $headings_font = esc_html(get_theme_mod('quidus_header_font')); $body_font = esc_html(get_theme_mod('quidus_body_font')); if( $headings_font != '') { wp_enqueue_style( 'quidus_header_font', '//fonts.googleapis.com/css?family='. $headings_font ); } else { wp_enqueue_style( 'quidus-raleway', '//fonts.googleapis.com/css?family=Raleway:400,100,200,300,500,600,700,800,900'); } if( $body_font != '') { wp_enqueue_style( 'quidus_body_font', '//fonts.googleapis.com/css?family='. $body_font ); } else { wp_enqueue_style( 'quidus-titillium-web', '//fonts.googleapis.com/css?family=Titillium+Web:400,200,200italic,300,300italic,400italic,600,600italic,700,700italic,900'); } wp_enqueue_style('quidus-pacifico', '//fonts.googleapis.com/css?family=Libre+Baskerville:400,700,400italic'); } add_action('wp_enqueue_scripts', 'quidus_load_fonts'); /** * Import scripts & styles */ function quidus_scripts() { // Custom fonts wp_enqueue_style( 'quidus-fonts', quidus_fonts_url(), array(), null ); // Main stylesheet. wp_enqueue_style( 'quidus-style', get_stylesheet_uri() ); // Font awesome wp_enqueue_style('font-awesome', get_template_directory_uri() . '/css/font-awesome-4.3.0/css/font-awesome.css'); // Genericons wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.2' ); wp_enqueue_script( 'quidus-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20141010', true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } wp_enqueue_script( 'quidus-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20141212', true ); wp_localize_script( 'quidus-script', 'screenReaderText', array( 'expand' => '' . __( 'expand child menu', 'quidus' ) . '', 'collapse' => '' . __( 'collapse child menu', 'quidus' ) . '', ) ); } add_action( 'wp_enqueue_scripts', 'quidus_scripts' ); /** * Enqueue Font Awesome Stylesheet from MaxCDN * */ /** * Display descriptions in main navigation. **/ function quidus_nav_description( $item_output, $item, $depth, $args ) { if ( 'primary' == $args->theme_location && $item->description ) { $item_output = str_replace( $args->link_after . '', '' . $args->link_after . '', $item_output ); } return $item_output; } add_filter( 'walker_nav_menu_start_el', 'quidus_nav_description', 10, 4 ); /** * Add a `screen-reader-text` class to the search form's submit button. * */ function quidus_search_form_modify( $html ) { return str_replace( 'class="search-submit"', 'class="search-submit screen-reader-text"', $html ); } add_filter( 'get_search_form', 'quidus_search_form_modify' ); /** * Custom template tags for this theme. * */ require get_template_directory() . '/inc/template-tags.php'; /** * Customizer additions. * */ require get_template_directory() . '/inc/customizer.php'; /** * Configuration sample for the Kirki Customizer */ function quidus_demo_configuration_sample() { $args = array( 'logo_image' => 'http://i59.tinypic.com/141saia.jpg', 'description' => __( 'The theme description.', 'quidus' ), 'color_accent' => '#3f3f40', 'color_back' => '#d5574d', 'textdomain' => 'quidus' ); return $args; } add_filter( 'kirki/config', 'quidus_demo_configuration_sample' ); /** * Include additional custom admin panel features. */ require get_template_directory() . '/panel/quidus-theme-documentaion.php'; require get_template_directory() . '/inc/TGM/quidus-tgm-activate.php';