__( 'Primary Menu', 'actions' ),
) );
/*
* Switch default core markup for search form, comment form, comments, galleries, captions and widgets
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
'widgets',
) );
// Add support for the Site Logo plugin and the site logo functionality in JetPack
// https://github.com/automattic/site-logo
// http://jetpack.me/
$args = array(
'header-text' => array(
'site-title',
'site-description',
),
'size' => 'medium',
);
add_theme_support( 'site-logo', $args );
// Declare support for title theme feature
add_theme_support( 'title-tag' );
}
endif; // actions_setup
/**
* Register widget area.
*
* @link http://codex.wordpress.org/Function_Reference/register_sidebar
*/
function actions_widgets_init() {
register_sidebar( array(
'name' => __( 'Sidebar', 'actions' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '',
'before_title' => '
',
) );
}
if ( ! function_exists( 'actions_fonts_url' ) ) :
/**
* Register Google fonts for Twenty Sixteen.
*
* Create your own actions_fonts_url() function to override in a child theme.
*
* @since Twenty Sixteen 1.0
*
* @return string Google fonts URL for the theme.
*/
function actions_fonts_url() {
$fonts_url = '';
$fonts = array();
$subsets = 'latin,latin-ext';
/* translators: If there are characters in your language that are not supported by Merriweather, translate this to 'off'. Do not translate into your own language. */
if ( 'off' !== _x( 'on', 'Merriweather font: on or off', 'actions' ) ) {
$fonts[] = 'Merriweather:400,700,900,400italic,700italic,900italic';
}
/* 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. */
if ( 'off' !== _x( 'on', 'Montserrat font: on or off', 'actions' ) ) {
$fonts[] = 'Montserrat: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', 'actions' ) ) {
$fonts[] = 'Inconsolata:400';
}
if ( $fonts ) {
$fonts_url = add_query_arg( array(
'family' => urlencode( implode( '|', $fonts ) ),
'subset' => urlencode( $subsets ),
), 'https://fonts.googleapis.com/css' );
}
return $fonts_url;
}
endif;
/**
* Handles JavaScript detection.
*
* Adds a `js` class to the root `` element when JavaScript is detected.
*
* @since Actions 1.0.1
*/
function actions_javascript_detection() {
echo "\n";
}
add_action( 'wp_head', 'actions_javascript_detection', 0 );
/**
* Enqueue scripts and styles.
* @since 1.0.0
*/
function actions_scripts() {
global $actions_version;
// Add custom fonts, used in the main stylesheet.
wp_enqueue_style( 'actions-fonts', actions_fonts_url(), array(), null );
wp_enqueue_style( 'actions-style', get_template_directory_uri() . '/style.css', '', $actions_version );
wp_style_add_data( 'actions-rtl', 'rtl', 'replace' );
wp_enqueue_script( 'actions-navigation', get_template_directory_uri() . '/js/navigation.js', array( 'jquery' ), '20120206', true );
wp_enqueue_script( 'actions-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' );
}
}
/**
* Enqueue child theme stylesheet.
* A separate function is required as the child theme css needs to be enqueued _after_ the parent theme
* primary css and the separate WooCommerce css.
* @since 1.0.0
*/
function actions_child_scripts() {
if ( is_child_theme() || !is_admin() ) {
wp_enqueue_style( 'actions-child-style', get_stylesheet_uri(), '' );
}
}