'220e10','width' => 1920, 'height' => 300, 'wp-head-callback' => 'aguafuerte_header_style',) );
// Add theme support for Custom Background
add_theme_support( 'custom-background' );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded
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 three locations.
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'aguafuerte' ),
'secondary' => __( 'Secondary Menu', 'aguafuerte' ),
'social' => __( 'Social Links Menu', 'aguafuerte' ),
) );
/*
* 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(
'aside', 'image', 'video', 'quote', 'link', 'gallery', 'status', 'audio', 'chat'
) );
/*
* This theme styles the visual editor to resemble the theme style,
* specifically font, colors, icons, and column width.
*/
add_editor_style( array( 'css/editor-style.css', 'genericons/genericons.css', aguafuerte_fonts_url() ) );
}
endif; // aguafuerte_setup
add_action( 'after_setup_theme', 'aguafuerte_setup' );
function aguafuerte_header_style() {
$header_image = get_header_image();
$text_color = get_header_textcolor();
// If no custom options for text are set, let's bail.
if ( empty( $header_image ) && $text_color == get_theme_support( 'custom-header', 'default-text-color' ) )
return;
// If we get this far, we have custom styles.
?>
__( 'First Sidebar Area', 'aguafuerte' ),
'id' => 'sidebar-1',
'description' => __( 'Add widgets here to appear in your first sidebar.', 'aguafuerte' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Second Sidebar Area', 'aguafuerte' ),
'id' => 'sidebar-2',
'description' => __( 'Add widgets here to appear in your second sidebar.', 'aguafuerte' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'First Footer Area', 'aguafuerte' ),
'id' => 'footer-1',
'description' => __( 'Add widgets here to appear in your first footer.', 'aguafuerte' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Second Footer Area', 'aguafuerte' ),
'id' => 'footer-2',
'description' => __( 'Add widgets here to appear in your second footer.', 'aguafuerte' ),
'before_widget' => '',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'aguafuerte_widgets_init' );
if ( ! function_exists( 'aguafuerte_fonts_url' ) ) :
/**
* Register Google fonts for Aguafuerte.
*
* @since Aguafuerte 1.0.1
*
* @return string Google fonts URL for the theme.
*/
function aguafuerte_fonts_url() {
$fonts_url = '';
$fonts = array();
$subsets = 'latin,latin-ext';
/*
* 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.
*/
if ( 'off' !== _x( 'on', 'Lato font: on or off', 'aguafuerte' ) ) {
$fonts[] = 'Lato:300italic,400italic,700italic,900italic,300,400,700,900';
}
/*
* Translators: If there are characters in your language that are not supported
* by Bitter, translate this to 'off'. Do not translate into your own language.
*/
if ( 'off' !== _x( 'on', 'Bitter font: on or off', 'aguafuerte' ) ) {
$fonts[] = 'Bitter:400italic,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', 'aguafuerte' ) ) {
$fonts[] = 'Inconsolata:400,700';
}
/*
* Translators: If there are characters in your language that are not supported
* by Rochester, translate this to 'off'. Do not translate into your own language.
*/
if ( 'off' !== _x( 'on', 'Rochester font: on or off', 'aguafuerte' ) ) {
$fonts[] = 'Rochester:400';
}
/*
* Translators: If there are characters in your language that are not supported
* by Delius, translate this to 'off'. Do not translate into your own language.
*/
if ( 'off' !== _x( 'on', 'Delius font: on or off', 'aguafuerte' ) ) {
$fonts[] = 'Delius:400';
}
/*
* Translators: If there are characters in your language that are not supported
* by Delius Swash Caps, translate this to 'off'. Do not translate into your own language.
*/
if ( 'off' !== _x( 'on', 'Delius Swash Caps font: on or off', 'aguafuerte' ) ) {
$fonts[] = 'Delius Swash Caps:400';
}
/*
* Translators: If there are characters in your language that are not supported
* by Lobster Two, translate this to 'off'. Do not translate into your own language.
*/
if ( 'off' !== _x( 'on', 'Lobster Two font: on or off', 'aguafuerte' ) ) {
$fonts[] = 'Lobster Two:400';
}
/*
* Translators: If there are characters in your language that are not supported
* by Source Sans Pro, translate this to 'off'. Do not translate into your own language.
*/
if ( 'off' !== _x( 'on', 'Source Sans Pro font: on or off', 'aguafuerte' ) ) {
$fonts[] = 'Source Sans Pro:400italic,600italic,400,600';
}
/*
* 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)', 'aguafuerte' );
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 ),
), 'https://fonts.googleapis.com/css' );
}
return $fonts_url;
}
endif;
/**
* Enqueue scripts and styles for the front end.
*
* @since Aguafuerte 1.0.1
*/
function aguafuerte_scripts() {
// Add custom fonts, used in the main stylesheet.
wp_enqueue_style( 'aguafuerte-fonts', aguafuerte_fonts_url(), array(), null );
// Add Genericons font, used in the main stylesheet.
wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.4.1' );
// Load our main stylesheet.
wp_enqueue_style( 'aguafuerte-style', get_stylesheet_uri() );
// Load the JavaScript functions.
wp_enqueue_script( 'aguafuerte-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20150315', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
// Translate accesibility menues.
wp_localize_script( 'aguafuerte-script', 'screenReaderText', array(
'expand' => '' . __( 'expand child menu', 'aguafuerte' ) . '',
'collapse' => '' . __( 'collapse child menu', 'aguafuerte' ) . '',
) );
}
add_action( 'wp_enqueue_scripts', 'aguafuerte_scripts' );
/**
* Adds custom classes to the array of body classes.
*
* @since Aguafuerte 1.0.1
*
* @param array $classes Classes for the body element.
* @return array (Maybe) filtered body classes.
*/
function aguafuerte_body_classes( $classes ) {
// Adds a class of custom-background-image to sites with a custom background image.
if ( get_background_image() ) {
$classes[] = 'custom-background-image';
}
// Adds a class of group-blog to sites with more than 1 published author.
if ( is_multi_author() ) {
$classes[] = 'group-blog';
}
// Adds a class of no-sidebar to sites without active sidebar.
if ( ! is_active_sidebar( 'sidebar-1' ) && ! is_active_sidebar( 'sidebar-2') ) {
$classes[] = 'no-sidebar';
}
return $classes;
}
add_filter( 'body_class', 'aguafuerte_body_classes' );
/**
* Adds custom images sizes to the selection of image sizes.
*/
add_image_size('logo-size', 100, 40, true);
function my_custom_sizes( $sizes ) {
return array_merge( $sizes, array(
'logo-size' => __( 'Logo Size', 'aguafuerte' ),
) );
}
add_filter( 'image_size_names_choose', 'my_custom_sizes' );
/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/template-tags.php';
require get_template_directory() . '/inc/aguafuerte-customizer.php';