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( 'rivet-post-image', 2000, 1500 );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'menu-1' => esc_html__( 'Header', 'rivet' ),
) );
/*
* 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',
) );
// Add theme support for Custom Logo.
add_theme_support( 'custom-logo', array(
'width' => 1200,
'height' => 900,
'flex-width' => true,
'flex-height' => true,
'header-text' => array( 'site-title', 'site-description' ),
) );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'rivet_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
}
endif;
add_action( 'after_setup_theme', 'rivet_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 rivet_content_width() {
$GLOBALS['content_width'] = apply_filters( 'rivet_content_width', 740 );
}
add_action( 'after_setup_theme', 'rivet_content_width', 0 );
/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function rivet_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Footer', 'rivet' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '',
'before_title' => '
',
) );
}
add_action( 'widgets_init', 'rivet_widgets_init' );
/**
* Enqueue scripts and styles.
*/
function rivet_scripts() {
wp_enqueue_style( 'rivet-style', get_stylesheet_uri(), time() );
wp_enqueue_script( 'rivet-navigation', get_template_directory_uri() . '/assets/js/navigation.js', array(), '20151215', true );
wp_localize_script( 'rivet-navigation', 'screenReaderText', array(
'expand' => esc_html__( 'Expand child menu', 'rivet' ),
'collapse' => esc_html__( 'Collapse child menu', 'rivet' ),
'icon_expand' => rivet_get_svg( array( 'icon' => 'expand' ) ),
'icon_zoom' => rivet_get_svg( array( 'icon' => 'zoom' ) ),
) );
wp_enqueue_script( 'rivet-skip-link-focus-fix', get_template_directory_uri() . '/assets/js/skip-link-focus-fix.js', array(), '20151215', true );
wp_enqueue_script( 'rivet', get_template_directory_uri() . '/assets/js/rivet.js', array( 'jquery' ), '20170629', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'rivet_scripts' );
/**
* Enqueue stylesheet inside the Customizer.
*/
function rivet_custom_customize_enqueue() {
wp_enqueue_style( 'customizer-css', get_stylesheet_directory_uri() . '/assets/css/customizer.css' );
}
add_action( 'customize_controls_enqueue_scripts', 'rivet_custom_customize_enqueue' );
/**
* Add a pingback url auto-discovery header for singularly identifiable articles.
*/
function rivet_pingback_header() {
if ( is_singular() && pings_open() ) {
echo '';
}
}
add_action( 'wp_head', 'rivet_pingback_header' );
/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/template-tags.php';
/**
* Additional features to allow styling of the templates.
*/
require get_template_directory() . '/inc/template-functions.php';
/**
* Style packs.
*/
//require get_template_directory() . '/inc/style-packs-core.php';
//require get_template_directory() . '/inc/style-packs.php';
/**
* Customizer additions.
*/
require get_template_directory() . '/inc/customizer.php';
/**
* SVG icons functions and filters.
*/
require get_parent_theme_file_path( '/inc/icon-functions.php' );
/**
* Load Jetpack compatibility file.
*/
require get_template_directory() . '/inc/jetpack.php';
/**
* Load Hero Area code.
*/
require get_template_directory() . '/hero-area/hero-area-functions.php';
/**
* Load Contact Info code.
*/
require get_template_directory() . '/contact-info/contact-info-functions.php';
/**
* Load panel shortcodes.
*/
require get_template_directory() . '/inc/shortcodes.php';
/**
* Load WooCommerce compatibility file.
*/
if ( class_exists( 'WooCommerce' ) ) {
require get_template_directory() . '/inc/woocommerce.php';
}