All Themes: Fix whitespace in functions.php

This commit is contained in:
Ben Dwyer 2021-02-18 10:17:16 +00:00
parent 3fa9d68c06
commit 5a410e23c4
56 changed files with 4272 additions and 3612 deletions

View file

@ -8,85 +8,100 @@
*/
if ( ! function_exists( 'affinity_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the aftercomponentsetup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function affinity_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on components, use a find and replace
* to change 'affinity' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'affinity', get_template_directory() . '/languages' );
// 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 <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
/*
* Add editor styles
*/
add_editor_style();
/*
* Add support for responsive embeds.
*/
add_theme_support( 'responsive-embeds' );
/**
* Add support for core custom logo
* - also see fallback in inc/jetpack.php
*/
add_theme_support( 'custom-logo', array(
'height' => 800,
'width' => 250,
'flex-width' => true,
'flex-height' => true,
) );
/*
* Enable support for Post Thumbnails on posts and pages.
* Sets up theme defaults and registers support for various WordPress features.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
* Note that this function is hooked into the aftercomponentsetup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
add_theme_support( 'post-thumbnails' );
add_image_size( 'affinity-featured', 1500, 9999 );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'top' => esc_html__( 'Top', 'affinity' ),
) );
function affinity_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on components, use a find and replace
* to change 'affinity' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'affinity', get_template_directory() . '/languages' );
/*
* 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 default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'affinity_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
}
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
/*
* Add editor styles
*/
add_editor_style();
/*
* Add support for responsive embeds.
*/
add_theme_support( 'responsive-embeds' );
/**
* Add support for core custom logo
* - also see fallback in inc/jetpack.php
*/
add_theme_support(
'custom-logo',
array(
'height' => 800,
'width' => 250,
'flex-width' => true,
'flex-height' => true,
)
);
/*
* 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( 'affinity-featured', 1500, 9999 );
// This theme uses wp_nav_menu() in one location.
register_nav_menus(
array(
'top' => esc_html__( 'Top', 'affinity' ),
)
);
/*
* 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',
)
);
// Set up the WordPress core custom background feature.
add_theme_support(
'custom-background',
apply_filters(
'affinity_custom_background_args',
array(
'default-color' => 'ffffff',
'default-image' => '',
)
)
);
}
endif;
add_action( 'after_setup_theme', 'affinity_setup' );
@ -130,19 +145,19 @@ add_action( 'after_setup_theme', 'affinity_content_width', 0 );
if ( ! function_exists( 'affinity_content_width' ) ) :
function affinity_content_width() {
global $content_width;
function affinity_content_width() {
global $content_width;
if ( is_page_template( 'fullwidth-page.php' ) ) {
$content_width = 1004;
}
if ( is_page_template( 'front-page.php' ) || ! is_active_sidebar( 'sidebar-1' ) ) {
$content_width = 716;
}
if ( is_page_template( 'fullwidth-page.php' ) ) {
$content_width = 1004;
}
if ( is_page_template( 'front-page.php' ) || ! is_active_sidebar( 'sidebar-1' ) ) {
$content_width = 716;
}
}
add_action( 'template_redirect', 'affinity_content_width' );
add_action( 'template_redirect', 'affinity_content_width' );
endif; // if ! function_exists( 'affinity_content_width' )
@ -153,45 +168,53 @@ endif; // if ! function_exists( 'affinity_content_width' )
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function affinity_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'affinity' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Sidebar', 'affinity' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Footer Widgets 1', 'affinity' ),
'id' => 'footer-1',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Footer Widgets 1', 'affinity' ),
'id' => 'footer-1',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Footer Widgets 2', 'affinity' ),
'id' => 'footer-2',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Footer Widgets 2', 'affinity' ),
'id' => 'footer-2',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Footer Widgets 3', 'affinity' ),
'id' => 'footer-3',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Footer Widgets 3', 'affinity' ),
'id' => 'footer-3',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
}
add_action( 'widgets_init', 'affinity_widgets_init' );
@ -270,7 +293,7 @@ add_action( 'wp_enqueue_scripts', 'affinity_scripts' );
* Gutenberg Editor Styles
*/
function affinity_editor_styles() {
wp_enqueue_style( 'affinity-blocks-editor-style', get_template_directory_uri() . '/editor-blocks.css');
wp_enqueue_style( 'affinity-blocks-editor-style', get_template_directory_uri() . '/editor-blocks.css' );
wp_enqueue_style( 'affinity-fonts', affinity_fonts_url(), array(), null );
}
add_action( 'enqueue_block_editor_assets', 'affinity_editor_styles' );
@ -304,9 +327,11 @@ function affinity_style_options() {
</style>
<?php }
<?php
}
if ( true == $backgroundscroll ) { ?>
if ( true == $backgroundscroll ) {
?>
<style type="text/css" id="affinity-scrolling-background-images">
@media screen and (min-width: 65em) {
.custom-header-image {
@ -323,7 +348,8 @@ function affinity_style_options() {
}
}
</style>
<?php }
<?php
}
}
add_action( 'wp_head', 'affinity_style_options' );

View file

@ -8,116 +8,134 @@
*/
if ( ! function_exists( 'altofocus_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the aftercomponentsetup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function altofocus_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on components, use a find and replace
* to change 'altofocus' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'altofocus', get_template_directory() . '/languages' );
// 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 <title> 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( 'altofocus-thumb-image', 640, 9999, false );
add_image_size( 'altofocus-post-featured-image', 1200, 800, false );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'menu-1' => esc_html__( 'Top', 'altofocus' ),
) );
/**
* Add support for core custom logo.
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the aftercomponentsetup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
add_theme_support( 'custom-logo', array(
'height' => 200,
'width' => 200,
'flex-width' => true,
'flex-height' => true,
) );
/*
* 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',
) );
function altofocus_setup() {
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'altofocus_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
'default-position-x' => 'center',
'default-position-y' => 'center',
'default-repeat' => 'no-repeat',
'default-attachment' => 'fixed',
'default-size' => 'cover',
'wp-head-callback' => 'altofocus_custom_background_cb'
) ) );
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on components, use a find and replace
* to change 'altofocus' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'altofocus', get_template_directory() . '/languages' );
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
// Add support for custom color scheme.
add_theme_support( 'editor-color-palette', array(
array(
'name' => esc_html__( 'Orange', 'altofocus' ),
'slug' => 'orange',
'color' => '#e38900',
),
array(
'name' => esc_html__( 'Dark Gray', 'altofocus' ),
'slug' => 'dark-gray',
'color' => '#111',
),
array(
'name' => esc_html__( 'Medium Gray', 'altofocus' ),
'slug' => 'medium-gray',
'color' => '#888',
),
array(
'name' => esc_html__( 'Light Gray', 'altofocus' ),
'slug' => 'light-gray',
'color' => '#ccc',
),
array(
'name' => esc_html__( 'White', 'altofocus' ),
'slug' => 'white',
'color' => '#fff',
),
) );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> 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( 'altofocus-thumb-image', 640, 9999, false );
add_image_size( 'altofocus-post-featured-image', 1200, 800, false );
// This theme uses wp_nav_menu() in one location.
register_nav_menus(
array(
'menu-1' => esc_html__( 'Top', 'altofocus' ),
)
);
/**
* Add support for core custom logo.
*/
add_theme_support(
'custom-logo',
array(
'height' => 200,
'width' => 200,
'flex-width' => true,
'flex-height' => true,
)
);
/*
* 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',
)
);
// Set up the WordPress core custom background feature.
add_theme_support(
'custom-background',
apply_filters(
'altofocus_custom_background_args',
array(
'default-color' => 'ffffff',
'default-image' => '',
'default-position-x' => 'center',
'default-position-y' => 'center',
'default-repeat' => 'no-repeat',
'default-attachment' => 'fixed',
'default-size' => 'cover',
'wp-head-callback' => 'altofocus_custom_background_cb',
)
)
);
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
// Add support for custom color scheme.
add_theme_support(
'editor-color-palette',
array(
array(
'name' => esc_html__( 'Orange', 'altofocus' ),
'slug' => 'orange',
'color' => '#e38900',
),
array(
'name' => esc_html__( 'Dark Gray', 'altofocus' ),
'slug' => 'dark-gray',
'color' => '#111',
),
array(
'name' => esc_html__( 'Medium Gray', 'altofocus' ),
'slug' => 'medium-gray',
'color' => '#888',
),
array(
'name' => esc_html__( 'Light Gray', 'altofocus' ),
'slug' => 'light-gray',
'color' => '#ccc',
),
array(
'name' => esc_html__( 'White', 'altofocus' ),
'slug' => 'white',
'color' => '#fff',
),
)
);
}
endif;
add_action( 'after_setup_theme', 'altofocus_setup' );
@ -130,7 +148,7 @@ add_action( 'after_setup_theme', 'altofocus_setup' );
*/
function altofocus_content_width() {
$GLOBALS[ 'content_width' ] = apply_filters( 'altofocus_content_width', '770' );
$GLOBALS['content_width'] = apply_filters( 'altofocus_content_width', '770' );
}
add_action( 'after_setup_theme', 'altofocus_content_width', 0 );
@ -141,15 +159,17 @@ add_action( 'after_setup_theme', 'altofocus_content_width', 0 );
*/
function altofocus_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Footer', 'altofocus' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Footer', 'altofocus' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
}
add_action( 'widgets_init', 'altofocus_widgets_init' );
@ -292,16 +312,24 @@ function altofocus_scripts() {
}
// Screenreader text
wp_localize_script( 'altofocus-navigation', 'altoFocusScreenReaderText', array(
'expand' => esc_html__( 'expand child menu', 'altofocus' ),
'collapse' => esc_html__( 'collapse child menu', 'altofocus' ),
) );
wp_localize_script(
'altofocus-navigation',
'altoFocusScreenReaderText',
array(
'expand' => esc_html__( 'expand child menu', 'altofocus' ),
'collapse' => esc_html__( 'collapse child menu', 'altofocus' ),
)
);
// Flexslider text
wp_localize_script( 'altofocus-flexslider', 'altoFocusFlexSliderText', array(
'next' => esc_html__( 'Next', 'altofocus' ),
'previous' => esc_html__( 'Previous', 'altofocus' ),
) );
wp_localize_script(
'altofocus-flexslider',
'altoFocusFlexSliderText',
array(
'next' => esc_html__( 'Next', 'altofocus' ),
'previous' => esc_html__( 'Previous', 'altofocus' ),
)
);
}
add_action( 'wp_enqueue_scripts', 'altofocus_scripts' );
@ -325,7 +353,7 @@ add_action( 'enqueue_block_editor_assets', 'altofocus_block_editor_styles' );
* Check whether the browser supports JavaScript
*/
function altofocus_html_js_class() {
echo '<script>document.documentElement.className = document.documentElement.className.replace("no-js","js");</script>'. "\n";
echo '<script>document.documentElement.className = document.documentElement.className.replace("no-js","js");</script>' . "\n";
}
add_action( 'wp_head', 'altofocus_html_js_class', 1 );

View file

@ -26,7 +26,6 @@ add_action( 'after_setup_theme', 'apostrophe_2_content_width', 0 );
*/
if ( ! function_exists( 'apostrophe_2_setup' ) ) :
function apostrophe_2_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
@ -44,42 +43,43 @@ if ( ! function_exists( 'apostrophe_2_setup' ) ) :
// Add custom colors to Gutenberg
add_theme_support(
'editor-color-palette', array(
'editor-color-palette',
array(
array(
'name' => esc_html__( 'Black', 'apostrophe-2' ),
'slug' => 'black',
'slug' => 'black',
'color' => '#404040',
),
array(
'name' => esc_html__( 'Dark Gray', 'apostrophe-2' ),
'slug' => 'dark-gray',
'slug' => 'dark-gray',
'color' => '#686868',
),
array(
'name' => esc_html__( 'Medium Gray', 'apostrophe-2' ),
'slug' => 'medium-gray',
'slug' => 'medium-gray',
'color' => '#999999',
),
array(
'name' => esc_html__( 'Light Gray', 'apostrophe-2' ),
'slug' => 'light-gray',
'slug' => 'light-gray',
'color' => '#d9d9d9',
),
array(
'name' => esc_html__( 'White', 'apostrophe-2' ),
'slug' => 'white',
'slug' => 'white',
'color' => '#ffffff',
),
array(
'name' => esc_html__( 'Blue', 'apostrophe-2' ),
'slug' => 'blue',
'slug' => 'blue',
'color' => '#159ae7',
),
array(
'name' => esc_html__( 'Dark Blue', 'apostrophe-2' ),
'slug' => 'dark-blue',
'slug' => 'dark-blue',
'color' => '#362e77',
)
),
)
);
@ -102,34 +102,52 @@ if ( ! function_exists( 'apostrophe_2_setup' ) ) :
add_image_size( 'apostrophe-2-mini', 60, 60, true );
add_image_size( 'apostrophe-2-gallery', 550, 550, true );
register_nav_menus( array(
'menu-1' => esc_html__( 'Header Menu', 'apostrophe-2' ),
) );
register_nav_menus(
array(
'menu-1' => esc_html__( 'Header Menu', 'apostrophe-2' ),
)
);
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'comment-list', 'comment-form', 'search-form', 'gallery', 'caption',
) );
add_theme_support(
'html5',
array(
'comment-list',
'comment-form',
'search-form',
'gallery',
'caption',
)
);
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'apostrophe_2_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
add_theme_support(
'custom-background',
apply_filters(
'apostrophe_2_custom_background_args',
array(
'default-color' => 'ffffff',
'default-image' => '',
)
)
);
// Enable support for custom logo.
add_theme_support( 'custom-logo', array(
'height' => 300,
'width' => 1030,
'flex-height' => true,
'flex-width' => true
) );
add_theme_support(
'custom-logo',
array(
'height' => 300,
'width' => 1030,
'flex-height' => true,
'flex-width' => true,
)
);
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
add_theme_support( 'customize-selective-refresh-widgets' );
}
endif; // apostrophe_2_setup
add_action( 'after_setup_theme', 'apostrophe_2_setup' );
@ -153,41 +171,49 @@ add_action( 'template_redirect', 'apostrophe_2_adjusted_content_width', 0 );
* @link http://codex.wordpress.org/Function_Reference/register_sidebar
*/
function apostrophe_2_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Primary', 'apostrophe-2' ),
'id' => 'sidebar-1',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Primary', 'apostrophe-2' ),
'id' => 'sidebar-1',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Secondary', 'apostrophe-2' ),
'id' => 'sidebar-2',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Secondary', 'apostrophe-2' ),
'id' => 'sidebar-2',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Tertiary', 'apostrophe-2' ),
'id' => 'sidebar-3',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Tertiary', 'apostrophe-2' ),
'id' => 'sidebar-3',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Footer Sidebar', 'apostrophe-2' ),
'id' => 'sidebar-4',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Footer Sidebar', 'apostrophe-2' ),
'id' => 'sidebar-4',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
)
);
}
add_action( 'widgets_init', 'apostrophe_2_widgets_init' );
@ -251,10 +277,14 @@ function apostrophe_2_scripts() {
wp_enqueue_script( 'comment-reply' );
}
wp_localize_script( 'apostrophe-2-navigation', 'screenReaderText', array(
'expand' => esc_html__( 'expand child menu', 'apostrophe-2' ),
'collapse' => esc_html__( 'collapse child menu', 'apostrophe-2' ),
) );
wp_localize_script(
'apostrophe-2-navigation',
'screenReaderText',
array(
'expand' => esc_html__( 'expand child menu', 'apostrophe-2' ),
'collapse' => esc_html__( 'collapse child menu', 'apostrophe-2' ),
)
);
}
add_action( 'wp_enqueue_scripts', 'apostrophe_2_scripts' );
@ -262,7 +292,7 @@ add_action( 'wp_enqueue_scripts', 'apostrophe_2_scripts' );
* Gutenberg Editor Styles
*/
function apostrophe_2_editor_styles() {
wp_enqueue_style( 'apostrophe-2-editor-block-style', get_template_directory_uri() . '/css/editor-blocks.css');
wp_enqueue_style( 'apostrophe-2-editor-block-style', get_template_directory_uri() . '/css/editor-blocks.css' );
wp_enqueue_style( 'apostrophe-2-fonts', apostrophe_2_fonts_url(), array(), null );
}
add_action( 'enqueue_block_editor_assets', 'apostrophe_2_editor_styles' );

View file

@ -18,7 +18,6 @@ if ( ! function_exists( 'balasana_setup' ) ) :
* as indicating support for post thumbnails.
*/
function balasana_setup() {
// Add child theme editor styles, compiled from `style-child-theme-editor.scss`.
add_editor_style( 'style-editor.css' );

View file

@ -18,7 +18,6 @@ if ( ! function_exists( 'barnsbury_setup' ) ) :
* as indicating support for post thumbnails.
*/
function barnsbury_setup() {
// Add child theme editor styles, compiled from `style-child-theme-editor.scss`.
add_editor_style( 'style-editor.css' );

View file

@ -18,6 +18,7 @@ if ( ! function_exists( 'blank_canvas_setup' ) ) :
* as indicating support for post thumbnails.
*/
function blank_canvas_setup() {
// Add support for editor styles.
add_theme_support( 'editor-styles' );

View file

@ -18,7 +18,6 @@ if ( ! function_exists( 'brompton_setup' ) ) :
* as indicating support for post thumbnails.
*/
function brompton_setup() {
// Add child theme editor styles, compiled from `style-child-theme-editor.scss`.
add_editor_style( 'style-editor.css' );

View file

@ -6,89 +6,104 @@
*/
if ( ! function_exists( 'button_2_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function button_2_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on button, use a find and replace
* to change 'button-2' to the name of your theme in all the template files
*/
load_theme_textdomain( 'button-2', get_template_directory() . '/languages' );
// 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 <title> 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.
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
add_theme_support( 'post-thumbnails' );
add_image_size( 'button-2-featured', '982', '9999' );
// This theme uses wp_nav_menu() in two locations.
register_nav_menus( array(
'menu-1' => esc_html__( 'Header', 'button-2' ),
) );
function button_2_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on button, use a find and replace
* to change 'button-2' to the name of your theme in all the template files
*/
load_theme_textdomain( 'button-2', get_template_directory() . '/languages' );
/*
* 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 custom logo.
add_theme_support( 'custom-logo', array(
'height' => 300,
'width' => 1200,
'flex-height' => true,
'flex-width' => true
) );
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'button_2_custom_background_args', array(
'default-color' => 'f8f8f8',
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/*
* We're using a unique filename for the background image
* to avoid users uploading a file with the same filename
* and avoiding conflict with the `user-background` body_class
* in inc/extras.php and assets/js/customizer.js
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
'default-image' => esc_url( get_template_directory_uri() ) . '/img/buttonbg20170303.png',
) ) );
/*
* 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( 'button-2-featured', '982', '9999' );
// Add support for wide images in Gutenberg
add_theme_support( 'align-wide' );
// This theme uses wp_nav_menu() in two locations.
register_nav_menus(
array(
'menu-1' => esc_html__( 'Header', 'button-2' ),
)
);
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
}
/*
* 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 custom logo.
add_theme_support(
'custom-logo',
array(
'height' => 300,
'width' => 1200,
'flex-height' => true,
'flex-width' => true,
)
);
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
// Set up the WordPress core custom background feature.
add_theme_support(
'custom-background',
apply_filters(
'button_2_custom_background_args',
array(
'default-color' => 'f8f8f8',
/*
* We're using a unique filename for the background image
* to avoid users uploading a file with the same filename
* and avoiding conflict with the `user-background` body_class
* in inc/extras.php and assets/js/customizer.js
*/
'default-image' => esc_url( get_template_directory_uri() ) . '/img/buttonbg20170303.png',
)
)
);
// Add support for wide images in Gutenberg
add_theme_support( 'align-wide' );
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
}
endif; // button_2_setup
add_action( 'after_setup_theme', 'button_2_setup' );
@ -122,39 +137,47 @@ add_action( 'template_redirect', 'button_2_adjusted_content_width', 0 );
* @link http://codex.wordpress.org/Function_Reference/register_sidebar
*/
function button_2_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'button-2' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 1', 'button-2' ),
'id' => 'sidebar-2',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 2', 'button-2' ),
'id' => 'sidebar-3',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 3', 'button-2' ),
'id' => 'sidebar-4',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Sidebar', 'button-2' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Footer 1', 'button-2' ),
'id' => 'sidebar-2',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Footer 2', 'button-2' ),
'id' => 'sidebar-3',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Footer 3', 'button-2' ),
'id' => 'sidebar-4',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
)
);
}
add_action( 'widgets_init', 'button_2_widgets_init' );
@ -184,9 +207,9 @@ add_action( 'wp_enqueue_scripts', 'button_2_scripts' );
* Register Google Fonts
*/
function button_2_fonts_url() {
$fonts_url = '';
$fonts_url = '';
/* Translators: If there are characters in your language that are not
/* 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.
*/

View file

@ -8,32 +8,31 @@
*/
if ( ! function_exists( 'calm_business_setup' ) ) {
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function calm_business_setup() {
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function calm_business_setup() {
/**
* Add support for core custom logo.
*
* @link https://codex.wordpress.org/Theme_Logo
*/
add_theme_support(
'custom-logo',
array(
'height' => 176,
'width' => 176,
'flex-width' => true,
'flex-height' => false,
'header-text' => array( 'site-title' ),
)
);
/**
* Add support for core custom logo.
*
* @link https://codex.wordpress.org/Theme_Logo
*/
add_theme_support(
'custom-logo',
array(
'height' => 176,
'width' => 176,
'flex-width' => true,
'flex-height' => false,
'header-text' => array( 'site-title' ),
)
);
// Editor color palette.
// Editor color palette.
add_theme_support(
'editor-color-palette',
array(
@ -64,7 +63,7 @@ if ( ! function_exists( 'calm_business_setup' ) ) {
),
)
);
}
}
} // calm_business_setup
add_action( 'after_setup_theme', 'calm_business_setup', 30 );
@ -123,4 +122,4 @@ require get_stylesheet_directory() . '/inc/jetpack.php';
/**
* Customizer additions.
*/
require get_stylesheet_directory() . '/inc/customizer.php';
require get_stylesheet_directory() . '/inc/customizer.php';

View file

@ -13,7 +13,6 @@ if ( ! isset( $content_width ) ) {
}
if ( ! function_exists( 'canard_content_width' ) ) {
function canard_content_width() {
global $content_width;
@ -21,112 +20,126 @@ if ( ! function_exists( 'canard_content_width' ) ) {
$content_width = 869;
}
}
}
add_action( 'template_redirect', 'canard_content_width' );
if ( ! function_exists( 'canard_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function canard_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Canard, use a find and replace
* to change 'canard' to the name of your theme in all the template files
*/
load_theme_textdomain( 'canard', get_template_directory() . '/languages' );
// 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 <title> 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.
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
add_theme_support( 'post-thumbnails' );
add_image_size( 'canard-post-thumbnail', 870, 773, true );
add_image_size( 'canard-featured-content-thumbnail', 915, 500, true );
add_image_size( 'canard-single-thumbnail', 1920, 768, true );
function canard_setup() {
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Canard, use a find and replace
* to change 'canard' to the name of your theme in all the template files
*/
load_theme_textdomain( 'canard', get_template_directory() . '/languages' );
// Add custom colors to Gutenberg
add_theme_support(
'editor-color-palette', array(
// 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 <title> 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( 'canard-post-thumbnail', 870, 773, true );
add_image_size( 'canard-featured-content-thumbnail', 915, 500, true );
add_image_size( 'canard-single-thumbnail', 1920, 768, true );
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
// Add custom colors to Gutenberg
add_theme_support(
'editor-color-palette',
array(
'name' => esc_html__( 'Black', 'canard' ),
'slug' => 'black',
'color' => '#222222',
),
array(
'name' => esc_html__( 'Dark Gray', 'canard' ),
'slug' => 'dark-gray',
'color' => '#555555',
),
array(
'name' => esc_html__( 'Medium Gray', 'canard' ),
'slug' => 'medium-gray',
'color' => '#777777',
),
array(
'name' => esc_html__( 'Light Gray', 'canard' ),
'slug' => 'light-gray',
'color' => '#dddddd',
),
array(
'name' => esc_html__( 'White', 'canard' ),
'slug' => 'white',
'color' => '#ffffff',
),
array(
'name' => esc_html__( 'Red', 'canard' ),
'slug' => 'red',
'color' => '#d11415',
array(
'name' => esc_html__( 'Black', 'canard' ),
'slug' => 'black',
'color' => '#222222',
),
array(
'name' => esc_html__( 'Dark Gray', 'canard' ),
'slug' => 'dark-gray',
'color' => '#555555',
),
array(
'name' => esc_html__( 'Medium Gray', 'canard' ),
'slug' => 'medium-gray',
'color' => '#777777',
),
array(
'name' => esc_html__( 'Light Gray', 'canard' ),
'slug' => 'light-gray',
'color' => '#dddddd',
),
array(
'name' => esc_html__( 'White', 'canard' ),
'slug' => 'white',
'color' => '#ffffff',
),
array(
'name' => esc_html__( 'Red', 'canard' ),
'slug' => 'red',
'color' => '#d11415',
),
)
)
);
);
// This theme uses wp_nav_menu() in four locations.
register_nav_menus( array(
'primary' => __( 'Primary Location', 'canard' ),
'secondary' => __( 'Secondary Location', 'canard' ),
'footer' => __( 'Footer Location', 'canard' ),
'social' => __( 'Social Location', 'canard' ),
) );
// This theme uses wp_nav_menu() in four locations.
register_nav_menus(
array(
'primary' => __( 'Primary Location', 'canard' ),
'secondary' => __( 'Secondary Location', 'canard' ),
'footer' => __( 'Footer Location', 'canard' ),
'social' => __( 'Social Location', 'canard' ),
)
);
/*
* 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',
) );
/*
* 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(
'image', 'link', 'gallery',
) );
}
/*
* Enable support for Post Formats.
* See http://codex.wordpress.org/Post_Formats
*/
add_theme_support(
'post-formats',
array(
'image',
'link',
'gallery',
)
);
}
endif; // canard_setup
add_action( 'after_setup_theme', 'canard_setup' );
@ -136,25 +149,29 @@ add_action( 'after_setup_theme', 'canard_setup' );
* @link http://codex.wordpress.org/Function_Reference/register_sidebar
*/
function canard_widgets_init() {
register_sidebar( array(
'name' => __( 'Sidebar', 'canard' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => __( 'Sidebar', 'canard' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => __( 'Footer', 'canard' ),
'id' => 'sidebar-2',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => __( 'Footer', 'canard' ),
'id' => 'sidebar-2',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
}
add_action( 'widgets_init', 'canard_widgets_init' );
@ -191,7 +208,7 @@ function canard_lato_inconsolata_fonts_url() {
'family' => urlencode( implode( '|', $font_families ) ),
'subset' => urlencode( 'latin,latin-ext' ),
);
$fonts_url = add_query_arg( $query_args, "https://fonts.googleapis.com/css" );
$fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
}
return $fonts_url;
@ -230,7 +247,7 @@ function canard_pt_serif_playfair_display_font_url() {
'family' => urlencode( implode( '|', $font_families ) ),
'subset' => urlencode( 'cyrillic,latin,latin-ext' ),
);
$fonts_url = add_query_arg( $query_args, "https://fonts.googleapis.com/css" );
$fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
}
return $fonts_url;
@ -288,7 +305,7 @@ add_action( 'wp_enqueue_scripts', 'canard_scripts' );
* Gutenberg Editor Styles
*/
function canard_editor_styles() {
wp_enqueue_style( 'canard-editor-block-style', get_template_directory_uri() . '/editor-blocks.css');
wp_enqueue_style( 'canard-editor-block-style', get_template_directory_uri() . '/editor-blocks.css' );
wp_enqueue_style( 'canard-pt-serif-playfair-display', canard_pt_serif_playfair_display_font_url() );
wp_enqueue_style( 'canard-lato-inconsolata', canard_lato_inconsolata_fonts_url() );
wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.3' );

View file

@ -18,7 +18,6 @@ if ( ! function_exists( 'coutoire_setup' ) ) :
* as indicating support for post thumbnails.
*/
function coutoire_setup() {
// Add child theme editor styles, compiled from `style-child-theme-editor.scss`.
add_editor_style( 'style-editor.css' );

View file

@ -18,7 +18,6 @@ if ( ! function_exists( 'dalston_setup' ) ) :
* as indicating support for post thumbnails.
*/
function dalston_setup() {
// Add child theme editor styles, compiled from `style-child-theme-editor.scss`.
add_editor_style( 'style-editor.css' );

View file

@ -8,134 +8,148 @@
*/
if ( ! function_exists( 'dara_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function dara_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on components, use a find and replace
* to change 'dara' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'dara', get_template_directory() . '/languages' );
// 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 <title> 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.
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function dara_setup() {
add_theme_support( 'post-thumbnails' );
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on components, use a find and replace
* to change 'dara' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'dara', get_template_directory() . '/languages' );
// Post thumbnails
add_image_size( 'dara-featured-image', 880, 312, true );
// Hero Image on the front page slider
add_image_size( 'dara-hero-thumbnail', 1180, 600, true );
// Full width and grid page template
add_image_size( 'dara-page-thumbnail', 1180, 435, true );
// Grid child page thumbnail
add_image_size( 'dara-grid-thumbnail', 360, 242, true );
// Testimonial thumbnail
add_image_size( 'dara-testimonial-thumbnail', 180, 180, true );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
// Add custom colors to Gutenberg
add_theme_support(
'editor-color-palette', array(
/*
* 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' );
// Post thumbnails
add_image_size( 'dara-featured-image', 880, 312, true );
// Hero Image on the front page slider
add_image_size( 'dara-hero-thumbnail', 1180, 600, true );
// Full width and grid page template
add_image_size( 'dara-page-thumbnail', 1180, 435, true );
// Grid child page thumbnail
add_image_size( 'dara-grid-thumbnail', 360, 242, true );
// Testimonial thumbnail
add_image_size( 'dara-testimonial-thumbnail', 180, 180, true );
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
// Add custom colors to Gutenberg
add_theme_support(
'editor-color-palette',
array(
'name' => esc_html__( 'Black', 'dara' ),
'slug' => 'black',
'color' => '#404040',
),
array(
'name' => esc_html__( 'Dark Gray', 'dara' ),
'slug' => 'dark-gray',
'color' => '#444340',
),
array(
'name' => esc_html__( 'Medium Gray', 'dara' ),
'slug' => 'medium-gray',
'color' => '#a8a6a1',
),
array(
'name' => esc_html__( 'Light Gray', 'dara' ),
'slug' => 'light-gray',
'color' => '#e6e6e6',
),
array(
'name' => esc_html__( 'White', 'dara' ),
'slug' => 'white',
'color' => '#ffffff',
),
array(
'name' => esc_html__( 'Blue', 'dara' ),
'slug' => 'blue',
'color' => '#15b6b8',
),
array(
'name' => esc_html__( 'Dark Blue', 'dara' ),
'slug' => 'dark-blue',
'color' => '#0c8384',
array(
'name' => esc_html__( 'Black', 'dara' ),
'slug' => 'black',
'color' => '#404040',
),
array(
'name' => esc_html__( 'Dark Gray', 'dara' ),
'slug' => 'dark-gray',
'color' => '#444340',
),
array(
'name' => esc_html__( 'Medium Gray', 'dara' ),
'slug' => 'medium-gray',
'color' => '#a8a6a1',
),
array(
'name' => esc_html__( 'Light Gray', 'dara' ),
'slug' => 'light-gray',
'color' => '#e6e6e6',
),
array(
'name' => esc_html__( 'White', 'dara' ),
'slug' => 'white',
'color' => '#ffffff',
),
array(
'name' => esc_html__( 'Blue', 'dara' ),
'slug' => 'blue',
'color' => '#15b6b8',
),
array(
'name' => esc_html__( 'Dark Blue', 'dara' ),
'slug' => 'dark-blue',
'color' => '#0c8384',
),
)
)
);
);
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'menu-1' => esc_html__( 'Header', 'dara' ),
) );
// This theme uses wp_nav_menu() in one location.
register_nav_menus(
array(
'menu-1' => esc_html__( 'Header', 'dara' ),
)
);
/*
* 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',
) );
/*
* 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 selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'dara_custom_background_args', array(
'default-color' => '444340',
) ) );
// Set up the WordPress core custom background feature.
add_theme_support(
'custom-background',
apply_filters(
'dara_custom_background_args',
array(
'default-color' => '444340',
)
)
);
// Add theme support for custom logos
add_theme_support( 'custom-logo',
array(
'width' => 1200,
'height' => 300,
'flex-width' => true,
'flex-height' => true,
)
);
// Add theme support for custom logos
add_theme_support(
'custom-logo',
array(
'width' => 1200,
'height' => 300,
'flex-width' => true,
'flex-height' => true,
)
);
// Add theme support for excerpts on pages
add_post_type_support( 'page', 'excerpt' );
}
// Add theme support for excerpts on pages
add_post_type_support( 'page', 'excerpt' );
}
endif;
add_action( 'after_setup_theme', 'dara_setup' );
@ -190,12 +204,12 @@ function dara_fonts_url() {
/* 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.
*/
$source_sans_pro = esc_html_x( 'on', 'Source Sans Pro font: on or off', 'dara' );
$source_sans_pro = esc_html_x( 'on', 'Source Sans Pro font: on or off', 'dara' );
/* translators: If there are characters in your language that are not supported
* by Yrsa, translate this to 'off'. Do not translate into your own language.
*/
$yrsa = esc_html_x( 'on', 'Yrsa font: on or off', 'dara' );
$yrsa = esc_html_x( 'on', 'Yrsa font: on or off', 'dara' );
if ( 'off' !== $source_sans_pro || 'off' !== $merriweather || 'off' !== $Yrsa ) {
$font_families = array();
@ -210,7 +224,7 @@ function dara_fonts_url() {
'family' => urlencode( implode( '|', $font_families ) ),
'subset' => urlencode( 'latin,latin-ext' ),
);
$fonts_url = add_query_arg( $query_args, "https://fonts.googleapis.com/css" );
$fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
}
return $fonts_url;
@ -222,38 +236,46 @@ function dara_fonts_url() {
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function dara_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'dara' ),
'id' => 'sidebar-1',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 1', 'dara' ),
'id' => 'sidebar-2',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 2', 'dara' ),
'id' => 'sidebar-3',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 3', 'dara' ),
'id' => 'sidebar-4',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Sidebar', 'dara' ),
'id' => 'sidebar-1',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Footer 1', 'dara' ),
'id' => 'sidebar-2',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Footer 2', 'dara' ),
'id' => 'sidebar-3',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Footer 3', 'dara' ),
'id' => 'sidebar-4',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
)
);
}
add_action( 'widgets_init', 'dara_widgets_init' );
@ -279,7 +301,7 @@ function dara_scripts() {
}
// If there's an active Video widget, and it's (hopefully) in the footer widget area
if ( is_active_widget( '','', 'media_video' ) && ( is_active_sidebar( 'sidebar-2' ) || is_active_sidebar( 'sidebar-3' ) || is_active_sidebar( 'sidebar-4' ) ) ) {
if ( is_active_widget( '', '', 'media_video' ) && ( is_active_sidebar( 'sidebar-2' ) || is_active_sidebar( 'sidebar-3' ) || is_active_sidebar( 'sidebar-4' ) ) ) {
wp_enqueue_script( 'dara-video', get_template_directory_uri() . '/assets/js/video-widget.js', array( 'jquery' ), '20170608', true );
}
@ -295,19 +317,19 @@ add_action( 'wp_enqueue_scripts', 'dara_scripts' );
* Gutenberg Editor Styles
*/
function dara_editor_styles() {
wp_enqueue_style( 'dara-editor-block-style', get_template_directory_uri() . '/editor-blocks.css');
wp_enqueue_style( 'dara-editor-block-style', get_template_directory_uri() . '/editor-blocks.css' );
wp_enqueue_style( 'dara-fonts', dara_fonts_url() );
wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.3' );
}
add_action( 'enqueue_block_editor_assets', 'dara_editor_styles' );
if ( ! function_exists( 'dara_continue_reading_link' ) ) :
/**
* Returns an ellipsis and "Continue reading" plus off-screen title link for excerpts
*/
function dara_continue_reading_link() {
return '&hellip; <a href="'. esc_url( get_permalink() ) . '" class="more-link">' . sprintf( __( 'Continue reading <span class="screen-reader-text">%1$s</span>', 'dara' ), esc_attr( strip_tags( get_the_title() ) ) ) . '</a>';
}
/**
* Returns an ellipsis and "Continue reading" plus off-screen title link for excerpts
*/
function dara_continue_reading_link() {
return '&hellip; <a href="' . esc_url( get_permalink() ) . '" class="more-link">' . sprintf( __( 'Continue reading <span class="screen-reader-text">%1$s</span>', 'dara' ), esc_attr( strip_tags( get_the_title() ) ) ) . '</a>';
}
endif; // dara_continue_reading_link
/**

View file

@ -14,6 +14,7 @@ if ( ! function_exists( 'dyad_2_setup' ) ) :
* as indicating support for post thumbnails.
*/
function dyad_2_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
@ -36,22 +37,27 @@ if ( ! function_exists( 'dyad_2_setup' ) ) :
/**
* Add custom logo support
*/
add_theme_support( 'custom-logo', array(
'height' => 300,
'width' => 600,
'flex-width' => true,
'header-text' => array(
'site-title',
'site-description',
),
) );
add_theme_support(
'custom-logo',
array(
'height' => 300,
'width' => 600,
'flex-width' => true,
'header-text' => array(
'site-title',
'site-description',
),
)
);
/*
* Register menus
*/
register_nav_menus( array(
'menu-1' => esc_html__( 'Primary Menu', 'dyad-2' ),
) );
register_nav_menus(
array(
'menu-1' => esc_html__( 'Primary Menu', 'dyad-2' ),
)
);
/*
* Add Post Format support
@ -76,12 +82,15 @@ if ( ! function_exists( 'dyad_2_setup' ) ) :
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'search-form',
'comment-form',
'gallery',
'caption',
) );
add_theme_support(
'html5',
array(
'search-form',
'comment-form',
'gallery',
'caption',
)
);
// Load default block styles.
add_theme_support( 'wp-block-styles' );
@ -100,43 +109,46 @@ if ( ! function_exists( 'dyad_2_setup' ) ) :
add_editor_style( dyad_2_fonts_url() );
// Add support for custom color scheme.
add_theme_support( 'editor-color-palette', array(
add_theme_support(
'editor-color-palette',
array(
'name' => esc_html__( 'Bright Blue', 'dyad-2' ),
'slug' => 'bright-blue',
'color' => '#678db8',
),
array(
'name' => esc_html__( 'Yellow', 'dyad-2' ),
'slug' => 'yellow',
'color' => '#e7ae01',
),
array(
'name' => esc_html__( 'Light Gray-Blue', 'dyad-2' ),
'slug' => 'light-gray-blue',
'color' => '#abb7c3',
),
array(
'name' => esc_html__( 'Medium Gray', 'dyad-2' ),
'slug' => 'medium-gray',
'color' => '#6a6c6e',
),
array(
'name' => esc_html__( 'Dark Gray', 'dyad-2' ),
'slug' => 'dark-gray',
'color' => '#1a1c1e',
),
array(
'name' => esc_html__( 'Dark Gray-Blue', 'dyad-2' ),
'slug' => 'dark-gray-blue',
'color' => '#292c2f',
),
array(
'name' => esc_html__( 'White', 'dyad-2' ),
'slug' => 'white',
'color' => '#fff',
),
) );
array(
'name' => esc_html__( 'Bright Blue', 'dyad-2' ),
'slug' => 'bright-blue',
'color' => '#678db8',
),
array(
'name' => esc_html__( 'Yellow', 'dyad-2' ),
'slug' => 'yellow',
'color' => '#e7ae01',
),
array(
'name' => esc_html__( 'Light Gray-Blue', 'dyad-2' ),
'slug' => 'light-gray-blue',
'color' => '#abb7c3',
),
array(
'name' => esc_html__( 'Medium Gray', 'dyad-2' ),
'slug' => 'medium-gray',
'color' => '#6a6c6e',
),
array(
'name' => esc_html__( 'Dark Gray', 'dyad-2' ),
'slug' => 'dark-gray',
'color' => '#1a1c1e',
),
array(
'name' => esc_html__( 'Dark Gray-Blue', 'dyad-2' ),
'slug' => 'dark-gray-blue',
'color' => '#292c2f',
),
array(
'name' => esc_html__( 'White', 'dyad-2' ),
'slug' => 'white',
'color' => '#fff',
),
)
);
}
endif; // dyad_2_setup
@ -174,15 +186,17 @@ add_filter( 'excerpt_more', 'dyad_2_excerpt_continue_reading' );
* @link http://codex.wordpress.org/Function_Reference/register_sidebar
*/
function dyad_2_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Footer', 'dyad-2' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Displays in footer area.', 'dyad-2' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Footer', 'dyad-2' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Displays in footer area.', 'dyad-2' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
)
);
}
add_action( 'widgets_init', 'dyad_2_widgets_init' );
@ -194,12 +208,12 @@ add_action( 'widgets_init', 'dyad_2_widgets_init' );
* @return integer number of widgets in the sidebar
*/
function dyad_2_count_widgets( $id ) {
$count = 0;
$count = 0;
$sidebars_widgets = wp_get_sidebars_widgets();
if ( array_key_exists( $id, $sidebars_widgets ) ) {
foreach ( ( array ) $sidebars_widgets[$id] as $value ) {
foreach ( (array) $sidebars_widgets[ $id ] as $value ) {
// Don't count the Cookies or Mailchimp widgets, since they're not visible in the widget area.
if ( strpos( $value, 'eu_cookie_law_widget' ) === false && strpos( $value, 'widget_mailchimp_subscriber_popup' ) === false ) {
$count++;
@ -235,7 +249,7 @@ function dyad_2_widget_column_class( $widget_id ) {
* Wrap avatars in div for easier styling
*/
function dyad_2_get_avatar( $avatar ) {
if( ! is_admin() ) {
if ( ! is_admin() ) {
$avatar = '<span class="avatar-container">' . $avatar . '</span>';
}
return $avatar;

View file

@ -8,63 +8,62 @@
*/
if ( ! function_exists( 'elegant_business_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function elegant_business_setup() {
/**
* Add support for core custom logo.
* Sets up theme defaults and registers support for various WordPress features.
*
* @link https://codex.wordpress.org/Theme_Logo
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
add_theme_support(
'custom-logo',
array(
'height' => 128,
'width' => 190,
'flex-width' => true,
'flex-height' => false,
'header-text' => array( 'site-title' ),
)
);
function elegant_business_setup() {
/**
* Add support for core custom logo.
*
* @link https://codex.wordpress.org/Theme_Logo
*/
add_theme_support(
'custom-logo',
array(
'height' => 128,
'width' => 190,
'flex-width' => true,
'flex-height' => false,
'header-text' => array( 'site-title' ),
)
);
// Editor color palette.
add_theme_support(
'editor-color-palette',
array(
// Editor color palette.
add_theme_support(
'editor-color-palette',
array(
'name' => __( 'Primary', 'elegant-business' ),
'slug' => 'primary',
'color' => '#c43d80', // $color__link
),
array(
'name' => __( 'Secondary', 'elegant-business' ),
'slug' => 'secondary',
'color' => '#9e3067', // $color__border-link-hover
),
array(
'name' => __( 'Dark Gray', 'elegant-business' ),
'slug' => 'dark-gray',
'color' => '#111111', // $color__text-main
),
array(
'name' => __( 'Light Gray', 'elegant-business' ),
'slug' => 'light-gray',
'color' => '#767676', // $color__text-light
),
array(
'name' => __( 'White', 'elegant-business' ),
'slug' => 'white',
'color' => '#ffffff',
),
)
);
}
array(
'name' => __( 'Primary', 'elegant-business' ),
'slug' => 'primary',
'color' => '#c43d80', // $color__link
),
array(
'name' => __( 'Secondary', 'elegant-business' ),
'slug' => 'secondary',
'color' => '#9e3067', // $color__border-link-hover
),
array(
'name' => __( 'Dark Gray', 'elegant-business' ),
'slug' => 'dark-gray',
'color' => '#111111', // $color__text-main
),
array(
'name' => __( 'Light Gray', 'elegant-business' ),
'slug' => 'light-gray',
'color' => '#767676', // $color__text-light
),
array(
'name' => __( 'White', 'elegant-business' ),
'slug' => 'white',
'color' => '#ffffff',
),
)
);
}
endif; // elegant_business_setup
add_action( 'after_setup_theme', 'elegant_business_setup', 30 );

View file

@ -18,7 +18,6 @@ if ( ! function_exists( 'exford_setup' ) ) :
* as indicating support for post thumbnails.
*/
function exford_setup() {
// Add child theme editor styles, compiled from `style-child-theme-editor.scss`.
add_editor_style( 'style-editor.css' );

View file

@ -8,64 +8,63 @@
*/
if ( ! function_exists( 'friendly_business_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function friendly_business_setup() {
/**
* Add support for core custom logo.
* Sets up theme defaults and registers support for various WordPress features.
*
* @link https://codex.wordpress.org/Theme_Logo
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
add_theme_support(
'custom-logo',
array(
'height' => 180,
'width' => 180,
'flex-width' => true,
'flex-height' => false,
'header-text' => array( 'site-title' ),
)
);
function friendly_business_setup() {
/**
* Add support for core custom logo.
*
* @link https://codex.wordpress.org/Theme_Logo
*/
add_theme_support(
'custom-logo',
array(
'height' => 180,
'width' => 180,
'flex-width' => true,
'flex-height' => false,
'header-text' => array( 'site-title' ),
)
);
// Editor color palette.
add_theme_support(
'editor-color-palette',
array(
// Editor color palette.
add_theme_support(
'editor-color-palette',
array(
'name' => __( 'Primary', 'friendly-business' ),
'slug' => 'primary',
'color' => '#20603c', // $color__link
),
array(
'name' => __( 'Secondary', 'friendly-business' ),
'slug' => 'secondary',
'color' => '#133a24', // $color__border-link-hover
),
array(
'name' => __( 'Dark Gray', 'friendly-business' ),
'slug' => 'dark-gray',
'color' => '#3c2323', // $color__text-main
),
array(
'name' => __( 'Light Gray', 'friendly-business' ),
'slug' => 'light-gray',
'color' => '#0d1b24', // $color__text-dark
),
array(
'name' => __( 'Primary', 'friendly-business' ),
'slug' => 'primary',
'color' => '#20603c', // $color__link
),
array(
'name' => __( 'Secondary', 'friendly-business' ),
'slug' => 'secondary',
'color' => '#133a24', // $color__border-link-hover
),
array(
'name' => __( 'Dark Gray', 'friendly-business' ),
'slug' => 'dark-gray',
'color' => '#3c2323', // $color__text-main
),
array(
'name' => __( 'Light Gray', 'friendly-business' ),
'slug' => 'light-gray',
'color' => '#0d1b24', // $color__text-dark
),
array(
'name' => __( 'White', 'friendly-business' ),
'slug' => 'white',
'color' => '#ffffff',
),
)
);
}
array(
'name' => __( 'White', 'friendly-business' ),
'slug' => 'white',
'color' => '#ffffff',
),
)
);
}
endif; // friendly_business_setup
add_action( 'after_setup_theme', 'friendly_business_setup', 30 );

View file

@ -13,7 +13,6 @@ if ( ! isset( $content_width ) ) {
}
if ( ! function_exists( 'gazette_content_width' ) ) {
function gazette_content_width() {
global $content_width;
@ -21,104 +20,121 @@ if ( ! function_exists( 'gazette_content_width' ) ) {
$content_width = 869;
}
}
}
add_action( 'template_redirect', 'gazette_content_width' );
if ( ! function_exists( 'gazette_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function gazette_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Gazette, use a find and replace
* to change 'gazette' to the name of your theme in all the template files
*/
load_theme_textdomain( 'gazette', get_template_directory() . '/languages' );
// 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 <title> 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.
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
add_theme_support( 'post-thumbnails' );
add_image_size( 'gazette-post-thumbnail', 720, 426, true );
add_image_size( 'gazette-post-thumbnail-square', 720, 720, true );
add_image_size( 'gazette-featured-content-thumbnail', 960, 540, true );
add_image_size( 'gazette-single-thumbnail', 1920, 768, true );
function gazette_setup() {
// This theme uses wp_nav_menu() in two locations.
register_nav_menus( array(
'primary' => __( 'Primary Location', 'gazette' ),
'social' => __( 'Social Location', 'gazette' ),
) );
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Gazette, use a find and replace
* to change 'gazette' to the name of your theme in all the template files
*/
load_theme_textdomain( 'gazette', get_template_directory() . '/languages' );
/*
* 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 default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/*
* Enable support for Post Formats.
* See http://codex.wordpress.org/Post_Formats
*/
add_theme_support( 'post-formats', array(
'image', 'video', 'link', 'gallery',
) );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
/*
* 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( 'gazette-post-thumbnail', 720, 426, true );
add_image_size( 'gazette-post-thumbnail-square', 720, 720, true );
add_image_size( 'gazette-featured-content-thumbnail', 960, 540, true );
add_image_size( 'gazette-single-thumbnail', 1920, 768, true );
// Add support for custom color scheme.
add_theme_support( 'editor-color-palette', array(
array(
'name' => esc_html__( 'Blue', 'gazette' ),
'slug' => 'blue',
'color' => '#3863c1',
),
array(
'name' => esc_html__( 'Dark Gray', 'gazette' ),
'slug' => 'dark-gray',
'color' => '#222',
),
array(
'name' => esc_html__( 'Medium Gray', 'gazette' ),
'slug' => 'medium-gray',
'color' => '#777',
),
array(
'name' => esc_html__( 'Light Gray', 'gazette' ),
'slug' => 'light-gray',
'color' => '#ddd',
),
array(
'name' => esc_html__( 'White', 'gazette' ),
'slug' => 'white',
'color' => '#fff',
),
) );
}
// This theme uses wp_nav_menu() in two locations.
register_nav_menus(
array(
'primary' => __( 'Primary Location', 'gazette' ),
'social' => __( 'Social Location', 'gazette' ),
)
);
/*
* 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(
'image',
'video',
'link',
'gallery',
)
);
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
// Add support for custom color scheme.
add_theme_support(
'editor-color-palette',
array(
array(
'name' => esc_html__( 'Blue', 'gazette' ),
'slug' => 'blue',
'color' => '#3863c1',
),
array(
'name' => esc_html__( 'Dark Gray', 'gazette' ),
'slug' => 'dark-gray',
'color' => '#222',
),
array(
'name' => esc_html__( 'Medium Gray', 'gazette' ),
'slug' => 'medium-gray',
'color' => '#777',
),
array(
'name' => esc_html__( 'Light Gray', 'gazette' ),
'slug' => 'light-gray',
'color' => '#ddd',
),
array(
'name' => esc_html__( 'White', 'gazette' ),
'slug' => 'white',
'color' => '#fff',
),
)
);
}
endif; // gazette_setup
add_action( 'after_setup_theme', 'gazette_setup' );
@ -128,25 +144,29 @@ add_action( 'after_setup_theme', 'gazette_setup' );
* @link http://codex.wordpress.org/Function_Reference/register_sidebar
*/
function gazette_widgets_init() {
register_sidebar( array(
'name' => __( 'Sidebar', 'gazette' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => __( 'Sidebar', 'gazette' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => __( 'Footer', 'gazette' ),
'id' => 'sidebar-2',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => __( 'Footer', 'gazette' ),
'id' => 'sidebar-2',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
}
add_action( 'widgets_init', 'gazette_widgets_init' );
@ -183,7 +203,7 @@ function gazette_lato_inconsolata_fonts_url() {
'family' => urlencode( implode( '|', $font_families ) ),
'subset' => urlencode( 'latin,latin-ext' ), // add extra subset
);
$fonts_url = add_query_arg( $query_args, "https://fonts.googleapis.com/css" );
$fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
}
return $fonts_url;

View file

@ -22,7 +22,6 @@ if ( ! function_exists( 'varia_default_colors' ) ) {
}
if ( ! function_exists( 'hever_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*

View file

@ -68,4 +68,4 @@ function ibis_enqueue() {
wp_enqueue_style( 'mayland-fonts', ibis_fonts_url(), array(), null );
}
add_action( 'wp_enqueue_scripts', 'ibis_enqueue' );
add_action( 'wp_enqueue_scripts', 'ibis_enqueue' );

View file

@ -13,140 +13,151 @@ if ( ! isset( $content_width ) ) {
}
if ( ! function_exists( 'illustratr_content_width' ) ) :
/**
* Adjust the content width for image post format and single portfolio.
*/
function illustratr_content_width() {
global $content_width;
if ( 'image' == get_post_format() || ( is_singular() && 'jetpack-portfolio' == get_post_type() ) ) {
$content_width = 1100;
/**
* Adjust the content width for image post format and single portfolio.
*/
function illustratr_content_width() {
global $content_width;
if ( 'image' == get_post_format() || ( is_singular() && 'jetpack-portfolio' == get_post_type() ) ) {
$content_width = 1100;
}
}
}
endif;
add_action( 'template_redirect', 'illustratr_content_width' );
if ( ! function_exists( 'illustratr_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function illustratr_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Illustratr, use a find and replace
* to change 'illustratr' to the name of your theme in all the template files
*/
load_theme_textdomain( 'illustratr', get_template_directory() . '/languages' );
// 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 <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
/**
* Editor styles.
*/
add_editor_style( 'editor-style.css' );
/**
* Responsive embeds
*/
add_theme_support( 'responsive-embeds' );
/**
* Gutenberg wide and full images support
*/
add_theme_support( 'align-wide' );
// Add custom colors to Gutenberg
add_theme_support(
'editor-color-palette', array(
array(
'name' => esc_html__( 'Black', 'illustratr' ),
'slug' => 'black',
'color' => '#24282d',
),
array(
'name' => esc_html__( 'Dark Gray', 'illustratr' ),
'slug' => 'dark-gray',
'color' => '#464d4d',
),
array(
'name' => esc_html__( 'Medium Gray', 'illustratr' ),
'slug' => 'medium-gray',
'color' => '#7f8d8c',
),
array(
'name' => esc_html__( 'Light Gray', 'illustratr' ),
'slug' => 'light-gray',
'color' => '#f1f2f3',
),
array(
'name' => esc_html__( 'White', 'illustratr' ),
'slug' => 'white',
'color' => '#ffffff',
),
array(
'name' => esc_html__( 'Red', 'illustratr' ),
'slug' => 'red',
'color' => '#e06d5e',
),
array(
'name' => esc_html__( 'Dark Red', 'illustratr' ),
'slug' => 'dark-red',
'color' => '#b44738',
)
)
);
/*
* Enable support for Post Thumbnails on posts and pages.
* Sets up theme defaults and registers support for various WordPress features.
*
* @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 400, 300, true );
add_image_size( 'illustratr-featured-image', 1100, 500, true );
add_image_size( 'illustratr-portfolio-featured-image', 800, 9999 );
function illustratr_setup() {
// This theme uses wp_nav_menu() in two locations.
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'illustratr' ),
'social' => __( 'Social Menu', 'illustratr' ),
) );
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Illustratr, use a find and replace
* to change 'illustratr' to the name of your theme in all the template files
*/
load_theme_textdomain( 'illustratr', get_template_directory() . '/languages' );
// Enable support for Post Formats.
add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link', 'gallery', 'status', 'audio' ) );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
// Setup the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'illustratr_custom_background_args', array(
'default-color' => '24282d',
'default-image' => '',
) ) );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
// Enable support for HTML5 markup.
add_theme_support( 'html5', array(
'comment-list',
'search-form',
'comment-form',
'gallery',
) );
/**
* Editor styles.
*/
add_editor_style( 'editor-style.css' );
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
}
/**
* Responsive embeds
*/
add_theme_support( 'responsive-embeds' );
/**
* Gutenberg wide and full images support
*/
add_theme_support( 'align-wide' );
// Add custom colors to Gutenberg
add_theme_support(
'editor-color-palette',
array(
array(
'name' => esc_html__( 'Black', 'illustratr' ),
'slug' => 'black',
'color' => '#24282d',
),
array(
'name' => esc_html__( 'Dark Gray', 'illustratr' ),
'slug' => 'dark-gray',
'color' => '#464d4d',
),
array(
'name' => esc_html__( 'Medium Gray', 'illustratr' ),
'slug' => 'medium-gray',
'color' => '#7f8d8c',
),
array(
'name' => esc_html__( 'Light Gray', 'illustratr' ),
'slug' => 'light-gray',
'color' => '#f1f2f3',
),
array(
'name' => esc_html__( 'White', 'illustratr' ),
'slug' => 'white',
'color' => '#ffffff',
),
array(
'name' => esc_html__( 'Red', 'illustratr' ),
'slug' => 'red',
'color' => '#e06d5e',
),
array(
'name' => esc_html__( 'Dark Red', 'illustratr' ),
'slug' => 'dark-red',
'color' => '#b44738',
),
)
);
/*
* 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' );
set_post_thumbnail_size( 400, 300, true );
add_image_size( 'illustratr-featured-image', 1100, 500, true );
add_image_size( 'illustratr-portfolio-featured-image', 800, 9999 );
// This theme uses wp_nav_menu() in two locations.
register_nav_menus(
array(
'primary' => __( 'Primary Menu', 'illustratr' ),
'social' => __( 'Social Menu', 'illustratr' ),
)
);
// Enable support for Post Formats.
add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link', 'gallery', 'status', 'audio' ) );
// Setup the WordPress core custom background feature.
add_theme_support(
'custom-background',
apply_filters(
'illustratr_custom_background_args',
array(
'default-color' => '24282d',
'default-image' => '',
)
)
);
// Enable support for HTML5 markup.
add_theme_support(
'html5',
array(
'comment-list',
'search-form',
'comment-form',
'gallery',
)
);
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
}
endif; // illustratr_setup
add_action( 'after_setup_theme', 'illustratr_setup' );
@ -154,15 +165,17 @@ add_action( 'after_setup_theme', 'illustratr_setup' );
* Register widgetized area and update sidebar with default widgets.
*/
function illustratr_widgets_init() {
register_sidebar( array(
'name' => __( 'Footer', 'illustratr' ),
'id' => 'sidebar-1',
'description' => __( 'Hidden footer area that is revealed by the + button at the bottom of each page', 'illustratr' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
) );
register_sidebar(
array(
'name' => __( 'Footer', 'illustratr' ),
'id' => 'sidebar-1',
'description' => __( 'Hidden footer area that is revealed by the + button at the bottom of each page', 'illustratr' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
)
);
}
add_action( 'widgets_init', 'illustratr_widgets_init' );
@ -295,7 +308,7 @@ add_action( 'wp_enqueue_scripts', 'illustratr_scripts' );
* Gutenberg Editor Styles
*/
function apostrophe_2_editor_styles() {
wp_enqueue_style( 'illustratr-editor-block-style', get_template_directory_uri() . '/editor-blocks.css');
wp_enqueue_style( 'illustratr-editor-block-style', get_template_directory_uri() . '/editor-blocks.css' );
wp_enqueue_style( 'illustratr-source-sans-pro', illustratr_source_sans_pro_font_url(), array(), null );
wp_enqueue_style( 'illustratr-pt-serif', illustratr_pt_serif_font_url(), array(), null );
wp_enqueue_style( 'illustratr-source-code-pro', illustratr_source_code_pro_font_url(), array(), null );

View file

@ -6,138 +6,155 @@
*/
if ( ! function_exists( 'independent_publisher_2_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function independent_publisher_2_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Independent Publisher 2, use a find and replace
* to change 'independent-publisher-2' to the name of your theme in all the template files
*/
load_theme_textdomain( 'independent-publisher-2', get_template_directory() . '/languages' );
// 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 <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
add_theme_support( 'customize_selective_refresh_widgets' );
/*
* 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' );
set_post_thumbnail_size( 740, 430, true );
add_image_size( 'independent-publisher-2-banner', 1440, 600, true );
add_image_size( 'independent-publisher-2-full-width', 1100, 9999 );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'menu-1' => esc_html__( 'Header', 'independent-publisher-2' ),
) );
/**
* Add custom logo support
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
add_theme_support( 'custom-logo', array(
'height' => 300,
'width' => 1500,
'flex-width' => true,
) );
/*
* 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',
) );
function independent_publisher_2_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Independent Publisher 2, use a find and replace
* to change 'independent-publisher-2' to the name of your theme in all the template files
*/
load_theme_textdomain( 'independent-publisher-2', get_template_directory() . '/languages' );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'independent_publisher_2_custom_background_args', array(
'default-color' => 'ffffff',
) ) );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
// Load regular editor styles into the new block-based editor.
add_theme_support( 'editor-styles' );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
// Add support for Block Styles.
add_theme_support( 'wp-block-styles' );
add_theme_support( 'customize_selective_refresh_widgets' );
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
/*
* 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' );
set_post_thumbnail_size( 740, 430, true );
add_image_size( 'independent-publisher-2-banner', 1440, 600, true );
add_image_size( 'independent-publisher-2-full-width', 1100, 9999 );
// Add support for full and wide align images.
add_theme_support( 'align-wide' );
// This theme uses wp_nav_menu() in one location.
register_nav_menus(
array(
'menu-1' => esc_html__( 'Header', 'independent-publisher-2' ),
)
);
// Add support for custom color scheme.
add_theme_support( 'editor-color-palette', array(
array(
'name' => __( 'Medium Blue', 'independent-publisher-2' ),
'slug' => 'medium-blue',
'color' => '#0087be',
),
array(
'name' => __( 'Bright Blue', 'independent-publisher-2' ),
'slug' => 'bright-blue',
'color' => '#00aadc',
),
array(
'name' => __( 'Dark Gray', 'independent-publisher-2' ),
'slug' => 'dark-gray',
'color' => '#4d4d4b',
),
array(
'name' => __( 'Light Gray', 'independent-publisher-2' ),
'slug' => 'light-gray',
'color' => '#b3b3b1',
),
array(
'name' => __( 'White', 'independent-publisher-2' ),
'slug' => 'white',
'color' => '#fff',
),
) );
}
/**
* Add custom logo support
*/
add_theme_support(
'custom-logo',
array(
'height' => 300,
'width' => 1500,
'flex-width' => true,
)
);
/*
* 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',
)
);
// Set up the WordPress core custom background feature.
add_theme_support(
'custom-background',
apply_filters(
'independent_publisher_2_custom_background_args',
array(
'default-color' => 'ffffff',
)
)
);
// Load regular editor styles into the new block-based editor.
add_theme_support( 'editor-styles' );
// Add support for Block Styles.
add_theme_support( 'wp-block-styles' );
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
// Add support for full and wide align images.
add_theme_support( 'align-wide' );
// Add support for custom color scheme.
add_theme_support(
'editor-color-palette',
array(
array(
'name' => __( 'Medium Blue', 'independent-publisher-2' ),
'slug' => 'medium-blue',
'color' => '#0087be',
),
array(
'name' => __( 'Bright Blue', 'independent-publisher-2' ),
'slug' => 'bright-blue',
'color' => '#00aadc',
),
array(
'name' => __( 'Dark Gray', 'independent-publisher-2' ),
'slug' => 'dark-gray',
'color' => '#4d4d4b',
),
array(
'name' => __( 'Light Gray', 'independent-publisher-2' ),
'slug' => 'light-gray',
'color' => '#b3b3b1',
),
array(
'name' => __( 'White', 'independent-publisher-2' ),
'slug' => 'white',
'color' => '#fff',
),
)
);
}
endif; // independent_publisher_2_setup
add_action( 'after_setup_theme', 'independent_publisher_2_setup' );
if ( ! function_exists( 'independent_publisher_2_word_count' ) ) :
/**
* Gets the number of words in the post content.
*
* @link http://php.net/str_word_count
* @link http://php.net/number_format
*/
function independent_publisher_2_word_count() {
$content = get_post_field( 'post_content', get_the_ID() );
$count = str_word_count( strip_tags( $content ) );
$time = $count / 250; //Roughly 250 wpm reading time
// if time less than 1 explicitly set to 1.
if( $time < 1 ) {
$time = 1;
/**
* Gets the number of words in the post content.
*
* @link http://php.net/str_word_count
* @link http://php.net/number_format
*/
function independent_publisher_2_word_count() {
$content = get_post_field( 'post_content', get_the_ID() );
$count = str_word_count( strip_tags( $content ) );
$time = $count / 250; //Roughly 250 wpm reading time
// if time less than 1 explicitly set to 1.
if ( $time < 1 ) {
$time = 1;
}
return number_format( $time );
}
return number_format( $time );
}
endif; // independent_publisher_2_word_count
/**
@ -158,42 +175,50 @@ add_action( 'after_setup_theme', 'independent_publisher_2_content_width', 0 );
* @link http://codex.wordpress.org/Function_Reference/register_sidebar
*/
function independent_publisher_2_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'independent-publisher-2' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 1', 'independent-publisher-2' ),
'id' => 'sidebar-2',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 2', 'independent-publisher-2' ),
'id' => 'sidebar-3',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 3', 'independent-publisher-2' ),
'id' => 'sidebar-4',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Sidebar', 'independent-publisher-2' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Footer 1', 'independent-publisher-2' ),
'id' => 'sidebar-2',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Footer 2', 'independent-publisher-2' ),
'id' => 'sidebar-3',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Footer 3', 'independent-publisher-2' ),
'id' => 'sidebar-4',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
)
);
}
add_action( 'widgets_init', 'independent_publisher_2_widgets_init' );
@ -217,17 +242,20 @@ function independent_publisher_2_scripts() {
}
// If there's an active Video widget, and it's (hopefully) in the footer widget area
if ( is_active_widget( '','', 'media_video' ) && ( is_active_sidebar( 'sidebar-2' ) || is_active_sidebar( 'sidebar-3' ) || is_active_sidebar( 'sidebar-4' ) ) ) {
if ( is_active_widget( '', '', 'media_video' ) && ( is_active_sidebar( 'sidebar-2' ) || is_active_sidebar( 'sidebar-3' ) || is_active_sidebar( 'sidebar-4' ) ) ) {
wp_enqueue_script( 'independent-publisher-2-video-widget', get_template_directory_uri() . '/js/video-widget.js', array(), '20210111', true );
}
wp_enqueue_script( 'independent-publisher-2-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20170315', true );
if ( independent_publisher_2_has_header_image() ) {
wp_add_inline_style( 'independent-publisher-2-style', sprintf(
'#hero-header { background: url("%s") no-repeat center; background-size: cover; background-attachment: scroll; }',
esc_url( get_header_image() )
) );
wp_add_inline_style(
'independent-publisher-2-style',
sprintf(
'#hero-header { background: url("%s") no-repeat center; background-size: cover; background-attachment: scroll; }',
esc_url( get_header_image() )
)
);
}
if ( is_singular() ) {
@ -250,10 +278,13 @@ function independent_publisher_2_scripts() {
//Grab the first URL
$banner = $banner_matches[0][0];
wp_add_inline_style( 'independent-publisher-2-style', sprintf(
'#hero-header { background: url("%s") no-repeat center; background-size: cover; background-attachment: scroll; }',
esc_url( $banner )
) );
wp_add_inline_style(
'independent-publisher-2-style',
sprintf(
'#hero-header { background: url("%s") no-repeat center; background-size: cover; background-attachment: scroll; }',
esc_url( $banner )
)
);
}
}
}

View file

@ -19,122 +19,140 @@ add_action( 'after_setup_theme', 'intergalactic_2_content_width', 0 );
if ( ! function_exists( 'intergalactic_2_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function intergalactic_2_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Intergalactic 2, use a find and replace
* to change 'intergalactic-2' to the name of your theme in all the template files
*/
load_theme_textdomain( 'intergalactic-2', get_template_directory() . '/languages' );
// 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 <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
/**
* Gutenberg wide and full images support
*/
add_theme_support( 'align-wide' );
// Add custom colors to Gutenberg
add_theme_support(
'editor-color-palette', array(
array(
'name' => esc_html__( 'Black', 'intergalactic-2' ),
'slug' => 'black',
'color' => '#222222',
),
array(
'name' => esc_html__( 'Dark Gray', 'intergalactic-2' ),
'slug' => 'dark-gray',
'color' => '#333333',
),
array(
'name' => esc_html__( 'Light Gray', 'intergalactic-2' ),
'slug' => 'light-gray',
'color' => '#cccccc',
),
array(
'name' => esc_html__( 'White', 'intergalactic-2' ),
'slug' => 'white',
'color' => '#ffffff',
),
array(
'name' => esc_html__( 'Purple', 'intergalactic-2' ),
'slug' => 'purple',
'color' => '#81699b',
),
array(
'name' => esc_html__( 'Dark Purple', 'intergalactic-2' ),
'slug' => 'dark-purple',
'color' => '#553a72',
),
array(
'name' => esc_html__( 'Dark Green', 'intergalactic-2' ),
'slug' => 'dark-green',
'color' => '#557d73',
),
)
);
/*
* Enable support for Post Thumbnails on posts and pages.
* Sets up theme defaults and registers support for various WordPress features.
*
* @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
add_theme_support( 'post-thumbnails' );
add_image_size( 'intergalactic-2-large', '1440', '960', false );
function intergalactic_2_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Intergalactic 2, use a find and replace
* to change 'intergalactic-2' to the name of your theme in all the template files
*/
load_theme_textdomain( 'intergalactic-2', get_template_directory() . '/languages' );
// Enable support for custom logo.
add_theme_support( 'custom-logo', array(
'height' => 400,
'width' => 1200,
'flex-height' => true,
'flex-width' => true
) );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
// This theme uses wp_nav_menu() in two locations.
register_nav_menus( array(
'menu-1' => esc_html__( 'Slide-Out Menu', 'intergalactic-2' ),
) );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
/*
* 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 support for responsive embeds.
add_theme_support( 'responsive-embeds' );
// Setup the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'intergalactic_2_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
/**
* Gutenberg wide and full images support
*/
add_theme_support( 'align-wide' );
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
// Add custom colors to Gutenberg
add_theme_support(
'editor-color-palette',
array(
array(
'name' => esc_html__( 'Black', 'intergalactic-2' ),
'slug' => 'black',
'color' => '#222222',
),
array(
'name' => esc_html__( 'Dark Gray', 'intergalactic-2' ),
'slug' => 'dark-gray',
'color' => '#333333',
),
array(
'name' => esc_html__( 'Light Gray', 'intergalactic-2' ),
'slug' => 'light-gray',
'color' => '#cccccc',
),
array(
'name' => esc_html__( 'White', 'intergalactic-2' ),
'slug' => 'white',
'color' => '#ffffff',
),
array(
'name' => esc_html__( 'Purple', 'intergalactic-2' ),
'slug' => 'purple',
'color' => '#81699b',
),
array(
'name' => esc_html__( 'Dark Purple', 'intergalactic-2' ),
'slug' => 'dark-purple',
'color' => '#553a72',
),
array(
'name' => esc_html__( 'Dark Green', 'intergalactic-2' ),
'slug' => 'dark-green',
'color' => '#557d73',
),
)
);
}
/*
* 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( 'intergalactic-2-large', '1440', '960', false );
// Enable support for custom logo.
add_theme_support(
'custom-logo',
array(
'height' => 400,
'width' => 1200,
'flex-height' => true,
'flex-width' => true,
)
);
// This theme uses wp_nav_menu() in two locations.
register_nav_menus(
array(
'menu-1' => esc_html__( 'Slide-Out Menu', 'intergalactic-2' ),
)
);
/*
* 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',
)
);
// Setup the WordPress core custom background feature.
add_theme_support(
'custom-background',
apply_filters(
'intergalactic_2_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; // intergalactic_2_setup
add_action( 'after_setup_theme', 'intergalactic_2_setup' );
@ -144,39 +162,47 @@ add_action( 'after_setup_theme', 'intergalactic_2_setup' );
* @link http://codex.wordpress.org/Function_Reference/register_sidebar
*/
function intergalactic_2_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'intergalactic-2' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 1', 'intergalactic-2' ),
'id' => 'sidebar-2',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 2', 'intergalactic-2' ),
'id' => 'sidebar-3',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 3', 'intergalactic-2' ),
'id' => 'sidebar-4',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Sidebar', 'intergalactic-2' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Footer 1', 'intergalactic-2' ),
'id' => 'sidebar-2',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Footer 2', 'intergalactic-2' ),
'id' => 'sidebar-3',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Footer 3', 'intergalactic-2' ),
'id' => 'sidebar-4',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
)
);
}
add_action( 'widgets_init', 'intergalactic_2_widgets_init' );
@ -207,7 +233,7 @@ add_action( 'wp_enqueue_scripts', 'intergalactic_2_scripts' );
* Gutenberg Editor Styles
*/
function intergalactic_2_editor_styles() {
wp_enqueue_style( 'intergalactic-2-editor-block-style', get_template_directory_uri() . '/editor-blocks.css');
wp_enqueue_style( 'intergalactic-2-editor-block-style', get_template_directory_uri() . '/editor-blocks.css' );
wp_enqueue_style( 'intergalactic-2-lato', intergalactic_2_fonts_url() );
wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.3' );
}
@ -217,16 +243,16 @@ add_action( 'enqueue_block_editor_assets', 'intergalactic_2_editor_styles' );
* Register Google Fonts
*/
function intergalactic_2_fonts_url() {
$fonts_url = '';
$fonts_url = '';
/* Translators: If there are characters in your language that are not
/* 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.
*/
$arimo = esc_html_x( 'on', 'Lato font: on or off', 'intergalactic-2' );
if ( 'off' !== $arimo ) {
$font_families = array();
$font_families = array();
$font_families[] = 'Lato:300,400,700,300italic,400italic,700italic&subset=latin,latin-ext';
$query_args = array(
@ -242,12 +268,12 @@ function intergalactic_2_fonts_url() {
}
if ( ! function_exists( 'intergalactic_2_continue_reading_link' ) ) :
/**
* Returns an ellipsis and "Continue reading" plus off-screen title link for excerpts
*/
function intergalactic_2_continue_reading_link() {
return '<a href="'. esc_url( get_permalink() ) . '" class="more-link">' . sprintf( __( 'Read More <span class="screen-reader-text">%1$s</span>', 'intergalactic-2' ), esc_attr( strip_tags( get_the_title() ) ) ) . '</a>';
}
/**
* Returns an ellipsis and "Continue reading" plus off-screen title link for excerpts
*/
function intergalactic_2_continue_reading_link() {
return '<a href="' . esc_url( get_permalink() ) . '" class="more-link">' . sprintf( __( 'Read More <span class="screen-reader-text">%1$s</span>', 'intergalactic-2' ), esc_attr( strip_tags( get_the_title() ) ) ) . '</a>';
}
endif; // intergalactic_2_continue_reading_link
/**

View file

@ -8,6 +8,7 @@
*/
if ( ! function_exists( 'ixion_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
@ -37,40 +38,41 @@ if ( ! function_exists( 'ixion_setup' ) ) :
add_theme_support( 'align-wide' );
// Add custom colors to Gutenberg
add_theme_support(
'editor-color-palette', array(
'editor-color-palette',
array(
array(
'name' => esc_html__( 'Black', 'ixion' ),
'slug' => 'black',
'slug' => 'black',
'color' => '#192930',
),
array(
'name' => esc_html__( 'Dark Gray', 'ixion' ),
'slug' => 'dark-gray',
'slug' => 'dark-gray',
'color' => '#474f53',
),
array(
'name' => esc_html__( 'Medium Gray', 'ixion' ),
'slug' => 'medium-gray',
'slug' => 'medium-gray',
'color' => '#a5a29d',
),
array(
'name' => esc_html__( 'Light Gray', 'ixion' ),
'slug' => 'light-gray',
'slug' => 'light-gray',
'color' => '#eeece8',
),
array(
'name' => esc_html__( 'White', 'ixion' ),
'slug' => 'white',
'slug' => 'white',
'color' => '#ffffff',
),
array(
'name' => esc_html__( 'Yellow', 'ixion' ),
'slug' => 'yellow',
'slug' => 'yellow',
'color' => '#d7b221',
),
array(
'name' => esc_html__( 'Dark Yellow', 'ixion' ),
'slug' => 'dark-yellow',
'slug' => 'dark-yellow',
'color' => '#9c8012',
),
)
@ -96,36 +98,50 @@ if ( ! function_exists( 'ixion_setup' ) ) :
add_image_size( 'ixion-avatar', 75, 75, true );
// This theme uses wp_nav_menu() in three locations.
register_nav_menus( array(
'menu-1' => esc_html__( 'Header', 'ixion' ),
) );
register_nav_menus(
array(
'menu-1' => esc_html__( 'Header', 'ixion' ),
)
);
/**
* Add support for core custom logo.
*/
add_theme_support( 'custom-logo', array(
'height' => 100,
'width' => 500,
'flex-width' => true,
'flex-height' => true,
) );
add_theme_support(
'custom-logo',
array(
'height' => 100,
'width' => 500,
'flex-width' => true,
'flex-height' => true,
)
);
/*
* 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(
'html5',
array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
)
);
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'ixion_custom_background_args', array(
'default-color' => 'ffffff',
) ) );
add_theme_support(
'custom-background',
apply_filters(
'ixion_custom_background_args',
array(
'default-color' => 'ffffff',
)
)
);
}
endif;
@ -175,55 +191,65 @@ function ixion_the_custom_logo() {
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function ixion_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'ixion' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Sidebar', 'ixion' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Footer 1', 'ixion' ),
'id' => 'sidebar-2',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Footer 1', 'ixion' ),
'id' => 'sidebar-2',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Footer 2', 'ixion' ),
'id' => 'sidebar-3',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Footer 2', 'ixion' ),
'id' => 'sidebar-3',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Footer 3', 'ixion' ),
'id' => 'sidebar-4',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Footer 3', 'ixion' ),
'id' => 'sidebar-4',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Footer 4', 'ixion' ),
'id' => 'sidebar-5',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Footer 4', 'ixion' ),
'id' => 'sidebar-5',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
}
add_action( 'widgets_init', 'ixion_widgets_init' );
@ -241,7 +267,7 @@ function ixion_fonts_url_archivo() {
if ( 'off' !== $archivo ) {
$font_families = array();
$font_families = array();
$font_families[] = 'Archivo Narrow:400,400i,700,700i';
$query_args = array(
@ -269,7 +295,7 @@ function ixion_fonts_url_cooper() {
$cooper = esc_html_x( 'on', 'Cooper Hewitt font: on or off', 'ixion' );
if ( 'off' !== $cooper ) {
$fonts_url = get_template_directory_uri() . "/assets/fonts/cooperhewitt.css";
$fonts_url = get_template_directory_uri() . '/assets/fonts/cooperhewitt.css';
}
return $fonts_url;
@ -308,7 +334,7 @@ add_action( 'wp_enqueue_scripts', 'ixion_scripts' );
* Gutenberg Editor Styles
*/
function ixion_editor_styles() {
wp_enqueue_style( 'ixion-editor-block-style', get_template_directory_uri() . '/editor-blocks.css');
wp_enqueue_style( 'ixion-editor-block-style', get_template_directory_uri() . '/editor-blocks.css' );
wp_enqueue_style( 'ixion-fonts-archivo', ixion_fonts_url_archivo(), array(), null );
wp_enqueue_style( 'ixion-fonts-cooper', ixion_fonts_url_cooper(), array(), null );
}
@ -320,11 +346,12 @@ add_action( 'enqueue_block_editor_assets', 'ixion_editor_styles' );
*/
if ( ! function_exists( 'ixion_excerpt_more' ) ) :
function ixion_excerpt_more( $more ) {
$link = sprintf( '<a href="%1$s" class="more-link">%2$s</a>',
$link = sprintf(
'<a href="%1$s" class="more-link">%2$s</a>',
esc_url( get_permalink( get_the_ID() ) ),
/* translators: %s: Name of current post */
sprintf( esc_html__( 'Continue reading %s', 'ixion' ), '<span class="screen-reader-text">' . get_the_title( get_the_ID() ) . '</span>' )
);
);
return ' &hellip; ' . $link;
}
add_filter( 'excerpt_more', 'ixion_excerpt_more' );

View file

@ -8,131 +8,145 @@
*/
if ( ! function_exists( 'karuna_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the aftercomponentsetup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function karuna_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on components, use a find and replace
* to change 'karuna' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'karuna', get_template_directory() . '/languages' );
// 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 <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
/**
* Gutenberg wide and full images support
*/
add_theme_support( 'align-wide' );
// Add custom colors to Gutenberg
add_theme_support(
'editor-color-palette', array(
array(
'name' => esc_html__( 'Black', 'karuna' ),
'slug' => 'black',
'color' => '#333333',
),
array(
'name' => esc_html__( 'Medium Gray', 'karuna' ),
'slug' => 'medium-gray',
'color' => '#999999',
),
array(
'name' => esc_html__( 'Light Gray', 'karuna' ),
'slug' => 'light-gray',
'color' => '#dddddd',
),
array(
'name' => esc_html__( 'White', 'karuna' ),
'slug' => 'white',
'color' => '#ffffff',
),
array(
'name' => esc_html__( 'Purple', 'karuna' ),
'slug' => 'purple',
'color' => '#6636cc',
),
array(
'name' => esc_html__( 'Dark Purple', 'karuna' ),
'slug' => 'dark-purple',
'color' => '#471e9e',
),
array(
'name' => esc_html__( 'Green', 'karuna' ),
'slug' => 'green',
'color' => '#85cc36',
),
array(
'name' => esc_html__( 'Dark Green', 'karuna' ),
'slug' => 'dark-green',
'color' => '#609d1b',
),
)
);
/*
* Enable support for Post Thumbnails on posts and pages.
* Sets up theme defaults and registers support for various WordPress features.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
* Note that this function is hooked into the aftercomponentsetup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
add_theme_support( 'post-thumbnails' );
function karuna_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on components, use a find and replace
* to change 'karuna' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'karuna', get_template_directory() . '/languages' );
add_image_size( 'karuna-featured-image', 685, 9999 );
add_image_size( 'karuna-hero', 2000, 9999 );
add_image_size( 'karuna-grid', 342, 228, true );
add_image_size( 'karuna-thumbnail-avatar', 100, 100, true );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'menu-1' => esc_html__( 'Header', 'karuna' ),
) );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
/*
* 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 support for responsive embeds.
add_theme_support( 'responsive-embeds' );
// Add theme support for custom logos
add_theme_support( 'custom-logo',
array(
'width' => 1000,
'height' => 200,
'flex-width' => true,
'flex-height' => true,
)
);
/**
* Gutenberg wide and full images support
*/
add_theme_support( 'align-wide' );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'karuna_custom_background_args', array(
'default-color' => 'ffffff',
) ) );
}
// Add custom colors to Gutenberg
add_theme_support(
'editor-color-palette',
array(
array(
'name' => esc_html__( 'Black', 'karuna' ),
'slug' => 'black',
'color' => '#333333',
),
array(
'name' => esc_html__( 'Medium Gray', 'karuna' ),
'slug' => 'medium-gray',
'color' => '#999999',
),
array(
'name' => esc_html__( 'Light Gray', 'karuna' ),
'slug' => 'light-gray',
'color' => '#dddddd',
),
array(
'name' => esc_html__( 'White', 'karuna' ),
'slug' => 'white',
'color' => '#ffffff',
),
array(
'name' => esc_html__( 'Purple', 'karuna' ),
'slug' => 'purple',
'color' => '#6636cc',
),
array(
'name' => esc_html__( 'Dark Purple', 'karuna' ),
'slug' => 'dark-purple',
'color' => '#471e9e',
),
array(
'name' => esc_html__( 'Green', 'karuna' ),
'slug' => 'green',
'color' => '#85cc36',
),
array(
'name' => esc_html__( 'Dark Green', 'karuna' ),
'slug' => 'dark-green',
'color' => '#609d1b',
),
)
);
/*
* 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( 'karuna-featured-image', 685, 9999 );
add_image_size( 'karuna-hero', 2000, 9999 );
add_image_size( 'karuna-grid', 342, 228, true );
add_image_size( 'karuna-thumbnail-avatar', 100, 100, true );
// This theme uses wp_nav_menu() in one location.
register_nav_menus(
array(
'menu-1' => esc_html__( 'Header', 'karuna' ),
)
);
/*
* 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 logos
add_theme_support(
'custom-logo',
array(
'width' => 1000,
'height' => 200,
'flex-width' => true,
'flex-height' => true,
)
);
// Set up the WordPress core custom background feature.
add_theme_support(
'custom-background',
apply_filters(
'karuna_custom_background_args',
array(
'default-color' => 'ffffff',
)
)
);
}
endif;
add_action( 'after_setup_theme', 'karuna_setup' );
@ -166,14 +180,14 @@ add_action( 'after_setup_theme', 'karuna_content_width', 0 );
if ( ! function_exists( 'karuna_adjusted_content_width' ) ) :
function karuna_adjusted_content_width() {
global $content_width;
function karuna_adjusted_content_width() {
global $content_width;
if ( is_page_template( 'templates/full-width-page.php' ) || is_page_template( 'front-page.php' ) || is_active_sidebar( 'sidebar-5' ) || is_active_sidebar( 'sidebar-4' ) ) {
$content_width = 1040; //pixels
if ( is_page_template( 'templates/full-width-page.php' ) || is_page_template( 'front-page.php' ) || is_active_sidebar( 'sidebar-5' ) || is_active_sidebar( 'sidebar-4' ) ) {
$content_width = 1040; //pixels
}
}
}
add_action( 'template_redirect', 'karuna_adjusted_content_width' );
add_action( 'template_redirect', 'karuna_adjusted_content_width' );
endif; // if ! function_exists( 'karuna_adjusted_content_width' )
@ -183,75 +197,89 @@ endif; // if ! function_exists( 'karuna_adjusted_content_width' )
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function karuna_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'karuna' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Sidebar', 'karuna' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Full-Width Header', 'karuna' ),
'id' => 'sidebar-4',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Full-Width Header', 'karuna' ),
'id' => 'sidebar-4',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Full-Width Footer', 'karuna' ),
'id' => 'sidebar-5',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Full-Width Footer', 'karuna' ),
'id' => 'sidebar-5',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Footer 1', 'karuna' ),
'id' => 'sidebar-2',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Footer 1', 'karuna' ),
'id' => 'sidebar-2',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Footer 2', 'karuna' ),
'id' => 'sidebar-3',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Footer 2', 'karuna' ),
'id' => 'sidebar-3',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Footer 3', 'karuna' ),
'id' => 'sidebar-6',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Footer 3', 'karuna' ),
'id' => 'sidebar-6',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Footer 4', 'karuna' ),
'id' => 'sidebar-7',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Footer 4', 'karuna' ),
'id' => 'sidebar-7',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
}
add_action( 'widgets_init', 'karuna_widgets_init' );
@ -259,16 +287,16 @@ add_action( 'widgets_init', 'karuna_widgets_init' );
* Register Google Fonts
*/
function karuna_fonts_url() {
$fonts_url = '';
$fonts_url = '';
/* Translators: If there are characters in your language that are not
/* Translators: If there are characters in your language that are not
* supported by Karla, translate this to 'off'. Do not translate
* into your own language.
*/
$karla = esc_html_x( 'on', 'Karla font: on or off', 'karuna' );
if ( 'off' !== $karla ) {
$font_families = array();
$font_families = array();
$font_families[] = 'Karla:400,400italic,700,700italic';
$query_args = array(
@ -323,11 +351,12 @@ add_action( 'enqueue_block_editor_assets', 'karuna_editor_styles' );
*/
if ( ! function_exists( 'karuna_excerpt_more' ) ) :
function karuna_excerpt_more( $more ) {
$link = sprintf( '<a href="%1$s" class="more-link">%2$s</a>',
$link = sprintf(
'<a href="%1$s" class="more-link">%2$s</a>',
esc_url( get_permalink( get_the_ID() ) ),
/* translators: %s: Name of current post */
sprintf( esc_html__( 'Continue reading %s', 'karuna' ), '<span class="screen-reader-text">' . get_the_title( get_the_ID() ) . '</span>' )
);
);
return ' &hellip; ' . $link;
}
add_filter( 'excerpt_more', 'karuna_excerpt_more' );

View file

@ -18,7 +18,6 @@ if ( ! function_exists( 'leven_setup' ) ) :
* as indicating support for post thumbnails.
*/
function leven_setup() {
// Add child theme editor styles, compiled from `style-child-theme-editor.scss`.
add_editor_style( 'style-editor.css' );

View file

@ -6,82 +6,97 @@
*/
if ( ! function_exists( 'libre_2_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function libre_2_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
load_theme_textdomain( 'libre-2', get_template_directory() . '/languages' );
function libre_2_setup() {
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
*/
load_theme_textdomain( 'libre-2', get_template_directory() . '/languages' );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/* Add support for editor styles */
add_editor_style( array( 'editor-style.css', libre_2_fonts_url() ) );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'menu-1' => esc_html__( 'Header', 'libre-2' ),
) );
/* Add support for editor styles */
add_editor_style( array( 'editor-style.css', libre_2_fonts_url() ) );
/*
* Add support for Featured Images
*/
add_theme_support( 'post-thumbnails' );
add_image_size( 'libre-2-post-thumbnail', '1088', '9999' );
// This theme uses wp_nav_menu() in one location.
register_nav_menus(
array(
'menu-1' => esc_html__( 'Header', 'libre-2' ),
)
);
/*
* Add support for core Custom Logos
*/
add_theme_support( 'custom-logo', array(
'height' => 300,
'width' => 300,
'flex-width' => true,
) );
/*
* Add support for Featured Images
*/
add_theme_support( 'post-thumbnails' );
add_image_size( 'libre-2-post-thumbnail', '1088', '9999' );
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
/*
* Add support for core Custom Logos
*/
add_theme_support(
'custom-logo',
array(
'height' => 300,
'width' => 300,
'flex-width' => true,
)
);
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'search-form',
'comment-form',
'gallery',
'caption',
) );
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'libre_2_custom_background_args', array(
'default-color' => 'ffffff',
) ) );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support(
'html5',
array(
'search-form',
'comment-form',
'gallery',
'caption',
)
);
// Load regular editor styles into the new block-based editor.
add_theme_support( 'editor-styles' );
// Set up the WordPress core custom background feature.
add_theme_support(
'custom-background',
apply_filters(
'libre_2_custom_background_args',
array(
'default-color' => 'ffffff',
)
)
);
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
// Load regular editor styles into the new block-based editor.
add_theme_support( 'editor-styles' );
// Add support for full and wide align images.
add_theme_support( 'align-wide' );
}
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
// Add support for full and wide align images.
add_theme_support( 'align-wide' );
}
endif; // libre_2_setup
add_action( 'after_setup_theme', 'libre_2_setup' );
@ -103,14 +118,14 @@ add_action( 'after_setup_theme', 'libre_2_content_width', 0 );
if ( ! function_exists( 'libre_2_content_width' ) ) :
function libre_2_content_width() {
global $content_width;
function libre_2_content_width() {
global $content_width;
if ( is_page_template( 'templates/full-width-page.php' ) ) {
$content_width = 1088; //pixels
}
}
add_action( 'template_redirect', 'libre_2_content_width' );
if ( is_page_template( 'templates/full-width-page.php' ) ) {
$content_width = 1088; //pixels
}
}
add_action( 'template_redirect', 'libre_2_content_width' );
endif; // if ! function_exists( 'libre_2_content_width' )
@ -120,45 +135,53 @@ endif; // if ! function_exists( 'libre_2_content_width' )
* @link http://codex.wordpress.org/Function_Reference/register_sidebar
*/
function libre_2_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'libre-2' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Sidebar', 'libre-2' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Footer 1', 'libre-2' ),
'id' => 'sidebar-2',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Footer 1', 'libre-2' ),
'id' => 'sidebar-2',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Footer 2', 'libre-2' ),
'id' => 'sidebar-3',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Footer 2', 'libre-2' ),
'id' => 'sidebar-3',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Footer 3', 'libre-2' ),
'id' => 'sidebar-4',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Footer 3', 'libre-2' ),
'id' => 'sidebar-4',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
}
add_action( 'widgets_init', 'libre_2_widgets_init' );
@ -166,16 +189,16 @@ add_action( 'widgets_init', 'libre_2_widgets_init' );
* Register Google Fonts
*/
function libre_2_fonts_url() {
$fonts_url = '';
$fonts_url = '';
/* Translators: If there are characters in your language that are not
/* Translators: If there are characters in your language that are not
* supported by Libre Baskerville, translate this to 'off'. Do not translate
* into your own language.
*/
$libre = esc_html_x( 'on', 'Libre Baskerville font: on or off', 'libre-2' );
if ( 'off' !== $libre ) {
$font_families = array();
$font_families = array();
$font_families[] = 'Libre Baskerville:400,400italic,700';
$query_args = array(
@ -266,19 +289,19 @@ add_filter( 'wp_list_categories', 'libre_2_cat_count_span' );
*/
function libre_2_archive_count_span( $links ) {
$links = str_replace( '</a>&nbsp;(', '</a><span class="post-count">(', $links );
$links = str_replace( ')', ')</span>', $links );
return $links;
$links = str_replace( '</a>&nbsp;(', '</a><span class="post-count">(', $links );
$links = str_replace( ')', ')</span>', $links );
return $links;
}
add_filter( 'get_archives_link', 'libre_2_archive_count_span' );
if ( ! function_exists( 'libre_2_continue_reading_link' ) ) :
/**
* Returns an ellipsis and "Continue reading" plus off-screen title link for excerpts
*/
function libre_2_continue_reading_link() {
return '&hellip; <a class="more-link" href="'. esc_url( get_permalink() ) . '">' . sprintf( wp_kses_post( __( 'Continue reading <span class="screen-reader-text">%1$s</span> <span class="meta-nav" aria-hidden="true">&rarr;</span>', 'libre-2' ) ), esc_attr( strip_tags( get_the_title() ) ) ) . '</a>';
}
/**
* Returns an ellipsis and "Continue reading" plus off-screen title link for excerpts
*/
function libre_2_continue_reading_link() {
return '&hellip; <a class="more-link" href="' . esc_url( get_permalink() ) . '">' . sprintf( wp_kses_post( __( 'Continue reading <span class="screen-reader-text">%1$s</span> <span class="meta-nav" aria-hidden="true">&rarr;</span>', 'libre-2' ) ), esc_attr( strip_tags( get_the_title() ) ) ) . '</a>';
}
endif; // libre_2_continue_reading_link
@ -313,13 +336,16 @@ add_filter( 'get_the_excerpt', 'libre_2_custom_excerpt_more' );
* used in comments.php
*/
function libre_2_comments( $comment, $args, $depth ) {
?>
?>
<li id="comment-<?php comment_ID(); ?>" <?php comment_class( empty( $args['has_children'] ) ? '' : 'parent' ); ?>>
<article id="div-comment-<?php comment_ID(); ?>" class="comment-body">
<footer class="comment-meta">
<div class="comment-metadata">
<span class="comment-author vcard">
<?php if ( 0 != $args['avatar_size'] ) echo get_avatar( $comment, $args['avatar_size'] ); ?>
<?php
if ( 0 != $args['avatar_size'] ) {
echo get_avatar( $comment, $args['avatar_size'] );}
?>
<?php printf( '<b class="fn">%s</b>', get_comment_author_link() ); ?>
</span>
@ -329,13 +355,18 @@ function libre_2_comments( $comment, $args, $depth ) {
</time>
</a>
<?php
comment_reply_link( array_merge( $args, array(
'add_below' => 'div-comment',
'depth' => $depth,
'max_depth' => $args['max_depth'],
'before' => '<span class="reply">',
'after' => '</span>'
) ) );
comment_reply_link(
array_merge(
$args,
array(
'add_below' => 'div-comment',
'depth' => $depth,
'max_depth' => $args['max_depth'],
'before' => '<span class="reply">',
'after' => '</span>',
)
)
);
?>
<?php edit_comment_link( esc_html__( 'Edit', 'libre-2' ), '<span class="edit-link">', '</span>' ); ?>
@ -351,7 +382,7 @@ function libre_2_comments( $comment, $args, $depth ) {
</div><!-- .comment-content -->
</article><!-- .comment-body -->
<?php
<?php
}
/**

View file

@ -21,14 +21,13 @@ if ( ! function_exists( 'libretto_setup' ) ) :
* support post thumbnails.
*/
function libretto_setup() {
/**
* Make theme available for translation
* Translations can be filed in the /languages/ directory
* If you're building a theme based on Libretto, use a find and replace
* to change 'libretto' to the name of your theme in all the template files
*/
load_theme_textdomain( 'libretto', get_template_directory().'/languages' );
load_theme_textdomain( 'libretto', get_template_directory() . '/languages' );
/**
* Add default posts and comments RSS feed links to head
@ -53,42 +52,43 @@ if ( ! function_exists( 'libretto_setup' ) ) :
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
// Add custom colors to Gutenberg
// Add custom colors to Gutenberg
add_theme_support(
'editor-color-palette', array(
'editor-color-palette',
array(
array(
'name' => esc_html__( 'Black', 'libretto' ),
'slug' => 'black',
'slug' => 'black',
'color' => '#26231e',
),
array(
'name' => esc_html__( 'Dark Gray', 'libretto' ),
'slug' => 'dark-gray',
'slug' => 'dark-gray',
'color' => '#787065',
),
array(
'name' => esc_html__( 'Medium Gray', 'libretto' ),
'slug' => 'medium-gray',
'slug' => 'medium-gray',
'color' => '#a09a92',
),
array(
'name' => esc_html__( 'Light Gray', 'libretto' ),
'slug' => 'light-gray',
'slug' => 'light-gray',
'color' => '#d9d6d0',
),
array(
'name' => esc_html__( 'White', 'libretto' ),
'slug' => 'white',
'slug' => 'white',
'color' => '#ffffff',
),
array(
'name' => esc_html__( 'Red', 'libretto' ),
'slug' => 'red',
'slug' => 'red',
'color' => '#932817',
),
array(
'name' => esc_html__( 'Dark Red', 'libretto' ),
'slug' => 'dark-red',
'slug' => 'dark-red',
'color' => '#712012',
),
)
@ -98,24 +98,40 @@ if ( ! function_exists( 'libretto_setup' ) ) :
* This theme uses wp_nav_menu() in two locations:
* one at the top of the page, and one for social media links in the footer
*/
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'libretto' ),
'social' => __( 'Social Media Menu', 'libretto' ),
) );
register_nav_menus(
array(
'primary' => __( 'Primary Menu', 'libretto' ),
'social' => __( 'Social Media Menu', 'libretto' ),
)
);
/**
* Enable support for Post Formats
*/
add_theme_support( 'post-formats', array(
'aside', 'image', 'video', 'quote', 'link', 'audio', 'chat', 'gallery', 'status',
) );
add_theme_support(
'post-formats',
array(
'aside',
'image',
'video',
'quote',
'link',
'audio',
'chat',
'gallery',
'status',
)
);
/**
* Enable support for custom background
*/
add_theme_support( 'custom-background', array(
'default-color' => '#f2f1ed',
) );
add_theme_support(
'custom-background',
array(
'default-color' => '#f2f1ed',
)
);
/**
* Enable support for proper titles
@ -131,9 +147,16 @@ if ( ! function_exists( 'libretto_setup' ) ) :
* 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(
'html5',
array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
)
);
} // libretto_setup()
endif;
@ -143,38 +166,46 @@ add_action( 'after_setup_theme', 'libretto_setup' );
* Register widgetized area and update sidebar with default widgets
*/
function libretto_widgets_init() {
register_sidebar( array(
'name' => __( 'First Footer Sidebar', 'libretto' ),
'id' => 'sidebar-1',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar( array(
'name' => __( 'Second Footer Sidebar', 'libretto' ),
'id' => 'sidebar-2',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar( array(
'name' => __( 'Third Footer Sidebar', 'libretto' ),
'id' => 'sidebar-3',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar( array(
'name' => __( 'Fourth Footer Sidebar', 'libretto' ),
'id' => 'sidebar-4',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => __( 'First Footer Sidebar', 'libretto' ),
'id' => 'sidebar-1',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar(
array(
'name' => __( 'Second Footer Sidebar', 'libretto' ),
'id' => 'sidebar-2',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar(
array(
'name' => __( 'Third Footer Sidebar', 'libretto' ),
'id' => 'sidebar-3',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar(
array(
'name' => __( 'Fourth Footer Sidebar', 'libretto' ),
'id' => 'sidebar-4',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
}
add_action( 'widgets_init', 'libretto_widgets_init' );
@ -247,19 +278,19 @@ function libretto_scripts() {
// General site stylesheet & JS
wp_enqueue_style( 'libretto-style', get_stylesheet_uri() );
wp_enqueue_script( 'libretto-script', get_template_directory_uri().'/js/libretto.js', array( 'jquery' ), '20140331' );
wp_enqueue_script( 'libretto-script', get_template_directory_uri() . '/js/libretto.js', array( 'jquery' ), '20140331' );
// Gutenberg styles
wp_enqueue_style( 'libretto-blocks', get_template_directory_uri() . '/css/blocks.css' );
// Fonts
wp_enqueue_style( 'libretto-fonts', libretto_fonts_url(), array(), null );
wp_enqueue_style( 'libretto-custom-icons', get_template_directory_uri().'/icons/icons.css', array(), null );
wp_enqueue_style( 'libretto-custom-icons', get_template_directory_uri() . '/icons/icons.css', array(), null );
// Navigation
wp_enqueue_script( 'libretto-touche', get_template_directory_uri().'/js/touche.js', '20150604', true );
wp_enqueue_script( 'libretto-navigation', get_template_directory_uri().'/js/navigation.js', array( 'jquery' ), '20150115', true );
wp_enqueue_script( 'libretto-skip-link-focus-fix', get_template_directory_uri().'/js/skip-link-focus-fix.js', array(), '20130115', true );
wp_enqueue_script( 'libretto-touche', get_template_directory_uri() . '/js/touche.js', '20150604', true );
wp_enqueue_script( 'libretto-navigation', get_template_directory_uri() . '/js/navigation.js', array( 'jquery' ), '20150115', true );
wp_enqueue_script( 'libretto-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );
// Comments
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
@ -285,7 +316,7 @@ add_action( 'enqueue_block_editor_assets', 'libretto_editor_styles' );
function libretto_get_active_sidebars() {
// Loop through all possible sidebar areas to determine if they're active or not
$available_sidebars = array( 'sidebar-1', 'sidebar-2', 'sidebar-3', 'sidebar-4' );
$active_sidebars = array();
$active_sidebars = array();
foreach ( $available_sidebars as $sidebar_name ) :
if ( is_active_sidebar( $sidebar_name ) ) {
@ -306,29 +337,29 @@ function libretto_get_active_sidebars() {
* You can pass a variable to request a particular type of information. Default is URL.
*/
function libretto_get_header_image( $request = '' ) {
// If there's a featured image set for the post/page, use that
if ( libretto_has_post_thumbnail() && is_single() && libretto_jetpack_featured_image_display() ) :
$libretto_featured_image = libretto_get_attachment_image_src( get_the_ID(), get_post_thumbnail_id( get_the_ID() ), 'libretto-fullpage' );
$libretto_header_image = $libretto_featured_image;
$libretto_header_image_height = 1000;
// If there's a featured image set for the post/page, use that
if ( libretto_has_post_thumbnail() && is_single() && libretto_jetpack_featured_image_display() ) :
$libretto_featured_image = libretto_get_attachment_image_src( get_the_ID(), get_post_thumbnail_id( get_the_ID() ), 'libretto-fullpage' );
$libretto_header_image = $libretto_featured_image;
$libretto_header_image_height = 1000;
elseif ( has_post_thumbnail() && is_singular() && libretto_jetpack_featured_image_display() ) :
$libretto_featured_image = wp_get_attachment_image_src( get_post_thumbnail_id(), 'libretto-fullpage' );
$libretto_header_image = $libretto_featured_image[0];
$libretto_header_image_height = $libretto_featured_image[2];
// Otherwise, use the header image
$libretto_featured_image = wp_get_attachment_image_src( get_post_thumbnail_id(), 'libretto-fullpage' );
$libretto_header_image = $libretto_featured_image[0];
$libretto_header_image_height = $libretto_featured_image[2];
// Otherwise, use the header image
elseif ( get_header_image() ) :
$libretto_header_image = get_header_image();
$libretto_header_image_height = get_custom_header()->height;
$libretto_header_image = get_header_image();
$libretto_header_image_height = get_custom_header()->height;
endif;
// We'll return different information depending on the parameter passed
// This allows us to use the same function for two things
if ( isset( $libretto_header_image ) ) :
if ( 'height' === $request ) {
return $libretto_header_image_height;
} else {
return $libretto_header_image;
}
if ( 'height' === $request ) {
return $libretto_header_image_height;
} else {
return $libretto_header_image;
}
endif;
}

View file

@ -8,93 +8,108 @@
*/
if ( ! function_exists( 'lodestar_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the aftercomponentsetup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function lodestar_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on components, use a find and replace
* to change 'lodestar' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'lodestar', get_template_directory() . '/languages' );
// 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 <title> 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.
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
* Note that this function is hooked into the aftercomponentsetup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
add_theme_support( 'post-thumbnails' );
function lodestar_setup() {
add_image_size( 'lodestar-featured-image', 2000, 1200, true );
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on components, use a find and replace
* to change 'lodestar' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'lodestar', get_template_directory() . '/languages' );
add_image_size( 'lodestar-featured-archive-image', 700, 9999 );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
add_image_size( 'lodestar-portfolio-image', 2000, 9999 );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
add_image_size( 'lodestar-portfolio-archive-image', 900, 600, true );
/*
* 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( 'lodestar-thumbnail-avatar', 100, 100, true );
add_image_size( 'lodestar-featured-image', 2000, 1200, true );
add_image_size( 'lodestar-logo', 2400, 400 );
add_image_size( 'lodestar-featured-archive-image', 700, 9999 );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'top' => esc_html__( 'Top', 'lodestar' ),
) );
add_image_size( 'lodestar-portfolio-image', 2000, 9999 );
/*
* 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_image_size( 'lodestar-portfolio-archive-image', 900, 600, true );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'lodestar_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
add_image_size( 'lodestar-thumbnail-avatar', 100, 100, true );
// Add support to selectively refresh widgets in Customizer
add_theme_support( 'customize_selective_refresh_widgets' );
add_image_size( 'lodestar-logo', 2400, 400 );
// Add theme support for Custom Logo.
add_theme_support( 'custom-logo', array(
'width' => 2400,
'height' => 400,
'flex-width' => true,
'flex-height' => true,
'header-text' => array( 'site-title', 'site-description' ),
) );
// This theme uses wp_nav_menu() in one location.
register_nav_menus(
array(
'top' => esc_html__( 'Top', 'lodestar' ),
)
);
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
/*
* 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 support for full and wide align images.
add_theme_support( 'align-wide' );
}
// Set up the WordPress core custom background feature.
add_theme_support(
'custom-background',
apply_filters(
'lodestar_custom_background_args',
array(
'default-color' => 'ffffff',
'default-image' => '',
)
)
);
// Add support to selectively refresh widgets in Customizer
add_theme_support( 'customize_selective_refresh_widgets' );
// Add theme support for Custom Logo.
add_theme_support(
'custom-logo',
array(
'width' => 2400,
'height' => 400,
'flex-width' => true,
'flex-height' => true,
'header-text' => array( 'site-title', 'site-description' ),
)
);
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
// Add support for full and wide align images.
add_theme_support( 'align-wide' );
}
endif;
add_action( 'after_setup_theme', 'lodestar_setup' );
@ -115,14 +130,15 @@ add_action( 'after_setup_theme', 'lodestar_content_width', 0 );
*/
function lodestar_the_custom_logo() {
if ( has_custom_logo() ) {
$custom_logo_id = get_theme_mod( 'custom_logo' );
$custom_logo_id = get_theme_mod( 'custom_logo' );
$custom_logo_attr = array(
'class' => 'site-logo',
'itemprop' => 'logo',
);
printf( '<a href="%1$s" class="site-logo-link" rel="home" itemprop="url">%2$s</a>',
printf(
'<a href="%1$s" class="site-logo-link" rel="home" itemprop="url">%2$s</a>',
esc_url( home_url( '/' ) ),
wp_get_attachment_image( $custom_logo_id , 'lodestar-logo', false, $custom_logo_attr )
wp_get_attachment_image( $custom_logo_id, 'lodestar-logo', false, $custom_logo_attr )
);
}
}
@ -173,45 +189,53 @@ function lodestar_fonts_url() {
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function lodestar_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'lodestar' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Sidebar', 'lodestar' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Footer 1', 'lodestar' ),
'id' => 'sidebar-2',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Footer 1', 'lodestar' ),
'id' => 'sidebar-2',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Footer 2', 'lodestar' ),
'id' => 'sidebar-3',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Footer 2', 'lodestar' ),
'id' => 'sidebar-3',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Footer 3', 'lodestar' ),
'id' => 'sidebar-4',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Footer 3', 'lodestar' ),
'id' => 'sidebar-4',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
// echo esc_attr( lodestar_widget_column_class( 'sidebar-1' ) );
}
@ -240,7 +264,7 @@ add_filter( 'get_avatar', 'lodestar_get_avatar', 10, 5 );
function lodestar_front_page_template( $template ) {
return is_home() ? '' : $template;
}
add_filter( 'frontpage_template', 'lodestar_front_page_template' );
add_filter( 'frontpage_template', 'lodestar_front_page_template' );
/**

View file

@ -18,7 +18,6 @@ if ( ! function_exists( 'mayland_setup' ) ) :
* as indicating support for post thumbnails.
*/
function mayland_setup() {
// Add child theme editor styles, compiled from `style-child-theme-editor.scss`.
add_editor_style( 'style-editor.css' );

View file

@ -18,7 +18,6 @@ if ( ! function_exists( 'maywood_setup' ) ) :
* as indicating support for post thumbnails.
*/
function maywood_setup() {
// Add child theme editor styles, compiled from `style-child-theme-editor.scss`.
add_editor_style( 'style-editor.css' );

View file

@ -22,14 +22,14 @@ if ( ! function_exists( 'modern_business_setup' ) ) :
* @link https://codex.wordpress.org/Theme_Logo
*/
add_theme_support(
'custom-logo',
array(
'height' => 128,
'width' => 128,
'flex-width' => true,
'flex-height' => false,
'header-text' => array( 'site-title' ),
)
'custom-logo',
array(
'height' => 128,
'width' => 128,
'flex-width' => true,
'flex-height' => false,
'header-text' => array( 'site-title' ),
)
);
// Editor color palette.
@ -67,7 +67,6 @@ if ( ! function_exists( 'modern_business_setup' ) ) :
endif; // modern_business_setup
add_action( 'after_setup_theme', 'modern_business_setup', 30 );
function modern_business_fonts_url() {
$fonts_url = '';
/* Translators: If there are characters in your language that are not
@ -84,7 +83,7 @@ function modern_business_fonts_url() {
'family' => urlencode( implode( '|', $font_families ) ),
'subset' => urlencode( 'latin,latin-ext' ),
);
$fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
$fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
}
return esc_url_raw( $fonts_url );
}

View file

@ -30,7 +30,6 @@ if ( ! function_exists( 'morden_setup' ) ) :
* as indicating support for post thumbnails.
*/
function morden_setup() {
// Add child theme editor styles, compiled from `style-child-theme-editor.scss`.
add_editor_style( 'style-editor.css' );

View file

@ -6,109 +6,127 @@
*/
if ( ! function_exists( 'penscratch_2_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function penscratch_2_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Penscratch 2, use a find and replace
* to change 'penscratch-2' to the name of your theme in all the template files
*/
load_theme_textdomain( 'penscratch-2', get_template_directory() . '/languages' );
// 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 <title> 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.
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
add_theme_support( 'post-thumbnails' );
add_image_size( 'penscratch-2-featured', '656', '300', true );
function penscratch_2_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Penscratch 2, use a find and replace
* to change 'penscratch-2' to the name of your theme in all the template files
*/
load_theme_textdomain( 'penscratch-2', get_template_directory() . '/languages' );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'menu-1' => esc_html__( 'Header', 'penscratch-2' ),
) );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
add_editor_style( array( 'editor-style.css', penscratch_2_fonts_url() ) );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
/*
* 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 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( 'penscratch-2-featured', '656', '300', true );
// Enable support for custom logo.
add_theme_support( 'custom-logo', array(
'height' => 400,
'width' => 1200,
'flex-height' => true,
'flex-width' => true
) );
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
// Setup the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'penscratch_2_custom_background_args', array(
'default-color' => 'eeeeee',
'default-image' => '',
) ) );
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
// Add custom colors to Gutenberg
add_theme_support(
'editor-color-palette', array(
// This theme uses wp_nav_menu() in one location.
register_nav_menus(
array(
'name' => esc_html__( 'Dark Green', 'penscratch-2' ),
'slug' => 'dark-green',
'color' => '#1c7c7c',
),
array(
'name' => esc_html__( 'Dark Gray', 'penscratch-2' ),
'slug' => 'dark-gray',
'color' => '#666',
),
array(
'name' => esc_html__( 'Medium Gray', 'penscratch-2' ),
'slug' => 'medium-gray',
'color' => '#999',
),
array(
'name' => esc_html__( 'Light Gray', 'penscratch-2' ),
'slug' => 'light-gray',
'color' => '#eee',
),
array(
'name' => esc_html__( 'White', 'penscratch-2' ),
'slug' => 'white',
'color' => '#fff',
),
)
);
'menu-1' => esc_html__( 'Header', 'penscratch-2' ),
)
);
}
add_editor_style( array( 'editor-style.css', penscratch_2_fonts_url() ) );
/*
* 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 custom logo.
add_theme_support(
'custom-logo',
array(
'height' => 400,
'width' => 1200,
'flex-height' => true,
'flex-width' => true,
)
);
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
// Setup the WordPress core custom background feature.
add_theme_support(
'custom-background',
apply_filters(
'penscratch_2_custom_background_args',
array(
'default-color' => 'eeeeee',
'default-image' => '',
)
)
);
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
// Add custom colors to Gutenberg
add_theme_support(
'editor-color-palette',
array(
array(
'name' => esc_html__( 'Dark Green', 'penscratch-2' ),
'slug' => 'dark-green',
'color' => '#1c7c7c',
),
array(
'name' => esc_html__( 'Dark Gray', 'penscratch-2' ),
'slug' => 'dark-gray',
'color' => '#666',
),
array(
'name' => esc_html__( 'Medium Gray', 'penscratch-2' ),
'slug' => 'medium-gray',
'color' => '#999',
),
array(
'name' => esc_html__( 'Light Gray', 'penscratch-2' ),
'slug' => 'light-gray',
'color' => '#eee',
),
array(
'name' => esc_html__( 'White', 'penscratch-2' ),
'slug' => 'white',
'color' => '#fff',
),
)
);
}
endif; // penscratch_2_setup
add_action( 'after_setup_theme', 'penscratch_2_setup' );
@ -139,38 +157,46 @@ add_action( 'template_redirect', 'penscratch_2_adjust_content_width' );
* @link http://codex.wordpress.org/Function_Reference/register_sidebar
*/
function penscratch_2_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'penscratch-2' ),
'id' => 'sidebar-1',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 1', 'penscratch-2' ),
'id' => 'sidebar-2',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 2', 'penscratch-2' ),
'id' => 'sidebar-3',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 3', 'penscratch-2' ),
'id' => 'sidebar-4',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Sidebar', 'penscratch-2' ),
'id' => 'sidebar-1',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Footer 1', 'penscratch-2' ),
'id' => 'sidebar-2',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Footer 2', 'penscratch-2' ),
'id' => 'sidebar-3',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Footer 3', 'penscratch-2' ),
'id' => 'sidebar-4',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
)
);
}
add_action( 'widgets_init', 'penscratch_2_widgets_init' );
@ -211,7 +237,7 @@ add_action( 'enqueue_block_editor_assets', 'penscratch_2_block_editor_styles' );
* Register Google Fonts
*/
function penscratch_2_fonts_url() {
$fonts_url = '';
$fonts_url = '';
/* Translators: If there are characters in your language that are not
* supported by Roboto Slab, translate this to 'off'. Do not translate
@ -219,9 +245,9 @@ function penscratch_2_fonts_url() {
*/
$robotoslab = esc_html_x( 'on', 'Roboto Slab font: on or off', 'penscratch-2' );
if ( 'off' !== $robotoslab ) {
if ( 'off' !== $robotoslab ) {
$font_families = array();
$font_families = array();
$font_families[] = 'Roboto Slab:300,400,700';
$query_args = array(

View file

@ -55,19 +55,28 @@ if ( ! function_exists( 'photos_setup' ) ) :
* 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(
'html5',
array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
)
);
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'photos_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
add_theme_support(
'custom-background',
apply_filters(
'photos_custom_background_args',
array(
'default-color' => 'ffffff',
'default-image' => '',
)
)
);
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
@ -77,16 +86,19 @@ if ( ! function_exists( 'photos_setup' ) ) :
*
* @link https://codex.wordpress.org/Theme_Logo
*/
add_theme_support( 'custom-logo', array(
'height' => 360,
'width' => 720,
'flex-width' => true,
'flex-height' => true,
'header-text' => array(
'site-title',
'site-description',
),
) );
add_theme_support(
'custom-logo',
array(
'height' => 360,
'width' => 720,
'flex-width' => true,
'flex-height' => true,
'header-text' => array(
'site-title',
'site-description',
),
)
);
/* Gutenberg! */
add_theme_support( 'align-wide' );
@ -94,33 +106,36 @@ if ( ! function_exists( 'photos_setup' ) ) :
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
add_theme_support( 'editor-color-palette', array(
add_theme_support(
'editor-color-palette',
array(
'name' => esc_html__( 'red', 'photos' ),
'slug' => 'red',
'color' => '#d63031',
),
array(
'name' => esc_html__( 'charcoal', 'photos' ),
'slug' => 'charcoal',
'color' => '#111',
),
array(
'name' => esc_html__( 'very light gray', 'photos' ),
'slug' => 'very-light-gray',
'color' => '#f0f0f0',
),
array(
'name' => esc_html__( 'very dark gray', 'photos' ),
'slug' => 'very-dark-gray',
'color' => '#404040',
),
array(
'name' => esc_html__( 'medium gray', 'photos' ),
'slug' => 'medium-gray',
'color' => '#606060',
array(
'name' => esc_html__( 'red', 'photos' ),
'slug' => 'red',
'color' => '#d63031',
),
array(
'name' => esc_html__( 'charcoal', 'photos' ),
'slug' => 'charcoal',
'color' => '#111',
),
array(
'name' => esc_html__( 'very light gray', 'photos' ),
'slug' => 'very-light-gray',
'color' => '#f0f0f0',
),
array(
'name' => esc_html__( 'very dark gray', 'photos' ),
'slug' => 'very-dark-gray',
'color' => '#404040',
),
array(
'name' => esc_html__( 'medium gray', 'photos' ),
'slug' => 'medium-gray',
'color' => '#606060',
),
)
) );
);
}
endif;
@ -156,15 +171,17 @@ add_action( 'after_setup_theme', 'photos_content_width', 0 );
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function photos_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Footer', 'photos' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'These widgets will be displayed at the bottom of each page.', 'photos' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Footer', 'photos' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'These widgets will be displayed at the bottom of each page.', 'photos' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
}
add_action( 'widgets_init', 'photos_widgets_init' );
@ -191,7 +208,12 @@ function photos_scripts() {
wp_enqueue_script( 'photos-navigation', get_theme_file_uri( '/js/navigation.js' ), array( 'jquery' ), '1.0', true );
$photos_l10n['expand'] = esc_attr__( 'Expand child menu', 'photos' );
$photos_l10n['collapse'] = esc_attr__( 'Collapse child menu', 'photos' );
$photos_l10n['icon'] = photos_get_svg( array( 'icon' => 'expand', 'fallback' => true ) );
$photos_l10n['icon'] = photos_get_svg(
array(
'icon' => 'expand',
'fallback' => true,
)
);
wp_localize_script( 'photos-navigation', 'photosScreenReaderText', $photos_l10n );
@ -240,4 +262,3 @@ require get_template_directory() . '/inc/custom-header.php';
* SVG icons functions and filters.
*/
require get_template_directory() . '/inc/icon-functions.php';

View file

@ -45,44 +45,58 @@ if ( ! function_exists( 'pique_setup' ) ) :
add_image_size( 'pique-thumbnail-avatar', 100, 100, true );
// This theme uses wp_nav_menu() in three locations.
register_nav_menus( array(
'primary' => esc_html__( 'Primary Menu', 'pique' ),
'secondary' => esc_html__( 'Secondary Menu', 'pique' ),
) );
register_nav_menus(
array(
'primary' => esc_html__( 'Primary Menu', 'pique' ),
'secondary' => esc_html__( 'Secondary Menu', 'pique' ),
)
);
/*
* 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(
'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',
'chat',
'gallery',
'image',
'video',
'quote',
'link',
'status',
'audio',
) );
add_theme_support(
'post-formats',
array(
'aside',
'chat',
'gallery',
'image',
'video',
'quote',
'link',
'status',
'audio',
)
);
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'pique_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
add_theme_support(
'custom-background',
apply_filters(
'pique_custom_background_args',
array(
'default-color' => 'ffffff',
'default-image' => '',
)
)
);
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
@ -91,43 +105,46 @@ if ( ! function_exists( 'pique_setup' ) ) :
add_theme_support( 'align-wide' );
// Add support for custom color scheme.
add_theme_support( 'editor-color-palette', array(
add_theme_support(
'editor-color-palette',
array(
'name' => esc_html__( 'Dark Blue', 'pique' ),
'slug' => 'dark-blue',
'color' => '#293940',
),
array(
'name' => esc_html__( 'Medium Blue', 'pique' ),
'slug' => 'medium-blue',
'color' => '#3c7993',
),
array(
'name' => esc_html__( 'Light Blue', 'pique' ),
'slug' => 'light-blue',
'color' => '#83b6cc',
),
array(
'name' => esc_html__( 'Dark Brown', 'pique' ),
'slug' => 'dark-brown',
'color' => '#2d2a26',
),
array(
'name' => esc_html__( 'Dark Gray', 'pique' ),
'slug' => 'dark-gray',
'color' => '#5d5d5d',
),
array(
'name' => esc_html__( 'Medium Gray', 'pique' ),
'slug' => 'medium-gray',
'color' => '#a9a9a9',
),
array(
'name' => esc_html__( 'White', 'pique' ),
'slug' => 'white',
'color' => '#fff',
),
) );
array(
'name' => esc_html__( 'Dark Blue', 'pique' ),
'slug' => 'dark-blue',
'color' => '#293940',
),
array(
'name' => esc_html__( 'Medium Blue', 'pique' ),
'slug' => 'medium-blue',
'color' => '#3c7993',
),
array(
'name' => esc_html__( 'Light Blue', 'pique' ),
'slug' => 'light-blue',
'color' => '#83b6cc',
),
array(
'name' => esc_html__( 'Dark Brown', 'pique' ),
'slug' => 'dark-brown',
'color' => '#2d2a26',
),
array(
'name' => esc_html__( 'Dark Gray', 'pique' ),
'slug' => 'dark-gray',
'color' => '#5d5d5d',
),
array(
'name' => esc_html__( 'Medium Gray', 'pique' ),
'slug' => 'medium-gray',
'color' => '#a9a9a9',
),
array(
'name' => esc_html__( 'White', 'pique' ),
'slug' => 'white',
'color' => '#fff',
),
)
);
}
endif; // pique_setup
add_action( 'after_setup_theme', 'pique_setup' );
@ -163,45 +180,53 @@ add_action( 'template_redirect', 'pique_content_width_tweak' );
* @link http://codex.wordpress.org/Function_Reference/register_sidebar
*/
function pique_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'pique' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Add widgets here to appear in your sidebar', 'pique' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Sidebar', 'pique' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Add widgets here to appear in your sidebar', 'pique' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'First Footer Widget Area', 'pique' ),
'id' => 'sidebar-2',
'description' => esc_html__( 'Add widgets here to appear in your footer', 'pique' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'First Footer Widget Area', 'pique' ),
'id' => 'sidebar-2',
'description' => esc_html__( 'Add widgets here to appear in your footer', 'pique' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Second Footer Widget Area', 'pique' ),
'id' => 'sidebar-3',
'description' => esc_html__( 'Add widgets here to appear in your footer', 'pique' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Second Footer Widget Area', 'pique' ),
'id' => 'sidebar-3',
'description' => esc_html__( 'Add widgets here to appear in your footer', 'pique' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Third Footer Widget Area', 'pique' ),
'id' => 'sidebar-4',
'description' => esc_html__( 'Add widgets here to appear in your footer', 'pique' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Third Footer Widget Area', 'pique' ),
'id' => 'sidebar-4',
'description' => esc_html__( 'Add widgets here to appear in your footer', 'pique' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
}
add_action( 'widgets_init', 'pique_widgets_init' );
@ -321,7 +346,7 @@ function pique_query_vars( $qvars ) {
$qvars[] = 'pique_panel';
return $qvars;
}
add_filter( 'query_vars', 'pique_query_vars' , 10, 1 );
add_filter( 'query_vars', 'pique_query_vars', 10, 1 );
/**
* Get random posts; a simple, more efficient approach.
@ -329,11 +354,13 @@ add_filter( 'query_vars', 'pique_query_vars' , 10, 1 );
* Also it works better with heavy caching.
*/
function pique_get_random_posts( $number = 1, $post_type = 'post' ) {
$query = new WP_Query( array(
'posts_per_page' => 100,
'fields' => 'ids',
'post_type' => $post_type
) );
$query = new WP_Query(
array(
'posts_per_page' => 100,
'fields' => 'ids',
'post_type' => $post_type,
)
);
$post_ids = $query->posts;
@ -341,11 +368,13 @@ function pique_get_random_posts( $number = 1, $post_type = 'post' ) {
$post_ids = array_splice( $post_ids, 0, $number );
$random_posts = get_posts( array(
'post__in' => $post_ids,
'numberposts' => count( $post_ids ),
'post_type' => $post_type
) );
$random_posts = get_posts(
array(
'post__in' => $post_ids,
'numberposts' => count( $post_ids ),
'post_type' => $post_type,
)
);
return $random_posts;
}
@ -381,4 +410,3 @@ require get_template_directory() . '/inc/jetpack.php';
if ( class_exists( 'WooCommerce' ) ) {
require get_template_directory() . '/inc/woocommerce.php';
}

View file

@ -8,63 +8,62 @@
*/
if ( ! function_exists( 'professional_business_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function professional_business_setup() {
/**
* Add support for core custom logo.
* Sets up theme defaults and registers support for various WordPress features.
*
* @link https://codex.wordpress.org/Theme_Logo
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
add_theme_support(
'custom-logo',
array(
'height' => 120,
'width' => 190,
'flex-width' => true,
'flex-height' => false,
'header-text' => array( 'site-title' ),
)
);
function professional_business_setup() {
/**
* Add support for core custom logo.
*
* @link https://codex.wordpress.org/Theme_Logo
*/
add_theme_support(
'custom-logo',
array(
'height' => 120,
'width' => 190,
'flex-width' => true,
'flex-height' => false,
'header-text' => array( 'site-title' ),
)
);
// Editor color palette.
add_theme_support(
'editor-color-palette',
array(
// Editor color palette.
add_theme_support(
'editor-color-palette',
array(
'name' => __( 'Primary', 'professional-business' ),
'slug' => 'primary',
'color' => '#0073aa', // $color__link
),
array(
'name' => __( 'Secondary', 'professional-business' ),
'slug' => 'secondary',
'color' => '#005077', // $color__border-link-hover
),
array(
'name' => __( 'Dark Gray', 'professional-business' ),
'slug' => 'dark-gray',
'color' => '#1e1e1e', // $color__text-main
),
array(
'name' => __( 'Light Gray', 'professional-business' ),
'slug' => 'light-gray',
'color' => '#767676', // $color__text-light
),
array(
'name' => __( 'White', 'professional-business' ),
'slug' => 'white',
'color' => '#ffffff',
),
)
);
}
array(
'name' => __( 'Primary', 'professional-business' ),
'slug' => 'primary',
'color' => '#0073aa', // $color__link
),
array(
'name' => __( 'Secondary', 'professional-business' ),
'slug' => 'secondary',
'color' => '#005077', // $color__border-link-hover
),
array(
'name' => __( 'Dark Gray', 'professional-business' ),
'slug' => 'dark-gray',
'color' => '#1e1e1e', // $color__text-main
),
array(
'name' => __( 'Light Gray', 'professional-business' ),
'slug' => 'light-gray',
'color' => '#767676', // $color__text-light
),
array(
'name' => __( 'White', 'professional-business' ),
'slug' => 'white',
'color' => '#ffffff',
),
)
);
}
endif; // professional_business_setup
add_action( 'after_setup_theme', 'professional_business_setup', 30 );

View file

@ -13,116 +13,129 @@ if ( version_compare( $GLOBALS['wp_version'], '4.1-alpha', '<' ) ) {
}
if ( ! function_exists( 'publication_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function publication_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Publication, use a find and replace
* to change 'publication' to the name of your theme in all the template files
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
load_theme_textdomain( 'publication', get_template_directory() . '/languages' );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
function publication_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Publication, use a find and replace
* to change 'publication' to the name of your theme in all the template files
*/
load_theme_textdomain( 'publication', get_template_directory() . '/languages' );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
// Add support for responsive embeds.
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
/**
* Gutenberg wide and full images support
*/
add_theme_support( 'align-wide' );
// Add custom colors to Gutenberg
add_theme_support(
'editor-color-palette', array(
'editor-color-palette',
array(
array(
'name' => esc_html__( 'Black', 'publication' ),
'slug' => 'black',
'slug' => 'black',
'color' => '#222',
),
array(
'name' => esc_html__( 'Dark Gray', 'publication' ),
'slug' => 'dark-gray',
'slug' => 'dark-gray',
'color' => '#474f53',
),
array(
'name' => esc_html__( 'Medium Gray', 'publication' ),
'slug' => 'medium-gray',
'slug' => 'medium-gray',
'color' => '#a5a29d',
),
array(
'name' => esc_html__( 'Light Gray', 'publication' ),
'slug' => 'light-gray',
'slug' => 'light-gray',
'color' => '#eeece8',
),
array(
'name' => esc_html__( 'White', 'publication' ),
'slug' => 'white',
'slug' => 'white',
'color' => '#ffffff',
),
array(
'name' => esc_html__( 'Orange', 'publication' ),
'slug' => 'orange',
'slug' => 'orange',
'color' => '#ef7d0b',
),
array(
'name' => esc_html__( 'Dark Orange', 'publication' ),
'slug' => 'dark-orange',
'slug' => 'dark-orange',
'color' => '#9c8012',
),
)
);
/*
* 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' );
set_post_thumbnail_size( 144, 144, true );
add_image_size( 'publication-hero', 2000, 1500, true );
add_image_size( 'publication-navigation', 1055, 132, true );
/*
* 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' );
set_post_thumbnail_size( 144, 144, true );
add_image_size( 'publication-hero', 2000, 1500, true );
add_image_size( 'publication-navigation', 1055, 132, true );
// This theme uses wp_nav_menu() in two locations.
register_nav_menus( array(
'primary' => esc_html__( 'Primary Menu', 'publication' ),
'social' => esc_html__( 'Social Menu', 'publication' ),
) );
// This theme uses wp_nav_menu() in two locations.
register_nav_menus(
array(
'primary' => esc_html__( 'Primary Menu', 'publication' ),
'social' => esc_html__( 'Social Menu', 'publication' ),
)
);
/*
* 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',
) );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'publication_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
}
/*
* 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',
)
);
// Set up the WordPress core custom background feature.
add_theme_support(
'custom-background',
apply_filters(
'publication_custom_background_args',
array(
'default-color' => 'ffffff',
'default-image' => '',
)
)
);
}
endif; // publication_setup
add_action( 'after_setup_theme', 'publication_setup' );
@ -144,24 +157,28 @@ add_action( 'after_setup_theme', 'publication_content_width', 0 );
* @link http://codex.wordpress.org/Function_Reference/register_sidebar
*/
function publication_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar One', 'publication' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar( array(
'name' => esc_html__( 'Sidebar Two', 'publication' ),
'id' => 'sidebar-2',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Sidebar One', 'publication' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Sidebar Two', 'publication' ),
'id' => 'sidebar-2',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
}
add_action( 'widgets_init', 'publication_widgets_init' );
@ -198,7 +215,7 @@ function publication_lato_neuton_fonts_url() {
'family' => urlencode( implode( '|', $font_families ) ),
'subset' => urlencode( 'latin,latin-ext' ), // add extra subset
);
$fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
$fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
}
return $fonts_url;
@ -237,7 +254,7 @@ function publication_oswald_inconsolata_fonts_url() {
'family' => urlencode( implode( '|', $font_families ) ),
'subset' => urlencode( 'latin,latin-ext' ), // add extra subset
);
$fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
$fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
}
return $fonts_url;
@ -270,10 +287,14 @@ function publication_scripts() {
wp_enqueue_script( 'comment-reply' );
}
wp_localize_script( 'publication-script', 'screenReaderText', array(
'expand' => '<span class="screen-reader-text">' . __( 'expand child menu', 'publication' ) . '</span>',
'collapse' => '<span class="screen-reader-text">' . __( 'collapse child menu', 'publication' ) . '</span>',
) );
wp_localize_script(
'publication-script',
'screenReaderText',
array(
'expand' => '<span class="screen-reader-text">' . __( 'expand child menu', 'publication' ) . '</span>',
'collapse' => '<span class="screen-reader-text">' . __( 'collapse child menu', 'publication' ) . '</span>',
)
);
}
add_action( 'wp_enqueue_scripts', 'publication_scripts' );
@ -281,7 +302,7 @@ add_action( 'wp_enqueue_scripts', 'publication_scripts' );
* Gutenberg Editor Styles
*/
function publication_editor_styles() {
wp_enqueue_style( 'publication-editor-block-style', get_template_directory_uri() . '/editor-blocks.css');
wp_enqueue_style( 'publication-editor-block-style', get_template_directory_uri() . '/editor-blocks.css' );
wp_enqueue_style( 'publication-lato-neuton', publication_lato_neuton_fonts_url() );
wp_enqueue_style( 'publication-oswald-inconsolata', publication_oswald_inconsolata_fonts_url() );
}

View file

@ -8,194 +8,221 @@
*/
if ( ! function_exists( 'radcliffe_2_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function radcliffe_2_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on _s, use a find and replace
* to change 'radcliffe-2' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'radcliffe-2', get_template_directory() . '/languages' );
// 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 <title> 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.
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
add_theme_support( 'post-thumbnails' );
add_image_size( 'radcliffe-post-image', 2000, 1500 );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'menu-1' => esc_html__( 'Header', 'radcliffe-2' ),
) );
function radcliffe_2_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on _s, use a find and replace
* to change 'radcliffe-2' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'radcliffe-2', get_template_directory() . '/languages' );
/*
* 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 default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
// 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' ),
) );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'radcliffe_2_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
/*
* 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( 'radcliffe-post-image', 2000, 1500 );
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
// Gutenberg: Add Custom Palette
$stylepack = get_theme_mod( 'active_style_pack' );
if ( 'vintage' === $stylepack ) {
add_theme_support( 'editor-color-palette', array(
// This theme uses wp_nav_menu() in one location.
register_nav_menus(
array(
'name' => esc_html__( 'Vintage Off-White', 'radcliffe-2' ),
'slug' => 'vintage-off-white',
'color' => '#fff',
),
array(
'name' => esc_html__( 'Vintage Light Brown', 'radcliffe-2' ),
'slug' => 'vintage-light-brown',
'color' => '#c7c4b4',
),
array(
'name' => esc_html__( 'Vintage Light Gray', 'radcliffe-2' ),
'slug' => 'vintage-light-gray',
'color' => '#666',
),
array(
'name' => esc_html__( 'Vintage Dark Gray', 'radcliffe-2' ),
'slug' => 'vintage-dark-gray',
'color' => '#222',
),
array(
'name' => esc_html__( 'Vintage Blue', 'radcliffe-2' ),
'slug' => 'vintage-blue',
'color' => '#2b6e9d',
'menu-1' => esc_html__( 'Header', 'radcliffe-2' ),
)
) );
} else if ( 'colorful' === $stylepack ) {
add_theme_support( 'editor-color-palette', array(
);
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support(
'html5',
array(
'name' => esc_html__( 'Colorful White', 'radcliffe-2' ),
'slug' => 'colorful-white',
'color' => '#fff',
),
array(
'name' => esc_html__( 'Colorful Light Gray', 'radcliffe-2' ),
'slug' => 'colorful-light-gray',
'color' => '#e5e5e5',
),
array(
'name' => esc_html__( 'Colorful Dark Gray', 'radcliffe-2' ),
'slug' => 'colorful-dark-gray',
'color' => '#222222',
),
array(
'name' => esc_html__( 'Colorful Blue', 'radcliffe-2' ),
'slug' => 'colorful-blue',
'color' => '#4ba3c3',
),
array(
'name' => esc_html__( 'Colorful Green', 'radcliffe-2' ),
'slug' => 'colorful-green',
'color' => '#71db9d',
),
array(
'name' => esc_html__( 'Colorful Orange', 'radcliffe-2' ),
'slug' => 'colorful-orange',
'color' => '#d97059',
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
)
) );
} else if ( 'modern' === $stylepack ) {
add_theme_support( 'editor-color-palette', array(
);
// Add theme support for Custom Logo.
add_theme_support(
'custom-logo',
array(
'name' => esc_html__( 'Modern White', 'radcliffe-2' ),
'slug' => 'modern-white',
'color' => '#fff',
),
array(
'name' => esc_html__( 'Modern Light Gray', 'radcliffe-2' ),
'slug' => 'modern-light-gray',
'color' => '#f1f1f1',
),
array(
'name' => esc_html__( 'Modern Medium Gray', 'radcliffe-2' ),
'slug' => 'modern-medium-gray',
'color' => '#aaa',
),
array(
'name' => esc_html__( 'Modern Dark Gray', 'radcliffe-2' ),
'slug' => 'modern-dark-gray',
'color' => '#222',
'width' => 1200,
'height' => 900,
'flex-width' => true,
'flex-height' => true,
'header-text' => array( 'site-title', 'site-description' ),
)
) );
} else {
add_theme_support( 'editor-color-palette', array(
array(
'name' => esc_html__( 'White', 'radcliffe-2' ),
'slug' => 'white',
'color' => '#fff',
),
array(
'name' => esc_html__( 'Dark Gray', 'radcliffe-2' ),
'slug' => 'dark-gray',
'color' => '#222',
),
array(
'name' => esc_html__( 'Light Gray', 'radcliffe-2' ),
'slug' => 'light-gray',
'color' => '#666666',
),
array(
'name' => esc_html__( 'Red', 'radcliffe-2' ),
'slug' => 'red',
'color' => '#ca2017',
);
// Set up the WordPress core custom background feature.
add_theme_support(
'custom-background',
apply_filters(
'radcliffe_2_custom_background_args',
array(
'default-color' => 'ffffff',
'default-image' => '',
)
)
) );
);
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
// Gutenberg: Add Custom Palette
$stylepack = get_theme_mod( 'active_style_pack' );
if ( 'vintage' === $stylepack ) {
add_theme_support(
'editor-color-palette',
array(
array(
'name' => esc_html__( 'Vintage Off-White', 'radcliffe-2' ),
'slug' => 'vintage-off-white',
'color' => '#fff',
),
array(
'name' => esc_html__( 'Vintage Light Brown', 'radcliffe-2' ),
'slug' => 'vintage-light-brown',
'color' => '#c7c4b4',
),
array(
'name' => esc_html__( 'Vintage Light Gray', 'radcliffe-2' ),
'slug' => 'vintage-light-gray',
'color' => '#666',
),
array(
'name' => esc_html__( 'Vintage Dark Gray', 'radcliffe-2' ),
'slug' => 'vintage-dark-gray',
'color' => '#222',
),
array(
'name' => esc_html__( 'Vintage Blue', 'radcliffe-2' ),
'slug' => 'vintage-blue',
'color' => '#2b6e9d',
),
)
);
} elseif ( 'colorful' === $stylepack ) {
add_theme_support(
'editor-color-palette',
array(
array(
'name' => esc_html__( 'Colorful White', 'radcliffe-2' ),
'slug' => 'colorful-white',
'color' => '#fff',
),
array(
'name' => esc_html__( 'Colorful Light Gray', 'radcliffe-2' ),
'slug' => 'colorful-light-gray',
'color' => '#e5e5e5',
),
array(
'name' => esc_html__( 'Colorful Dark Gray', 'radcliffe-2' ),
'slug' => 'colorful-dark-gray',
'color' => '#222222',
),
array(
'name' => esc_html__( 'Colorful Blue', 'radcliffe-2' ),
'slug' => 'colorful-blue',
'color' => '#4ba3c3',
),
array(
'name' => esc_html__( 'Colorful Green', 'radcliffe-2' ),
'slug' => 'colorful-green',
'color' => '#71db9d',
),
array(
'name' => esc_html__( 'Colorful Orange', 'radcliffe-2' ),
'slug' => 'colorful-orange',
'color' => '#d97059',
),
)
);
} elseif ( 'modern' === $stylepack ) {
add_theme_support(
'editor-color-palette',
array(
array(
'name' => esc_html__( 'Modern White', 'radcliffe-2' ),
'slug' => 'modern-white',
'color' => '#fff',
),
array(
'name' => esc_html__( 'Modern Light Gray', 'radcliffe-2' ),
'slug' => 'modern-light-gray',
'color' => '#f1f1f1',
),
array(
'name' => esc_html__( 'Modern Medium Gray', 'radcliffe-2' ),
'slug' => 'modern-medium-gray',
'color' => '#aaa',
),
array(
'name' => esc_html__( 'Modern Dark Gray', 'radcliffe-2' ),
'slug' => 'modern-dark-gray',
'color' => '#222',
),
)
);
} else {
add_theme_support(
'editor-color-palette',
array(
array(
'name' => esc_html__( 'White', 'radcliffe-2' ),
'slug' => 'white',
'color' => '#fff',
),
array(
'name' => esc_html__( 'Dark Gray', 'radcliffe-2' ),
'slug' => 'dark-gray',
'color' => '#222',
),
array(
'name' => esc_html__( 'Light Gray', 'radcliffe-2' ),
'slug' => 'light-gray',
'color' => '#666666',
),
array(
'name' => esc_html__( 'Red', 'radcliffe-2' ),
'slug' => 'red',
'color' => '#ca2017',
),
)
);
}
// Add support for wide alignment
add_theme_support( 'align-wide' );
}
// Add support for wide alignment
add_theme_support( 'align-wide' );
}
endif;
add_action( 'after_setup_theme', 'radcliffe_2_setup' );
@ -217,35 +244,41 @@ add_action( 'after_setup_theme', 'radcliffe_2_content_width', 0 );
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function radcliffe_2_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Footer 1', 'radcliffe-2' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Footer 1', 'radcliffe-2' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Footer 2', 'radcliffe-2' ),
'id' => 'sidebar-2',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Footer 2', 'radcliffe-2' ),
'id' => 'sidebar-2',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Footer 3', 'radcliffe-2' ),
'id' => 'sidebar-3',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Footer 3', 'radcliffe-2' ),
'id' => 'sidebar-3',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
}
add_action( 'widgets_init', 'radcliffe_2_widgets_init' );
@ -265,12 +298,16 @@ function radcliffe_2_scripts() {
wp_enqueue_script( 'radcliffe-2-navigation', get_template_directory_uri() . '/assets/js/navigation.js', array(), '20151215', true );
wp_localize_script( 'radcliffe-2-navigation', 'screenReaderText', array(
'expand' => esc_html__( 'Expand child menu', 'radcliffe-2' ),
'collapse' => esc_html__( 'Collapse child menu', 'radcliffe-2' ),
'icon_expand' => radcliffe_2_get_svg( array( 'icon' => 'expand' ) ),
'icon_zoom' => radcliffe_2_get_svg( array( 'icon' => 'zoom' ) ),
) );
wp_localize_script(
'radcliffe-2-navigation',
'screenReaderText',
array(
'expand' => esc_html__( 'Expand child menu', 'radcliffe-2' ),
'collapse' => esc_html__( 'Collapse child menu', 'radcliffe-2' ),
'icon_expand' => radcliffe_2_get_svg( array( 'icon' => 'expand' ) ),
'icon_zoom' => radcliffe_2_get_svg( array( 'icon' => 'zoom' ) ),
)
);
wp_enqueue_script( 'radcliffe-2-skip-link-focus-fix', get_template_directory_uri() . '/assets/js/skip-link-focus-fix.js', array(), '20151215', true );
@ -293,9 +330,9 @@ function radcliffe_2_editor_styles() {
if ( 'colorful' === $stylepack ) {
wp_enqueue_style( 'radcliffe-2-editor-style-colorful', get_template_directory_uri() . '/assets/css/editor-style-colorful.css' );
} else if ( 'modern' === $stylepack ) {
} elseif ( 'modern' === $stylepack ) {
wp_enqueue_style( 'radcliffe-2-editor-style-modern', get_template_directory_uri() . '/assets/css/editor-style-modern.css' );
} else if ( 'vintage' === $stylepack ) {
} elseif ( 'vintage' === $stylepack ) {
wp_enqueue_style( 'radcliffe-2-editor-style-vintage', get_template_directory_uri() . '/assets/css/editor-style-vintage.css' );
}

View file

@ -8,138 +8,157 @@
*/
if ( ! function_exists( 'rebalance_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function rebalance_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on rebalance, use a find and replace
* to change 'rebalance' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'rebalance', get_template_directory() . '/languages' );
// 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 <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
// Add custom colors to Gutenberg
add_theme_support(
'editor-color-palette', array(
array(
'name' => esc_html__( 'Black', 'rebalance' ),
'slug' => 'black',
'color' => '#000000',
),
array(
'name' => esc_html__( 'Dark Gray', 'rebalance' ),
'slug' => 'dark-gray',
'color' => '#666666',
),
array(
'name' => esc_html__( 'Medium Gray', 'rebalance' ),
'slug' => 'medium-gray',
'color' => '#999999',
),
array(
'name' => esc_html__( 'Light Gray', 'rebalance' ),
'slug' => 'light-gray',
'color' => '#cccccc',
),
array(
'name' => esc_html__( 'White', 'rebalance' ),
'slug' => 'white',
'color' => '#ffffff',
),
array(
'name' => esc_html__( 'Red', 'rebalance' ),
'slug' => 'red',
'color' => '#f35029',
),
array(
'name' => esc_html__( 'Dark Red', 'rebalance' ),
'slug' => 'dark-red',
'color' => '#aa2e11',
),
)
);
/**
* Add support for core custom logo (replaces JetPack functionality)
* - also see fallback in inc/jetpack.php
*/
add_theme_support( 'custom-logo', array(
'height' => 80,
'width' => 80,
'flex-width' => true,
'header-text' => array(
'site-title',
'site-description'
),
) );
/*
* Enable support for Post Thumbnails on posts and pages.
* Sets up theme defaults and registers support for various WordPress features.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 720, 1200 );
add_image_size( 'rebalance-archive', 560, 9999 );
/*
* This theme uses wp_nav_menu() in one location.
*/
register_nav_menus( array(
'header' => esc_html__( 'Header Menu', 'rebalance' ),
'social' => esc_html__( 'Social Menu', 'rebalance' )
) );
function rebalance_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on rebalance, use a find and replace
* to change 'rebalance' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'rebalance', get_template_directory() . '/languages' );
/*
* 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 default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/*
* Enable support for Post Formats.
* See https://developer.wordpress.org/themes/functionality/post-formats/
*/
add_theme_support( 'post-formats', array(
'aside',
'image',
'video',
'quote',
'link',
) );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'rebalance_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
}
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
// Add custom colors to Gutenberg
add_theme_support(
'editor-color-palette',
array(
array(
'name' => esc_html__( 'Black', 'rebalance' ),
'slug' => 'black',
'color' => '#000000',
),
array(
'name' => esc_html__( 'Dark Gray', 'rebalance' ),
'slug' => 'dark-gray',
'color' => '#666666',
),
array(
'name' => esc_html__( 'Medium Gray', 'rebalance' ),
'slug' => 'medium-gray',
'color' => '#999999',
),
array(
'name' => esc_html__( 'Light Gray', 'rebalance' ),
'slug' => 'light-gray',
'color' => '#cccccc',
),
array(
'name' => esc_html__( 'White', 'rebalance' ),
'slug' => 'white',
'color' => '#ffffff',
),
array(
'name' => esc_html__( 'Red', 'rebalance' ),
'slug' => 'red',
'color' => '#f35029',
),
array(
'name' => esc_html__( 'Dark Red', 'rebalance' ),
'slug' => 'dark-red',
'color' => '#aa2e11',
),
)
);
/**
* Add support for core custom logo (replaces JetPack functionality)
* - also see fallback in inc/jetpack.php
*/
add_theme_support(
'custom-logo',
array(
'height' => 80,
'width' => 80,
'flex-width' => true,
'header-text' => array(
'site-title',
'site-description',
),
)
);
/*
* 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' );
set_post_thumbnail_size( 720, 1200 );
add_image_size( 'rebalance-archive', 560, 9999 );
/*
* This theme uses wp_nav_menu() in one location.
*/
register_nav_menus(
array(
'header' => esc_html__( 'Header Menu', 'rebalance' ),
'social' => esc_html__( 'Social Menu', 'rebalance' ),
)
);
/*
* 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',
'image',
'video',
'quote',
'link',
)
);
// Set up the WordPress core custom background feature.
add_theme_support(
'custom-background',
apply_filters(
'rebalance_custom_background_args',
array(
'default-color' => 'ffffff',
'default-image' => '',
)
)
);
}
endif; // rebalance_setup
add_action( 'after_setup_theme', 'rebalance_setup' );
@ -161,15 +180,17 @@ add_action( 'after_setup_theme', 'rebalance_content_width', 0 );
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function rebalance_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Footer', 'rebalance' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Footer', 'rebalance' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
}
add_action( 'widgets_init', 'rebalance_widgets_init' );
@ -241,9 +262,13 @@ function rebalance_scripts() {
wp_enqueue_script( 'rebalance-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20151112', true );
wp_enqueue_script( 'rebalance-theme-scripts', get_template_directory_uri() . '/js/scripts.js', array( 'jquery', 'columnlist', 'masonry' ), '20151130', true );
wp_localize_script( 'rebalance-theme-scripts', 'Rebalance', array(
'is_rtl' => ( 'rtl' == get_option( 'text_direction' ) ) ? 1 : 0,
) );
wp_localize_script(
'rebalance-theme-scripts',
'Rebalance',
array(
'is_rtl' => ( 'rtl' == get_option( 'text_direction' ) ) ? 1 : 0,
)
);
wp_enqueue_script( 'rebalance-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20151112', true );
@ -251,10 +276,14 @@ function rebalance_scripts() {
wp_enqueue_script( 'comment-reply' );
}
wp_localize_script( 'rebalance-navigation', 'rebalanceScreenReaderText', array(
'expand' => esc_html__( 'expand child menu', 'rebalance' ),
'collapse' => esc_html__( 'collapse child menu', 'rebalance' ),
) );
wp_localize_script(
'rebalance-navigation',
'rebalanceScreenReaderText',
array(
'expand' => esc_html__( 'expand child menu', 'rebalance' ),
'collapse' => esc_html__( 'collapse child menu', 'rebalance' ),
)
);
}
add_action( 'wp_enqueue_scripts', 'rebalance_scripts' );
@ -262,7 +291,7 @@ add_action( 'wp_enqueue_scripts', 'rebalance_scripts' );
* Gutenberg Editor Styles
*/
function rebalance_editor_styles() {
wp_enqueue_style( 'rebalance-editor-block-style', get_template_directory_uri() . '/editor-blocks.css');
wp_enqueue_style( 'rebalance-editor-block-style', get_template_directory_uri() . '/editor-blocks.css' );
wp_enqueue_style( 'rebalance-fonts', rebalance_fonts_url(), array(), null );
}
add_action( 'enqueue_block_editor_assets', 'rebalance_editor_styles' );
@ -270,8 +299,8 @@ add_action( 'enqueue_block_editor_assets', 'rebalance_editor_styles' );
/**
* Check whether the browser supports JavaScript
*/
function rebalance_html_js_class () {
echo '<script>document.documentElement.className = document.documentElement.className.replace("no-js","js");</script>'. "\n";
function rebalance_html_js_class() {
echo '<script>document.documentElement.className = document.documentElement.className.replace("no-js","js");</script>' . "\n";
}
add_action( 'wp_head', 'rebalance_html_js_class', 1 );

View file

@ -17,7 +17,6 @@ if ( ! function_exists( 'redhill_theme_setup' ) ) :
* as indicating support for post thumbnails.
*/
function redhill_theme_setup() {
// Add child theme editor styles, compiled from `style-child-theme-editor.scss`.
add_editor_style( 'style-editor.css' );

View file

@ -18,7 +18,6 @@ if ( ! function_exists( 'rivington_setup' ) ) :
* as indicating support for post thumbnails.
*/
function rivington_setup() {
// Add child theme editor styles, compiled from `style-child-theme-editor.scss`.
add_editor_style( 'style-editor.css' );

View file

@ -30,7 +30,6 @@ if ( ! function_exists( 'rockfield_setup' ) ) :
* as indicating support for post thumbnails.
*/
function rockfield_setup() {
// Add child theme editor styles, compiled from `style-child-theme-editor.scss`.
add_editor_style( 'style-editor.css' );
@ -132,7 +131,7 @@ function rockfield_scripts() {
wp_dequeue_style( 'varia-style' );
// enqueue child styles
wp_enqueue_style('rockfield-style', get_stylesheet_uri(), array(), wp_get_theme()->get( 'Version' ));
wp_enqueue_style( 'rockfield-style', get_stylesheet_uri(), array(), wp_get_theme()->get( 'Version' ) );
// enqueue child RTL styles
wp_style_add_data( 'rockfield-style', 'rtl', 'replace' );

View file

@ -8,134 +8,150 @@
*/
if ( ! function_exists( 'scratchpad_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function scratchpad_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Scratchpad, use a find and replace
* to change 'scratchpad' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'scratchpad', get_template_directory() . '/languages' );
// 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 <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
// Add custom colors to Gutenberg
add_theme_support(
'editor-color-palette', array(
array(
'name' => esc_html__( 'Black', 'scratchpad' ),
'slug' => 'black',
'color' => '#222222',
),
array(
'name' => esc_html__( 'Dark Gray', 'scratchpad' ),
'slug' => 'dark-gray',
'color' => '#777777',
),
array(
'name' => esc_html__( 'Medium Gray', 'scratchpad' ),
'slug' => 'medium-gray',
'color' => '#999999',
),
array(
'name' => esc_html__( 'Light Gray', 'scratchpad' ),
'slug' => 'light-gray',
'color' => '#bdcbcc',
),
array(
'name' => esc_html__( 'White', 'scratchpad' ),
'slug' => 'white',
'color' => '#ffffff',
),
array(
'name' => esc_html__( 'Blue', 'scratchpad' ),
'slug' => 'blue',
'color' => '#7ba6a9',
),
array(
'name' => esc_html__( 'Dark Blue', 'scratchpad' ),
'slug' => 'dark-blue',
'color' => '#537375',
),
array(
'name' => esc_html__( 'Orange', 'scratchpad' ),
'slug' => 'orange',
'color' => '#d16221',
),
array(
'name' => esc_html__( 'Yellow', 'scratchpad' ),
'slug' => 'yellow',
'color' => '#e4b500',
),
)
);
/*
* Enable support for Post Thumbnails on posts and pages.
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* @link https://developer.wordpress.org/themes/functionality/featuBlue-images-post-thumbnails/
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
add_theme_support( 'post-thumbnails' );
add_image_size( 'scratchpad-avatar', 85, 85, true );
add_image_size( 'scratchpad-featuBlue', 1000, 9999 );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => esc_html__( 'Header Menu', 'scratchpad' ),
) );
function scratchpad_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Scratchpad, use a find and replace
* to change 'scratchpad' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'scratchpad', get_template_directory() . '/languages' );
/*
* 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 default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/*
* Enable support for Post Formats.
* See https://developer.wordpress.org/themes/functionality/post-formats/
*/
add_theme_support( 'post-formats', array(
'aside',
'audio',
'gallery',
'image',
'link',
'quote',
'status',
'video',
) );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'scratchpad_custom_background_args', array(
'default-color' => 'bdcbcc',
'default-image' => '',
) ) );
}
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
// Add custom colors to Gutenberg
add_theme_support(
'editor-color-palette',
array(
array(
'name' => esc_html__( 'Black', 'scratchpad' ),
'slug' => 'black',
'color' => '#222222',
),
array(
'name' => esc_html__( 'Dark Gray', 'scratchpad' ),
'slug' => 'dark-gray',
'color' => '#777777',
),
array(
'name' => esc_html__( 'Medium Gray', 'scratchpad' ),
'slug' => 'medium-gray',
'color' => '#999999',
),
array(
'name' => esc_html__( 'Light Gray', 'scratchpad' ),
'slug' => 'light-gray',
'color' => '#bdcbcc',
),
array(
'name' => esc_html__( 'White', 'scratchpad' ),
'slug' => 'white',
'color' => '#ffffff',
),
array(
'name' => esc_html__( 'Blue', 'scratchpad' ),
'slug' => 'blue',
'color' => '#7ba6a9',
),
array(
'name' => esc_html__( 'Dark Blue', 'scratchpad' ),
'slug' => 'dark-blue',
'color' => '#537375',
),
array(
'name' => esc_html__( 'Orange', 'scratchpad' ),
'slug' => 'orange',
'color' => '#d16221',
),
array(
'name' => esc_html__( 'Yellow', 'scratchpad' ),
'slug' => 'yellow',
'color' => '#e4b500',
),
)
);
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link https://developer.wordpress.org/themes/functionality/featuBlue-images-post-thumbnails/
*/
add_theme_support( 'post-thumbnails' );
add_image_size( 'scratchpad-avatar', 85, 85, true );
add_image_size( 'scratchpad-featuBlue', 1000, 9999 );
// This theme uses wp_nav_menu() in one location.
register_nav_menus(
array(
'primary' => esc_html__( 'Header Menu', 'scratchpad' ),
)
);
/*
* 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',
'audio',
'gallery',
'image',
'link',
'quote',
'status',
'video',
)
);
// Set up the WordPress core custom background feature.
add_theme_support(
'custom-background',
apply_filters(
'scratchpad_custom_background_args',
array(
'default-color' => 'bdcbcc',
'default-image' => '',
)
)
);
}
endif;
add_action( 'after_setup_theme', 'scratchpad_setup' );
@ -157,25 +173,29 @@ add_action( 'after_setup_theme', 'scratchpad_content_width', 0 );
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function scratchpad_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'scratchpad' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Sidebar', 'scratchpad' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Footer', 'scratchpad' ),
'id' => 'sidebar-2',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Footer', 'scratchpad' ),
'id' => 'sidebar-2',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
}
add_action( 'widgets_init', 'scratchpad_widgets_init' );

View file

@ -33,4 +33,4 @@ add_action( 'after_setup_theme', 'seedlet_blocks_setup', 11 );
function seedlet_blocks_enqueue() {
wp_enqueue_style( 'seedlet-blocks-styles', get_stylesheet_uri() );
}
add_action( 'wp_enqueue_scripts', 'seedlet_blocks_enqueue', 11 );
add_action( 'wp_enqueue_scripts', 'seedlet_blocks_enqueue', 11 );

View file

@ -24,6 +24,7 @@ if ( ! function_exists( 'seedlet_setup' ) ) :
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function seedlet_setup() {
/*
* Make theme available for translation.

View file

@ -30,7 +30,6 @@ if ( ! function_exists( 'shawburn_setup' ) ) :
* as indicating support for post thumbnails.
*/
function shawburn_setup() {
// Add child theme editor styles, compiled from `style-child-theme-editor.scss`.
add_editor_style( 'style-editor.css' );

View file

@ -8,112 +8,130 @@
*/
if ( ! function_exists( 'shoreditch_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function shoreditch_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Shoreditch, use a find and replace
* to change 'shoreditch' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'shoreditch', get_template_directory() . '/languages' );
// 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 <title> 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' );
set_post_thumbnail_size( 2000, 1500, true );
// Enable support for custom logo.
add_theme_support( 'custom-logo', array(
'height' => 480,
'width' => 480,
'flex-height' => true,
) );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => esc_html__( 'Primary', 'shoreditch' ),
) );
/*
* 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',
) );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'shoreditch_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
/**
* Add support for Eventbrite.
* See: https://wordpress.org/plugins/eventbrite-api/
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
add_theme_support( 'eventbrite' );
function shoreditch_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Shoreditch, use a find and replace
* to change 'shoreditch' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'shoreditch', get_template_directory() . '/languages' );
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
// Add support for full and wide align images.
add_theme_support( 'align-wide' );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
// Add support for custom color scheme.
add_theme_support( 'editor-color-palette', array(
array(
'name' => esc_html__( 'Blue', 'shoreditch' ),
'slug' => 'blue',
'color' => '#3e69dc',
),
array(
'name' => esc_html__( 'Dark Gray', 'shoreditch' ),
'slug' => 'dark-gray',
'color' => '#2c313f',
),
array(
'name' => esc_html__( 'Medium Gray', 'shoreditch' ),
'slug' => 'medium-gray',
'color' => '#73757D',
),
array(
'name' => esc_html__( 'Light Gray', 'shoreditch' ),
'slug' => 'light-gray',
'color' => '#f3f3f3',
),
array(
'name' => esc_html__( 'White', 'shoreditch' ),
'slug' => 'white',
'color' => '#fff',
),
) );
}
/*
* 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' );
set_post_thumbnail_size( 2000, 1500, true );
// Enable support for custom logo.
add_theme_support(
'custom-logo',
array(
'height' => 480,
'width' => 480,
'flex-height' => true,
)
);
// This theme uses wp_nav_menu() in one location.
register_nav_menus(
array(
'primary' => esc_html__( 'Primary', 'shoreditch' ),
)
);
/*
* 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',
)
);
// Set up the WordPress core custom background feature.
add_theme_support(
'custom-background',
apply_filters(
'shoreditch_custom_background_args',
array(
'default-color' => 'ffffff',
'default-image' => '',
)
)
);
/**
* Add support for Eventbrite.
* See: https://wordpress.org/plugins/eventbrite-api/
*/
add_theme_support( 'eventbrite' );
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
// Add support for full and wide align images.
add_theme_support( 'align-wide' );
// Add support for custom color scheme.
add_theme_support(
'editor-color-palette',
array(
array(
'name' => esc_html__( 'Blue', 'shoreditch' ),
'slug' => 'blue',
'color' => '#3e69dc',
),
array(
'name' => esc_html__( 'Dark Gray', 'shoreditch' ),
'slug' => 'dark-gray',
'color' => '#2c313f',
),
array(
'name' => esc_html__( 'Medium Gray', 'shoreditch' ),
'slug' => 'medium-gray',
'color' => '#73757D',
),
array(
'name' => esc_html__( 'Light Gray', 'shoreditch' ),
'slug' => 'light-gray',
'color' => '#f3f3f3',
),
array(
'name' => esc_html__( 'White', 'shoreditch' ),
'slug' => 'white',
'color' => '#fff',
),
)
);
}
endif;
add_action( 'after_setup_theme', 'shoreditch_setup' );
@ -135,75 +153,84 @@ add_action( 'after_setup_theme', 'shoreditch_content_width', 0 );
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function shoreditch_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'shoreditch' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget widget-small %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Sidebar', 'shoreditch' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget widget-small %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Top Footer', 'shoreditch' ),
'id' => 'sidebar-2',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Top Footer', 'shoreditch' ),
'id' => 'sidebar-2',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Bottom Footer', 'shoreditch' ),
'id' => 'sidebar-3',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget widget-small %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Bottom Footer', 'shoreditch' ),
'id' => 'sidebar-3',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget widget-small %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
}
add_action( 'widgets_init', 'shoreditch_widgets_init' );
if ( ! function_exists( 'shoreditch_fonts_url' ) ) :
/**
* Register Google fonts for Shoreditch.
*
* Create your own shoreditch_fonts_url() function to override in a child theme.
*
* @return string Google fonts URL for the theme.
*/
function shoreditch_fonts_url() {
$fonts_url = '';
$fonts = array();
$subsets = 'latin,latin-ext';
/**
* Register Google fonts for Shoreditch.
*
* Create your own shoreditch_fonts_url() function to override in a child theme.
*
* @return string Google fonts URL for the theme.
*/
function shoreditch_fonts_url() {
$fonts_url = '';
$fonts = array();
$subsets = 'latin,latin-ext';
/* translators: If there are characters in your language that are not supported by Poppins, translate this to 'off'. Do not translate into your own language. */
if ( 'off' !== esc_html_x( 'on', 'Poppins font: on or off', 'shoreditch' ) ) {
$fonts[] = 'Poppins:400,700';
/* translators: If there are characters in your language that are not supported by Poppins, translate this to 'off'. Do not translate into your own language. */
if ( 'off' !== esc_html_x( 'on', 'Poppins font: on or off', 'shoreditch' ) ) {
$fonts[] = 'Poppins:400,700';
}
/* 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' !== esc_html_x( 'on', 'Lato font: on or off', 'shoreditch' ) ) {
$fonts[] = 'Lato:400,700,400italic,700italic';
}
/* 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' !== esc_html_x( 'on', 'Inconsolata font: on or off', 'shoreditch' ) ) {
$fonts[] = 'Inconsolata:400,700';
}
if ( $fonts ) {
$fonts_url = add_query_arg(
array(
'family' => urlencode( implode( '|', $fonts ) ),
'subset' => urlencode( $subsets ),
),
'https://fonts.googleapis.com/css'
);
}
return $fonts_url;
}
/* 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' !== esc_html_x( 'on', 'Lato font: on or off', 'shoreditch' ) ) {
$fonts[] = 'Lato:400,700,400italic,700italic';
}
/* 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' !== esc_html_x( 'on', 'Inconsolata font: on or off', 'shoreditch' ) ) {
$fonts[] = 'Inconsolata:400,700';
}
if ( $fonts ) {
$fonts_url = add_query_arg( array(
'family' => urlencode( implode( '|', $fonts ) ),
'subset' => urlencode( $subsets ),
), 'https://fonts.googleapis.com/css' );
}
return $fonts_url;
}
endif;
/**
@ -233,14 +260,22 @@ function shoreditch_scripts() {
wp_enqueue_script( 'comment-reply' );
}
wp_localize_script( 'shoreditch-back-top', 'shoreditchButtonTitle', array(
'desc' => esc_html__( 'Back to top', 'shoreditch' ),
) );
wp_localize_script(
'shoreditch-back-top',
'shoreditchButtonTitle',
array(
'desc' => esc_html__( 'Back to top', 'shoreditch' ),
)
);
wp_localize_script( 'shoreditch-navigation', 'shoreditchScreenReaderText', array(
'expand' => esc_html__( 'expand child menu', 'shoreditch' ),
'collapse' => esc_html__( 'collapse child menu', 'shoreditch' ),
) );
wp_localize_script(
'shoreditch-navigation',
'shoreditchScreenReaderText',
array(
'expand' => esc_html__( 'expand child menu', 'shoreditch' ),
'collapse' => esc_html__( 'collapse child menu', 'shoreditch' ),
)
);
}
add_action( 'wp_enqueue_scripts', 'shoreditch_scripts' );

View file

@ -15,7 +15,6 @@ if ( ! isset( $content_width ) ) {
if ( ! function_exists( 'sketch_content_width' ) ) :
function sketch_content_width() {
global $content_width;
if ( is_page_template( 'fullwidth-page.php' ) || ! is_active_sidebar( 'sidebar-1' ) ) {
@ -27,114 +26,139 @@ endif;
add_action( 'template_redirect', 'sketch_content_width' );
if ( ! function_exists( 'sketch_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function sketch_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Sketch, use a find and replace
* to change 'sketch' to the name of your theme in all the template files
*/
load_theme_textdomain( 'sketch', get_template_directory() . '/languages' );
// 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 <title> 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( 'sketch-landscape', '800', '600', true );
add_image_size( 'sketch-portrait', '800', '1067', true );
add_image_size( 'sketch-square', '800', '800', true );
add_image_size( 'sketch-featured', '1092', '400', true );
add_image_size( 'sketch-site-logo', '300', '300' );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'sketch' ),
'social' => __( 'Social Links', 'sketch' ),
) );
/*
* 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( 'sketch_custom_background_args', array(
'default-color' => 'eeeeee',
'default-image' => '',
) ) );
/**
* Add support for Eventbrite.
* See: https://wordpress.org/plugins/eventbrite-api/
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
add_theme_support( 'eventbrite' );
function sketch_setup() {
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Sketch, use a find and replace
* to change 'sketch' to the name of your theme in all the template files
*/
load_theme_textdomain( 'sketch', get_template_directory() . '/languages' );
// Add support for custom color scheme.
add_theme_support( 'editor-color-palette', array(
array(
'name' => esc_html__( 'Orange', 'sketch' ),
'slug' => 'orange',
'color' => '#f68060',
),
array(
'name' => esc_html__( 'Dark Gray', 'sketch' ),
'slug' => 'dark-gray',
'color' => '#333',
),
array(
'name' => esc_html__( 'Medium Gray', 'sketch' ),
'slug' => 'medium-gray',
'color' => '#999',
),
array(
'name' => esc_html__( 'Light Gray', 'sketch' ),
'slug' => 'light-gray',
'color' => '#eee',
),
array(
'name' => esc_html__( 'White', 'sketch' ),
'slug' => 'white',
'color' => '#fff',
),
) );
}
// 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 <title> 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( 'sketch-landscape', '800', '600', true );
add_image_size( 'sketch-portrait', '800', '1067', true );
add_image_size( 'sketch-square', '800', '800', true );
add_image_size( 'sketch-featured', '1092', '400', true );
add_image_size( 'sketch-site-logo', '300', '300' );
// This theme uses wp_nav_menu() in one location.
register_nav_menus(
array(
'primary' => __( 'Primary Menu', 'sketch' ),
'social' => __( 'Social Links', 'sketch' ),
)
);
/*
* 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(
'sketch_custom_background_args',
array(
'default-color' => 'eeeeee',
'default-image' => '',
)
)
);
/**
* Add support for Eventbrite.
* See: https://wordpress.org/plugins/eventbrite-api/
*/
add_theme_support( 'eventbrite' );
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
// Add support for custom color scheme.
add_theme_support(
'editor-color-palette',
array(
array(
'name' => esc_html__( 'Orange', 'sketch' ),
'slug' => 'orange',
'color' => '#f68060',
),
array(
'name' => esc_html__( 'Dark Gray', 'sketch' ),
'slug' => 'dark-gray',
'color' => '#333',
),
array(
'name' => esc_html__( 'Medium Gray', 'sketch' ),
'slug' => 'medium-gray',
'color' => '#999',
),
array(
'name' => esc_html__( 'Light Gray', 'sketch' ),
'slug' => 'light-gray',
'color' => '#eee',
),
array(
'name' => esc_html__( 'White', 'sketch' ),
'slug' => 'white',
'color' => '#fff',
),
)
);
}
endif; // sketch_setup
add_action( 'after_setup_theme', 'sketch_setup' );
@ -144,15 +168,17 @@ add_action( 'after_setup_theme', 'sketch_setup' );
* @link http://codex.wordpress.org/Function_Reference/register_sidebar
*/
function sketch_widgets_init() {
register_sidebar( array(
'name' => __( 'Sidebar', 'sketch' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
) );
register_sidebar(
array(
'name' => __( 'Sidebar', 'sketch' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
)
);
}
add_action( 'widgets_init', 'sketch_widgets_init' );
@ -166,7 +192,6 @@ function sketch_scripts() {
// Block stylesheets
wp_enqueue_style( 'sketch-block-style', get_template_directory_uri() . '/css/blocks.css', array( 'sketch-style' ), '20181018' );
wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.4.1' );
if ( sketch_has_featured_posts( 2 ) && is_page_template( 'portfolio-page.php' ) ) {
@ -204,16 +229,16 @@ add_action( 'enqueue_block_editor_assets', 'sketch_block_editor_styles' );
* Register Google Fonts
*/
function sketch_fonts_url() {
$fonts_url = '';
$fonts_url = '';
/* Translators: If there are characters in your language that are not
/* 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.
*/
$lato = _x( 'on', 'Lato font: on or off', 'sketch' );
if ( 'off' !== $lato ) {
$font_families = array();
$font_families = array();
$font_families[] = 'Lato:300,400,700,300italic,400italic,700italic';
$query_args = array(
@ -252,8 +277,9 @@ function sketch_post_thumbnail_class() {
$thumbsize = 'sketch-landscape';
endif;
if ( ! has_post_thumbnail() )
if ( ! has_post_thumbnail() ) {
$thumbsize .= ' no-thumbnail';
}
return $thumbsize;
}

View file

@ -8,65 +8,65 @@
*/
if ( ! function_exists( 'sophisticated_business_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function sophisticated_business_setup() {
// Switches Gutenberg controls to work against a dark background.
add_theme_support( 'dark-editor-style' );
/**
* Add support for core custom logo.
* Sets up theme defaults and registers support for various WordPress features.
*
* @link https://codex.wordpress.org/Theme_Logo
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
add_theme_support(
'custom-logo',
array(
'height' => 120,
'width' => 190,
'flex-width' => true,
'flex-height' => false,
'header-text' => array( 'site-title' ),
)
);
function sophisticated_business_setup() {
// Switches Gutenberg controls to work against a dark background.
add_theme_support( 'dark-editor-style' );
// Editor color palette.
add_theme_support(
'editor-color-palette',
array(
/**
* Add support for core custom logo.
*
* @link https://codex.wordpress.org/Theme_Logo
*/
add_theme_support(
'custom-logo',
array(
'name' => __( 'Primary', 'sophisticated-business' ),
'slug' => 'primary',
'color' => '#caab57', // $color__link
),
'height' => 120,
'width' => 190,
'flex-width' => true,
'flex-height' => false,
'header-text' => array( 'site-title' ),
)
);
// Editor color palette.
add_theme_support(
'editor-color-palette',
array(
'name' => __( 'Secondary', 'sophisticated-business' ),
'slug' => 'secondary',
'color' => '#b59439', // $color__border-link-hover
),
array(
'name' => __( 'Dark Gray', 'sophisticated-business' ),
'slug' => 'dark-gray',
'color' => '#1c1c1c', // $color__text-screen
),
array(
'name' => __( 'Light Gray', 'sophisticated-business' ),
'slug' => 'light-gray',
'color' => '#cccccc', // $color__text-light
),
array(
'name' => __( 'White', 'sophisticated-business' ),
'slug' => 'white',
'color' => '#ffffff',
),
)
);
}
array(
'name' => __( 'Primary', 'sophisticated-business' ),
'slug' => 'primary',
'color' => '#caab57', // $color__link
),
array(
'name' => __( 'Secondary', 'sophisticated-business' ),
'slug' => 'secondary',
'color' => '#b59439', // $color__border-link-hover
),
array(
'name' => __( 'Dark Gray', 'sophisticated-business' ),
'slug' => 'dark-gray',
'color' => '#1c1c1c', // $color__text-screen
),
array(
'name' => __( 'Light Gray', 'sophisticated-business' ),
'slug' => 'light-gray',
'color' => '#cccccc', // $color__text-light
),
array(
'name' => __( 'White', 'sophisticated-business' ),
'slug' => 'white',
'color' => '#ffffff',
),
)
);
}
endif; // sophisticated_business_setup
add_action( 'after_setup_theme', 'sophisticated_business_setup', 30 );
@ -167,4 +167,3 @@ require get_stylesheet_directory() . '/inc/jetpack.php';
* Customizer additions.
*/
require get_stylesheet_directory() . '/inc/customizer.php';

View file

@ -18,7 +18,6 @@ if ( ! function_exists( 'spearhead_setup' ) ) :
* as indicating support for post thumbnails.
*/
function spearhead_setup() {
// Add support for editor styles.
add_theme_support( 'editor-styles' );
@ -136,7 +135,7 @@ function spearhead_scripts() {
wp_dequeue_style( 'seedlet-custom-color-overrides' );
wp_enqueue_style( 'spearhead-variables-style', get_stylesheet_directory_uri() . '/variables.css', array(), wp_get_theme()->get( 'Version' ) );
if( false === get_theme_mod( 'color_darkmode_disable', false ) ) {
if ( false === get_theme_mod( 'color_darkmode_disable', false ) ) {
wp_enqueue_style( 'spearhead-variables-dark-style', get_stylesheet_directory_uri() . '/variables-dark.css', array(), wp_get_theme()->get( 'Version' ) );
}

View file

@ -30,7 +30,6 @@ if ( ! function_exists( 'stow_setup' ) ) :
* as indicating support for post thumbnails.
*/
function stow_setup() {
// Add child theme editor styles, compiled from `style-child-theme-editor.scss`.
add_editor_style( 'style-editor.css' );
@ -96,7 +95,7 @@ function stow_fonts_url() {
/* 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.
*/
$source_sans_pro = _x( 'on', 'Source Sans Pro font: on or off', 'stow' );
$source_sans_pro = _x( 'on', 'Source Sans Pro font: on or off', 'stow' );
/* translators: If there are characters in your language that are not supported
* by Droid Serif, translate this to 'off'. Do not translate into your own language.
@ -106,7 +105,7 @@ function stow_fonts_url() {
/* translators: If there are characters in your language that are not supported
* by Oswald, translate this to 'off'. Do not translate into your own language.
*/
$oswald = _x( 'on', 'Oswald font: on or off', 'stow' );
$oswald = _x( 'on', 'Oswald font: on or off', 'stow' );
if ( 'off' !== $source_sans_pro || 'off' !== $droid_serif || 'off' !== $oswald ) {
$font_families = array();
@ -124,7 +123,7 @@ function stow_fonts_url() {
'family' => urlencode( implode( '|', $font_families ) ),
'subset' => urlencode( 'latin,latin-ext' ),
);
$fonts_url = add_query_arg( $query_args, "https://fonts.googleapis.com/css" );
$fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
}
return esc_url_raw( $fonts_url );
@ -142,7 +141,7 @@ function stow_scripts() {
wp_dequeue_style( 'varia-style' );
// enqueue child styles
wp_enqueue_style('stow-style', get_stylesheet_uri(), array(), wp_get_theme()->get( 'Version' ));
wp_enqueue_style( 'stow-style', get_stylesheet_uri(), array(), wp_get_theme()->get( 'Version' ) );
// enqueue child RTL styles
wp_style_add_data( 'stow-style', 'rtl', 'replace' );

View file

@ -30,7 +30,6 @@ if ( ! function_exists( 'stratford_setup' ) ) :
* as indicating support for post thumbnails.
*/
function stratford_setup() {
// Add child theme editor styles, compiled from `style-child-theme-editor.scss`.
add_editor_style( 'style-editor.css' );

View file

@ -8,107 +8,116 @@
*/
if ( ! function_exists( 'textbook_setup' ) ) :
/*
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function textbook_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on components, use a find and replace
* to change 'textbook' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'textbook', get_template_directory() . '/languages' );
// 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 <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function textbook_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on components, use a find and replace
* to change 'textbook' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'textbook', get_template_directory() . '/languages' );
/**
* 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 default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
// Adds theme-specific images sizes
add_image_size( 'textbook-thumbnail-avatar', 100, 100, true );
add_image_size( 'textbook-featured-content-image', 600, 600, true );
add_image_size( 'textbook-featured-content-image-full', 1148, 600, true );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
/**
* This theme uses wp_nav_menu() in two locations.
*/
register_nav_menus( array(
'header' => __( 'Header', 'textbook' ),
'footer' => __( 'Footer', 'textbook' ),
) );
/**
* 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' );
/*
* 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',
) );
// Adds theme-specific images sizes
add_image_size( 'textbook-thumbnail-avatar', 100, 100, true );
add_image_size( 'textbook-featured-content-image', 600, 600, true );
add_image_size( 'textbook-featured-content-image-full', 1148, 600, true );
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
/**
* This theme uses wp_nav_menu() in two locations.
*/
register_nav_menus(
array(
'header' => __( 'Header', 'textbook' ),
'footer' => __( 'Footer', 'textbook' ),
)
);
// Add support for custom color scheme.
add_theme_support( 'editor-color-palette', array(
array(
'name' => esc_html__( 'Red', 'textbook' ),
'slug' => 'red',
'color' => '#ce4639',
),
array(
'name' => esc_html__( 'Green', 'textbook' ),
'slug' => 'green',
'color' => '#26866d',
),
array(
'name' => esc_html__( 'Purple', 'textbook' ),
'slug' => 'purple',
'color' => '#8b66d6',
),
array(
'name' => esc_html__( 'Dark Gray', 'textbook' ),
'slug' => 'dark-gray',
'color' => '#222',
),
array(
'name' => esc_html__( 'Medium Gray', 'textbook' ),
'slug' => 'medium-gray',
'color' => '#777',
),
array(
'name' => esc_html__( 'Light Gray', 'textbook' ),
'slug' => 'light-gray',
'color' => '#e1dfdc',
),
array(
'name' => esc_html__( 'White', 'textbook' ),
'slug' => 'white',
'color' => '#fff',
),
) );
}
/*
* 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 support for responsive embeds.
add_theme_support( 'responsive-embeds' );
// Add support for custom color scheme.
add_theme_support(
'editor-color-palette',
array(
array(
'name' => esc_html__( 'Red', 'textbook' ),
'slug' => 'red',
'color' => '#ce4639',
),
array(
'name' => esc_html__( 'Green', 'textbook' ),
'slug' => 'green',
'color' => '#26866d',
),
array(
'name' => esc_html__( 'Purple', 'textbook' ),
'slug' => 'purple',
'color' => '#8b66d6',
),
array(
'name' => esc_html__( 'Dark Gray', 'textbook' ),
'slug' => 'dark-gray',
'color' => '#222',
),
array(
'name' => esc_html__( 'Medium Gray', 'textbook' ),
'slug' => 'medium-gray',
'color' => '#777',
),
array(
'name' => esc_html__( 'Light Gray', 'textbook' ),
'slug' => 'light-gray',
'color' => '#e1dfdc',
),
array(
'name' => esc_html__( 'White', 'textbook' ),
'slug' => 'white',
'color' => '#fff',
),
)
);
}
endif;
add_action( 'after_setup_theme', 'textbook_setup' );
@ -140,22 +149,26 @@ add_action( 'after_switch_theme', 'textbook_update_date_format', 0 );
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function textbook_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'textbook' ),
'id' => 'sidebar-1',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer Sidebar', 'textbook' ),
'id' => 'sidebar-2',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Sidebar', 'textbook' ),
'id' => 'sidebar-1',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Footer Sidebar', 'textbook' ),
'id' => 'sidebar-2',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
}
add_action( 'widgets_init', 'textbook_widgets_init' );
@ -294,7 +307,6 @@ function textbook_scripts() {
// Block stylesheets
wp_enqueue_style( 'textbook-block-style', get_template_directory_uri() . '/assets/css/blocks.css', array( 'textbook-style' ), '20181018' );
/*
* Scripts
*/
@ -317,22 +329,34 @@ function textbook_scripts() {
}
// Menu toggle text
wp_localize_script( 'textbook-navigation', 'textBookMenuToggleText', array(
'menu' => esc_html__( 'Menu', 'textbook' ),
'close' => esc_html__( 'Close', 'textbook' ),
) );
wp_localize_script(
'textbook-navigation',
'textBookMenuToggleText',
array(
'menu' => esc_html__( 'Menu', 'textbook' ),
'close' => esc_html__( 'Close', 'textbook' ),
)
);
// Expand collapse menu text
wp_localize_script( 'textbook-navigation', 'textBookScreenReaderText', array(
'expand' => esc_html__( 'expand child menu', 'textbook' ),
'collapse' => esc_html__( 'collapse child menu', 'textbook' ),
) );
wp_localize_script(
'textbook-navigation',
'textBookScreenReaderText',
array(
'expand' => esc_html__( 'expand child menu', 'textbook' ),
'collapse' => esc_html__( 'collapse child menu', 'textbook' ),
)
);
// Search toggle text
wp_localize_script( 'textbook-navigation', 'textBookSearchToggleText', array(
'search' => esc_html__( 'Search', 'textbook' ),
'close' => esc_html__( 'Close', 'textbook' )
) );
wp_localize_script(
'textbook-navigation',
'textBookSearchToggleText',
array(
'search' => esc_html__( 'Search', 'textbook' ),
'close' => esc_html__( 'Close', 'textbook' ),
)
);
}
add_action( 'wp_enqueue_scripts', 'textbook_scripts' );
@ -361,8 +385,8 @@ add_action( 'enqueue_block_editor_assets', 'textbook_block_editor_styles' );
/*
* Check whether the browser supports JavaScript.
*/
function textbook_html_js_class () {
echo '<script>document.documentElement.className = document.documentElement.className.replace("no-js","js");</script>'. "\n";
function textbook_html_js_class() {
echo '<script>document.documentElement.className = document.documentElement.className.replace("no-js","js");</script>' . "\n";
}
add_action( 'wp_head', 'textbook_html_js_class', 1 );

View file

@ -8,143 +8,161 @@
*/
if ( ! function_exists( 'toujours_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function toujours_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on toujours, use a find and replace
* to change 'toujours' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'toujours', get_template_directory() . '/languages' );
// 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 <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
// Add custom colors to Gutenberg
add_theme_support(
'editor-color-palette', array(
array(
'name' => esc_html__( 'Blue', 'toujours' ),
'slug' => 'blue',
'color' => '#2590ec',
),
array(
'name' => esc_html__( 'Dark Gray', 'toujours' ),
'slug' => 'dark-gray',
'color' => '#404040',
),
array(
'name' => esc_html__( 'Medium Gray', 'toujours' ),
'slug' => 'medium-gray',
'color' => '#666',
),
array(
'name' => esc_html__( 'Light Gray', 'toujours' ),
'slug' => 'light-gray',
'color' => '#eee',
),
array(
'name' => esc_html__( 'White', 'toujours' ),
'slug' => 'white',
'color' => '#fff',
),
)
);
/*
* Editor styles
*/
add_editor_style( array( get_template_directory_uri() . '/editor-style.css', toujours_fonts_url() ) );
/*
* Enable support for Post Thumbnails on posts and pages.
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
add_theme_support( 'post-thumbnails' );
function toujours_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on toujours, use a find and replace
* to change 'toujours' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'toujours', get_template_directory() . '/languages' );
/*
* Custom image sizes
*/
add_image_size( 'toujours-banner', 1160, 600, true );
add_image_size( 'toujours-featured', 940, 9999 );
add_image_size( 'toujours-trio', 680, 383, true ); /* image size larger for mobile */
/*
* Register menu locations
*
* Include check to see if jetpack_social_menu supported
*/
if ( ! function_exists( 'jetpack_social_menu' ) ) {
register_nav_menus( array(
'primary' => esc_html__( 'Primary Menu', 'toujours' ),
'social' => esc_html__( 'Social Menu', 'toujours' ),
) );
} else {
register_nav_menus( array(
'primary' => esc_html__( 'Primary Menu', 'toujours' ),
) );
}
/*
* 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',
'audio',
'gallery',
'image',
'video',
'quote',
'link',
'status',
) );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'toujours_custom_background_args', array(
'default-color' => 'eeeeee',
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/*
* We're using a unique filename for the background image
* to avoid users uploading a file with the same filename
* and avoiding conflict with the `user-background` body_class
* in inc/extras.php and assets/js/customizer.js
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
'default-image' => esc_url( get_template_directory_uri() ) . '/images/toujoursbackground20160105.png',
) ) );
}
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
// Add custom colors to Gutenberg
add_theme_support(
'editor-color-palette',
array(
array(
'name' => esc_html__( 'Blue', 'toujours' ),
'slug' => 'blue',
'color' => '#2590ec',
),
array(
'name' => esc_html__( 'Dark Gray', 'toujours' ),
'slug' => 'dark-gray',
'color' => '#404040',
),
array(
'name' => esc_html__( 'Medium Gray', 'toujours' ),
'slug' => 'medium-gray',
'color' => '#666',
),
array(
'name' => esc_html__( 'Light Gray', 'toujours' ),
'slug' => 'light-gray',
'color' => '#eee',
),
array(
'name' => esc_html__( 'White', 'toujours' ),
'slug' => 'white',
'color' => '#fff',
),
)
);
/*
* Editor styles
*/
add_editor_style( array( get_template_directory_uri() . '/editor-style.css', toujours_fonts_url() ) );
/*
* 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' );
/*
* Custom image sizes
*/
add_image_size( 'toujours-banner', 1160, 600, true );
add_image_size( 'toujours-featured', 940, 9999 );
add_image_size( 'toujours-trio', 680, 383, true ); /* image size larger for mobile */
/*
* Register menu locations
*
* Include check to see if jetpack_social_menu supported
*/
if ( ! function_exists( 'jetpack_social_menu' ) ) {
register_nav_menus(
array(
'primary' => esc_html__( 'Primary Menu', 'toujours' ),
'social' => esc_html__( 'Social Menu', 'toujours' ),
)
);
} else {
register_nav_menus(
array(
'primary' => esc_html__( 'Primary Menu', 'toujours' ),
)
);
}
/*
* 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',
'audio',
'gallery',
'image',
'video',
'quote',
'link',
'status',
)
);
// Set up the WordPress core custom background feature.
add_theme_support(
'custom-background',
apply_filters(
'toujours_custom_background_args',
array(
'default-color' => 'eeeeee',
/*
* We're using a unique filename for the background image
* to avoid users uploading a file with the same filename
* and avoiding conflict with the `user-background` body_class
* in inc/extras.php and assets/js/customizer.js
*/
'default-image' => esc_url( get_template_directory_uri() ) . '/images/toujoursbackground20160105.png',
)
)
);
}
endif; // toujours_setup
add_action( 'after_setup_theme', 'toujours_setup' );
@ -195,19 +213,19 @@ function toujours_recent_three_posts() {
$exclude_tag = '';
if ( toujours_has_banner_posts( 1 ) ) {
$featured_options = get_option( 'featured-content' );
$featured_tag_id = $featured_options[ 'tag-id' ];
$featured_show = $featured_options[ 'show-all' ];
$featured_tag_id = $featured_options['tag-id'];
$featured_show = $featured_options['show-all'];
if ( 0 == $featured_show ) {
$exclude_tag = $featured_tag_id;
}
}
$args = array(
$args = array(
'ignore_sticky_posts' => 1,
'post__not_in' => get_option( 'sticky_posts' ),
'posts_per_page' => '3',
'tag__not_in' => array( $exclude_tag ),
'post__not_in' => get_option( 'sticky_posts' ),
'posts_per_page' => '3',
'tag__not_in' => array( $exclude_tag ),
);
$latest = new WP_Query();
$latest->query( $args );
@ -258,7 +276,7 @@ add_action( 'pre_get_posts', 'toujours_home_posts' );
* Wrap avatars in HTML for easier styling
*/
function toujours_get_avatar( $avatar ) {
if( ! is_admin() ) {
if ( ! is_admin() ) {
$avatar = '<span class="avatar-container"><span class="avatar-crop">' . $avatar . '</span></span>';
}
return $avatar;
@ -311,25 +329,29 @@ function toujours_fonts_url() {
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function toujours_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'toujours' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Sidebar', 'toujours' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
)
);
register_sidebar( array(
'name' => esc_html__( 'Footer', 'toujours' ),
'id' => 'footer',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar(
array(
'name' => esc_html__( 'Footer', 'toujours' ),
'id' => 'footer',
'description' => '',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
)
);
}
add_action( 'widgets_init', 'toujours_widgets_init' );
@ -342,11 +364,11 @@ add_action( 'widgets_init', 'toujours_widgets_init' );
* @return integer number of widgets in the sidebar
*/
function toujours_count_widgets( $id ) {
$count = 0;
$count = 0;
$sidebars_widgets = wp_get_sidebars_widgets();
if ( array_key_exists( $id, $sidebars_widgets ) ) {
$count = (int) count( (array) $sidebars_widgets[$id] );
$count = (int) count( (array) $sidebars_widgets[ $id ] );
}
return $count;
}
@ -409,7 +431,7 @@ function toujours_scripts() {
wp_enqueue_script( 'toujours-global', get_template_directory_uri() . '/js/global.js', array( 'jquery', 'flexslider', 'masonry' ), '20151215', true );
// Localize 'Previous' and 'Next' links in slideshow
$translation_array = array(
'next_link' => esc_html__( 'Next Slide', 'toujours' ),
'next_link' => esc_html__( 'Next Slide', 'toujours' ),
'previous_link' => esc_html__( 'Previous Slide', 'toujours' ),
);
wp_localize_script( 'toujours-global', 'toujours_script_strings', $translation_array );

View file

@ -30,6 +30,7 @@ if ( version_compare( $GLOBALS['wp_version'], '4.7', '<' ) ) {
}
if ( ! function_exists( 'varia_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*