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.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
*/
add_theme_support( 'post-thumbnails' );
add_image_size('large-thumb', 1060, 650, true);
add_image_size('index-thumb', 780, 250, true);
add_image_size('square-thumb', 500, 500, true);
add_image_size('side-gallery-thumb', 300, 450, true);
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => esc_html__( 'Primary', 'ameno' ),
'social' => __( 'Social Menu', 'ameno'),
) );
/*
* 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://developer.wordpress.org/themes/functionality/post-formats/
*/
add_theme_support( 'post-formats', array(
'aside',
) );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'ameno_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
}
endif;
add_action( 'after_setup_theme', 'ameno_setup' );
/**
* Set the content width in pixels, based on the theme's design and stylesheet.
*
* Priority 0 to make it available to lower priority callbacks.
*
* @global int $content_width
*/
function ameno_content_width() {
$GLOBALS['content_width'] = apply_filters( 'ameno_content_width', 600 );
}
add_action( 'after_setup_theme', 'ameno_content_width', 0 );
/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function ameno_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'ameno' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '',
'before_title' => '
',
) );
register_sidebar( array(
'name' => __( 'Footer Widgets', 'ameno' ),
'description' => __( 'Footer widgets area appears in the footer of the site.', 'ameno' ),
'id' => 'sidebar-2',
'before_widget' => '',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'ameno_widgets_init' );
function ameno_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', 'ameno' ) ) {
$fonts[] = 'Lato:100,300,400,400italic,700,900,900italic';
}
/* translators: If there are characters in your language that are not supported by PT Serif, translate this to 'off'. Do not translate into your own language. */
if ( 'off' !== _x( 'on', 'PT Serif font: on or off', 'ameno' ) ) {
$fonts[] = 'PT Serif:400,700,400italic,700italic';
}
if ( $fonts ) {
$fonts_url = add_query_arg( array(
'family' => urlencode( implode( '|', $fonts ) ),
'subset' => urlencode( $subsets ),
), 'https://fonts.googleapis.com/css' );
}
return $fonts_url;
}
/**
* Enqueue scripts and styles.
*/
function ameno_scripts() {
wp_enqueue_style( 'ameno-style', get_stylesheet_uri() );
if (is_page_template('page-templates/page-nosidebar.php')) {
wp_enqueue_style( 'ameno-layout-style' , get_template_directory_uri() . '/layouts/no-sidebar.css');
} elseif(is_page_template('page-templates/page-leftsidebar.php')) {
wp_enqueue_style( 'ameno-layout-style' , get_template_directory_uri() . '/layouts/sidebar-content.css');
} else {
wp_enqueue_style( 'ameno-layout-style' , get_template_directory_uri() . '/layouts/content-sidebar.css');
}
wp_enqueue_style( 'ameno-layout-style' , get_template_directory_uri() . '/layouts/content-sidebar.css');
wp_enqueue_style( 'google-fonts', ameno_fonts_url() );
// FontAwesome
wp_enqueue_style('fontawesome', get_template_directory_uri() . '/font-awesome/css/font-awesome.min.css');
if(is_front_page() && !is_paged()) :
wp_enqueue_style('ameno_slidingheader_style', get_template_directory_uri() . '/slidingheader/css/sh-style.css');
wp_enqueue_style('ameno_slidingheader_layout', get_template_directory_uri() . '/slidingheader/css/sh-layout.css');
endif;
wp_enqueue_script( 'superfish', get_template_directory_uri() . '/js/superfish.min.js', array('jquery'), '20140328', true );
if(is_front_page() && !is_paged()) :
wp_enqueue_script( 'ameno-slidingheader-classie', get_template_directory_uri() . '/slidingheader/js/sh-classie.js', array('jquery'), '20140328', true );
wp_enqueue_script( 'ameno-slidingheader-main', get_template_directory_uri() . '/slidingheader/js/sh-main.js', array('jquery'), '20140328', true );
endif;
wp_enqueue_script( 'superfish-settings', get_template_directory_uri() . '/js/superfish-settings.js', array('ameno-superfish'), '20140328', true );
wp_enqueue_script( 'ameno-hide-search', get_template_directory_uri() . '/js/hide-search.js', array(), '20140404', true );
wp_enqueue_script( 'navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true );
wp_enqueue_script( 'skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );
wp_enqueue_script( 'masonry', get_template_directory_uri() . '/js/masonry-settings.js', array('masonry'), '20140401', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'ameno_scripts' );
/**
* Implement the Custom Header feature.
*/
require get_template_directory() . '/inc/custom-header.php';
/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/template-tags.php';
/**
* Custom functions that act independently of the theme templates.
*/
require get_template_directory() . '/inc/extras.php';
/**
* Customizer additions.
*/
require get_template_directory() . '/inc/customizer.php';
/**
* Load Jetpack compatibility file.
*/
require get_template_directory() . '/inc/jetpack.php';