', '' ); ?>
esc_html__( 'Primary Menu', 'responsivo' ) ) ); // This theme supports a variety of post formats add_theme_support( 'post-formats', array( 'aside', 'audio', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video' ) ); // Enable support for Custom Backgrounds add_theme_support( 'custom-background', array( // Background color default 'default-color' => 'fff', // Background image default 'default-image' => trailingslashit( get_template_directory_uri() ) . 'images/faint-squares.jpg' ) ); // Enable support for Custom Headers (or in our case, a custom logo) add_theme_support( 'custom-header', array( // Header image default //'default-image' => trailingslashit( get_template_directory_uri() ) . 'images/logo.png', // Header text display default 'header-text' => false, // Header text color default 'default-text-color' => '000', // Flexible width 'flex-width' => true, // Header image width (in pixels) 'width' => 300, // Flexible height 'flex-height' => true, // Header image height (in pixels) 'height' => 80 ) ); // Enable support for Theme Options. // Rather than reinvent the wheel, we're using the Options Framework by Devin Price, so huge props to him! // http://wptheming.com/options-framework-theme/ if ( !function_exists( 'optionsframework_init' ) ) { define( 'OPTIONS_FRAMEWORK_DIRECTORY', trailingslashit( get_template_directory_uri() ) . 'inc/' ); require_once trailingslashit( get_template_directory() ) . 'inc/options-framework.php'; } } } add_action( 'after_setup_theme', 'responsivo_setup' ); /** * Returns the Google font stylesheet URL, if available. * * The use of PT Sans and Montserrat by default is localized. For languages that use characters not supported by the fonts, the fonts can be disabled. * * @since Responsivo 1.2.5 * * @return string Font stylesheet or empty string if disabled. */ function responsivo_fonts_url() { $fonts_url = ''; $subsets = 'latin'; /* translators: If there are characters in your language that are not supported by PT Sans, translate this to 'off'. * Do not translate into your own language. */ $pt_sans = _x( 'off', 'PT Sans font: on or off', 'responsivo' ); /* translators: To add an additional PT Sans character subset specific to your language, translate this to 'greek', 'cyrillic' or 'vietnamese'. * Do not translate into your own language. */ $subset = _x( 'no-subset', 'PT Sans font: add new subset (cyrillic)', 'responsivo' ); if ( 'cyrillic' == $subset ) $subsets .= ',cyrillic'; /* translators: If there are characters in your language that are not supported by Montserrat, translate this to 'off'. * Do not translate into your own language. */ $montserrat = _x( 'on', 'Montserrat font: on or off', 'responsivo' ); if ( 'off' !== $pt_sans || 'off' !== $montserrat ) { $font_families = array(); if ( 'off' !== $pt_sans ) $font_families[] = 'PT+Sans:400,400italic,700,700italic'; if ( 'off' !== $montserrat ) $font_families[] = 'Montserrat'; $protocol = is_ssl() ? 'https' : 'http'; $query_args = array( 'family' => implode( '|', $font_families ), 'subset' => $subsets, ); $fonts_url = add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" ); } return $fonts_url; } /** * Adds additional stylesheets to the TinyMCE editor if needed. * * @since Responsivo 1.2.5 * * @param string $mce_css CSS path to load in TinyMCE. * @return string The filtered CSS paths list. */ function responsivo_mce_css( $mce_css ) { $fonts_url = responsivo_fonts_url(); if ( empty( $fonts_url ) ) { return $mce_css; } if ( !empty( $mce_css ) ) { $mce_css .= ','; } $mce_css .= esc_url_raw( str_replace( ',', '%2C', $fonts_url ) ); return $mce_css; } add_filter( 'mce_css', 'responsivo_mce_css' ); /** * Register widgetized areas * * @since Responsivo 1.0 * * @return void */ function responsivo_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Main Sidebar', 'responsivo' ), 'id' => 'sidebar-main', 'description' => esc_html__( 'Appears in the sidebar on posts and pages except the optional Front Page template, which has its own widgets', 'responsivo' ), 'before_widget' => '', 'before_title' => '
', '' ); ?>
' . '
'; $fields[ 'url' ] = '' . '
'; return $fields; } add_action( 'comment_form_default_fields', 'responsivo_comment_form_default_fields' ); /** * Update the Comments form to add a 'required' span to the Comment textarea within the form label, because it's pointless * submitting a comment that doesn't actually have any text in the comment field! * * @since Responsivo 1.0 * * @param string Comment form textarea html * @return string The updated comment form textarea html */ function responsivo_comment_form_field_comment( $field ) { $field = ''; return $field; } add_action( 'comment_form_field_comment', 'responsivo_comment_form_field_comment' ); /** * Prints HTML with meta information for current post: author and date * * @since Responsivo 1.0 * * @return void */ if ( ! function_exists( 'responsivo_posted_on' ) ) { function responsivo_posted_on() { $post_icon = ''; switch ( get_post_format() ) { case 'aside': $post_icon = 'fa-file-o'; break; case 'audio': $post_icon = 'fa-volume-up'; break; case 'chat': $post_icon = 'fa-comment'; break; case 'gallery': $post_icon = 'fa-camera'; break; case 'image': $post_icon = 'fa-picture-o'; break; case 'link': $post_icon = 'fa-link'; break; case 'quote': $post_icon = 'fa-quote-left'; break; case 'status': $post_icon = 'fa-user'; break; case 'video': $post_icon = 'fa-video-camera'; break; default: $post_icon = 'fa-calendar'; break; } // Translators: 1: Icon 2: Permalink 3: Post date and time 4: Publish date in ISO format 5: Post date $date = sprintf( ' ', $post_icon, esc_url( get_permalink() ), sprintf( esc_html__( '%1$s @ %2$s', 'responsivo' ), esc_html( get_the_date() ), esc_attr( get_the_time() ) ), esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ) ); // Translators: 1: Date link 2: Author link 3: Categories 4: No. of Comments $author = sprintf( ' %3$s', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( esc_html__( 'View all posts by %s', 'responsivo' ), get_the_author() ) ), get_the_author() ); // Return the Categories as a list $categories_list = get_the_category_list( esc_html__( ' ', 'responsivo' ) ); // Translators: 1: Permalink 2: Title 3: No. of Comments $comments = sprintf( ' %3$s', esc_url( get_comments_link() ), esc_attr( esc_html__( 'Comment on ' . the_title_attribute( 'echo=0' ) ) ), ( get_comments_number() > 0 ? sprintf( _n( '%1$s Comment', '%1$s Comments', get_comments_number(), 'responsivo' ), get_comments_number() ) : esc_html__( 'No Comments', 'responsivo' ) ) ); // Translators: 1: Date 2: Author 3: Categories 4: Comments printf( wp_kses( __( ' ', 'responsivo' ), array( 'div' => array ( 'class' => array() ), 'span' => array( 'class' => array() ) ) ), $date, $author, $categories_list, ( is_search() ? '' : $comments ) ); } } /** * Prints HTML with meta information for current post: categories, tags, permalink * * @since Responsivo 1.0 * * @return void */ if ( ! function_exists( 'responsivo_entry_meta' ) ) { function responsivo_entry_meta() { // Return the Tags as a list $tag_list = ""; if ( get_the_tag_list() ) { $tag_list = get_the_tag_list( ' ' ); } // Translators: 1 is tag if ( $tag_list ) { printf( wp_kses( __( ' %1$s', 'responsivo' ), array( 'i' => array( 'class' => array() ) ) ), $tag_list ); } } } /** * Adjusts content_width value for full-width templates and attachments * * @since Responsivo 1.0 * * @return void */ function responsivo_content_width() { if ( is_page_template( 'page-templates/full-width.php' ) || is_attachment() ) { global $content_width; $content_width = 1200; } } add_action( 'template_redirect', 'responsivo_content_width' ); /** * Change the "read more..." link so it links to the top of the page rather than part way down * * @since Responsivo 1.0 * * @param string The 'Read more' link * @return string The link to the post url without the more tag appended on the end */ function responsivo_remove_more_jump_link( $link ) { $offset = strpos( $link, '#more-' ); if ( $offset ) { $end = strpos( $link, '"', $offset ); } if ( $end ) { $link = substr_replace( $link, '', $offset, $end-$offset ); } return $link; } add_filter( 'the_content_more_link', 'responsivo_remove_more_jump_link' ); /** * Returns a "Continue Reading" link for excerpts * * @since Responsivo 1.0 * * @return string The 'Continue reading' link */ function responsivo_continue_reading_link() { return '…' . wp_kses( __( 'Continue reading ', 'responsivo' ), array( 'span' => array( 'class' => array() ) ) ) . '
'; } /** * Replaces "[...]" (appended to automatically generated excerpts) with the responsivo_continue_reading_link(). * * @since Responsivo 1.0 * * @param string Auto generated excerpt * @return string The filtered excerpt */ function responsivo_auto_excerpt_more( $more ) { return responsivo_continue_reading_link(); } add_filter( 'excerpt_more', 'responsivo_auto_excerpt_more' ); /** * Extend the user contact methods to include Twitter, Facebook and Google+ * * @since Responsivo 1.0 * * @param array List of user contact methods * @return array The filtered list of updated user contact methods */ function responsivo_new_contactmethods( $contactmethods ) { // Add Twitter $contactmethods['twitter'] = 'Twitter'; //add Facebook $contactmethods['facebook'] = 'Facebook'; //add Google Plus $contactmethods['googleplus'] = 'Google+'; return $contactmethods; } add_filter( 'user_contactmethods', 'responsivo_new_contactmethods', 10, 1 ); /** * Add a filter for wp_nav_menu to add an extra class for menu items that have children (ie. sub menus) * This allows us to perform some nicer styling on our menu items that have multiple levels (eg. dropdown menu arrows) * * @since Responsivo 1.0 * * @param Menu items * @return array An extra css class is on menu items with children */ function responsivo_add_menu_parent_class( $items ) { $parents = array(); foreach ( $items as $item ) { if ( $item->menu_item_parent && $item->menu_item_parent > 0 ) { $parents[] = $item->menu_item_parent; } } foreach ( $items as $item ) { if ( in_array( $item->ID, $parents ) ) { $item->classes[] = 'menu-parent-item'; } } return $items; } add_filter( 'wp_nav_menu_objects', 'responsivo_add_menu_parent_class' ); /** * Add Filter to allow Shortcodes to work in the Sidebar * * @since Responsivo 1.0 */ add_filter( 'widget_text', 'do_shortcode' ); /** * Return an unordered list of linked social media icons, based on the urls provided in the Theme Options * * @since Responsivo 1.0 * * @return string Unordered list of linked social media icons */ if ( ! function_exists( 'responsivo_get_social_media' ) ) { function responsivo_get_social_media() { $output = ''; $icons = array( array( 'url' => of_get_option( 'social_twitter', '' ), 'icon' => 'fa-twitter', 'title' => esc_html__( 'Follow me on Twitter', 'responsivo' ) ), array( 'url' => of_get_option( 'social_facebook', '' ), 'icon' => 'fa-facebook', 'title' => esc_html__( 'Friend me on Facebook', 'responsivo' ) ), array( 'url' => of_get_option( 'social_googleplus', '' ), 'icon' => 'fa-google-plus', 'title' => esc_html__( 'Connect with me on Google+', 'responsivo' ) ), array( 'url' => of_get_option( 'social_linkedin', '' ), 'icon' => 'fa-linkedin', 'title' => esc_html__( 'Connect with me on LinkedIn', 'responsivo' ) ), array( 'url' => of_get_option( 'social_dribbble', '' ), 'icon' => 'fa-dribbble', 'title' => esc_html__( 'Follow me on Dribbble', 'responsivo' ) ), array( 'url' => of_get_option( 'social_tumblr', '' ), 'icon' => 'fa-tumblr', 'title' => esc_html__( 'Follow me on Tumblr', 'responsivo' ) ), array( 'url' => of_get_option( 'social_github', '' ), 'icon' => 'fa-github', 'title' => esc_html__( 'Fork me on GitHub', 'responsivo' ) ), array( 'url' => of_get_option( 'social_bitbucket', '' ), 'icon' => 'fa-bitbucket', 'title' => esc_html__( 'Fork me on Bitbucket', 'responsivo' ) ), array( 'url' => of_get_option( 'social_foursquare', '' ), 'icon' => 'fa-foursquare', 'title' => esc_html__( 'Follow me on Foursquare', 'responsivo' ) ), array( 'url' => of_get_option( 'social_youtube', '' ), 'icon' => 'fa-youtube', 'title' => esc_html__( 'Subscribe to me on YouTube', 'responsivo' ) ), array( 'url' => of_get_option( 'social_instagram', '' ), 'icon' => 'fa-instagram', 'title' => esc_html__( 'Follow me on Instagram', 'responsivo' ) ), array( 'url' => of_get_option( 'social_flickr', '' ), 'icon' => 'fa-flickr', 'title' => esc_html__( 'Connect with me on Flickr', 'responsivo' ) ), array( 'url' => of_get_option( 'social_pinterest', '' ), 'icon' => 'fa-pinterest', 'title' => esc_html__( 'Follow me on Pinterest', 'responsivo' ) ), array( 'url' => of_get_option( 'social_rss', '' ), 'icon' => 'fa-rss', 'title' => esc_html__( 'Subscribe to my RSS Feed', 'responsivo' ) ) ); foreach ( $icons as $key ) { $value = $key['url']; if ( !empty( $value ) ) { $output .= sprintf( '