tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support( 'title-tag' ); /** * Add styles to WYSIWYG editor, so the text formatting will match the theme */ add_editor_style( array( 'editor-style.css', snaps_fonts_url(), 'genericons/genericons.css' ) ); /** * Register menus in theme * This theme uses wp_nav_menu() in two locations */ register_nav_menus( array( 'primary' => __( 'Primary Menu', 'snaps' ), 'social' => __( 'Social Links', 'snaps' ), ) ); /* * Switch default core markup for search form, comments, galleries and captions * to output valid HTML5. */ add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', ) ); /** * Enable support for Post Thumbnails * See http://codex.wordpress.org/Post_Formats */ add_theme_support( 'post-thumbnails' ); /* setting custom image size for thumbnails for Snaps */ add_image_size( 'snaps-thumbnails', '480', '640', true ); /* setting custom image size for the Site Logo - double the max height set in CSS for retina screens */ add_image_size( 'snaps-site-logo', '', '320', 9999 ); /** * Enable support for Post Formats */ add_theme_support( 'post-formats', array( 'aside', 'audio', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video', ) ); /** * Set up the WordPress core custom background feature. */ add_theme_support( 'custom-background', apply_filters( 'snaps_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => '', ) ) ); } endif; // snaps_setup add_action( 'after_setup_theme', 'snaps_setup' ); /** * Register Google Fonts */ function snaps_fonts_url() { $fonts_url = ''; /* Translators: If there are characters in your language that are not * supported by Lato, translate this to 'off'. Do not translate * into your own language. */ $lato = _x( 'on', 'Lato font: on or off', 'minnow' ); $font_families = array(); if ( 'off' !== $lato ) { $font_families[] = 'Lato:700,900,700italic'; $query_args = array( 'family' => urlencode( implode( '|', $font_families ) ), 'subset' => urlencode( 'latin,latin-ext' ), ); $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); } return $fonts_url; } if ( ! function_exists( 'snaps_clearfix_class' ) ) : /** * Add class to posts for clearfix */ function snaps_clearfix_class( $classes ) { $classes[] = 'clearfix'; return $classes; } endif; add_filter( 'post_class', 'snaps_clearfix_class', 10, 3 ); if ( ! function_exists( 'snaps_setup_author' ) ) : /** * Sets the authordata global when viewing an author archive. * * This provides backwards compatibility with * http://core.trac.wordpress.org/changeset/25574 * * It removes the need to call the_post() and rewind_posts() in an author * template to print information about the author. * * @global WP_Query $wp_query WordPress Query object. * @return void */ function snaps_setup_author() { global $wp_query; if ( $wp_query->is_author() && isset( $wp_query->post ) ) { $GLOBALS['authordata'] = get_userdata( $wp_query->post->post_author ); } } endif; add_action( 'wp', 'snaps_setup_author' ); if ( ! function_exists( 'snaps_comment' ) ) : /** * Template for comments and pingbacks. * * Used as a callback by wp_list_comments() for displaying the comments. */ function snaps_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; if ( 'pingback' == $comment->comment_type || 'trackback' == $comment->comment_type ) : ?>