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 http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
*/
add_theme_support( 'post-thumbnails' );
add_image_size('amadeus-entry-thumb', 750);
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'amadeus' ),
'social' => __( 'Social', 'amadeus' ),
) );
/*
* 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 http://codex.wordpress.org/Post_Formats
*/
add_theme_support( 'post-formats', array(
'aside', 'image', 'video', 'quote', 'link',
) );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'amadeus_custom_background_args', array(
'default-color' => 'f7f3f0',
'default-image' => '',
) ) );
}
endif; // amadeus_setup
add_action( 'after_setup_theme', 'amadeus_setup' );
/**
* Register widget area.
*
* @link http://codex.wordpress.org/Function_Reference/register_sidebar
*/
function amadeus_widgets_init() {
register_sidebar( array(
'name' => __( 'Sidebar', 'amadeus' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '',
'before_title' => '
',
) );
register_sidebar( array(
'name' => __( 'Footer left', 'amadeus' ),
'id' => 'sidebar-4',
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer center', 'amadeus' ),
'id' => 'sidebar-5',
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer right', 'amadeus' ),
'id' => 'sidebar-6',
'before_widget' => '',
'before_title' => '',
) );
//Custom widgets
register_widget( 'Amadeus_Video' );
register_widget( 'Amadeus_Recent_Comments' );
register_widget( 'Amadeus_Recent_Posts' );
register_widget( 'Amadeus_About' );
}
add_action( 'widgets_init', 'amadeus_widgets_init' );
//Custom widgets
require get_template_directory() . "/widgets/video-widget.php";
require get_template_directory() . "/widgets/recent-comments.php";
require get_template_directory() . "/widgets/recent-posts.php";
require get_template_directory() . "/widgets/about-me.php";
/**
* Enqueue scripts and styles.
*/
function amadeus_scripts() {
wp_enqueue_style( 'amadeus-bootstrap', get_template_directory_uri() . '/css/bootstrap/css/bootstrap.min.css', array(), true );
if ( get_theme_mod('body_font_name') !='' ) {
wp_enqueue_style( 'amadeus-body-fonts', '//fonts.googleapis.com/css?family=' . esc_attr(get_theme_mod('body_font_name')) );
} else {
wp_enqueue_style( 'amadeus-body-fonts', '//fonts.googleapis.com/css?family=Noto+Serif:400,700,400italic,700italic');
}
if ( get_theme_mod('headings_font_name') !='' ) {
wp_enqueue_style( 'amadeus-headings-fonts', '//fonts.googleapis.com/css?family=' . esc_attr(get_theme_mod('headings_font_name')) );
} else {
wp_enqueue_style( 'amadeus-headings-fonts', '//fonts.googleapis.com/css?family=Playfair+Display:400,700');
}
wp_enqueue_style( 'amadeus-style', get_stylesheet_uri() );
wp_enqueue_style( 'amadeus-font-awesome', get_template_directory_uri() . '/fonts/font-awesome.min.css' );
wp_enqueue_script( 'amadeus-parallax', get_template_directory_uri() . '/js/parallax.min.js', array('jquery'), true );
wp_enqueue_script( 'amadeus-slicknav', get_template_directory_uri() . '/js/jquery.slicknav.min.js', array('jquery'), true );
wp_enqueue_script( 'amadeus-fitvids', get_template_directory_uri() . '/js/jquery.fitvids.min.js', array('jquery'), true );
wp_enqueue_script( 'amadeus-scripts', get_template_directory_uri() . '/js/scripts.js', array('jquery'), true );
wp_enqueue_script( 'amadeus-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true );
wp_enqueue_script( 'amadeus-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'amadeus_scripts' );
/**
* Customizer styles
*/
function amadeus_customizer_styles() {
wp_enqueue_style( 'amadeus-customizer-styles', get_template_directory_uri() . '/css/customizer.css' );
}
add_action( 'customize_controls_print_styles', 'amadeus_customizer_styles' );
/**
* Change the excerpt length
*/
function amadeus_excerpt_length( $length ) {
$excerpt = get_theme_mod('exc_lenght', '55');
return $excerpt;
}
add_filter( 'excerpt_length', 'amadeus_excerpt_length', 999 );
/**
* Footer credits
*/
function amadeus_footer_credits() {
echo '';
printf( __( 'Proudly powered by %s', 'amadeus' ), 'WordPress' );
echo '';
echo ' | ';
printf( __( 'Theme: %2$s by %1$s.', 'amadeus' ), 'FlyFreeMedia', 'Amadeus' );
}
add_action( 'amadeus_footer', 'amadeus_footer_credits' );
/**
* Load html5shiv
*/
function amadeus_html5shiv() {
echo '' . "\n";
}
add_action( 'wp_head', 'amadeus_html5shiv' );
/**
* 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';
/**
* Banner
*/
require get_template_directory() . '/inc/banner.php';
/**
* Styles
*/
require get_template_directory() . '/inc/styles.php';