stylesheet );
return false;
endif;
}
add_action( 'after_switch_theme', 'colon_check_theme_setup', 10, 2 );
if ( ! function_exists( 'colon_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 colon_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Colon, use a find and replace
* to change 'colon' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'colon', 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 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' );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => esc_html__( 'Primary', 'colon' ),
) );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'comment-form',
'comment-list',
'gallery',
'caption',
) );
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
if(get_theme_mod( 'colon_enable_block_styles',false)) :
// Load default block styles.
add_theme_support( 'wp-block-styles' );
endif;
if(get_theme_mod( 'colon_enable_block_wide_alignment',false)) :
// Support for align full and align wide option.
add_theme_support( 'align-wide' );
endif;
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
// Add support for automatic feed links.
add_theme_support( 'automatic-feed-links' );
/**
* Colon custom posts image size
*/
add_image_size( 'colon-posts', 765, 500, true );
/**
* Colon custom posts thumbs size
*/
add_image_size( 'colon-posts-thumb', 150, 100, true );
/*
* About page instance
*/
if(is_admin()) {
require get_template_directory() . '/inc/theme-info.php';
$config = array();
Colon_About_Page::colon_init( $config );
}
}
endif;
add_action( 'after_setup_theme', 'colon_setup' );
/**
* Custom Logo
*
*/
function colon_logo_setup() {
add_theme_support( 'custom-logo', array(
'height' => 65,
'width' => 350,
'flex-height' => true,
'flex-width' => true,
) );
}
add_action( 'after_setup_theme', 'colon_logo_setup' );
/**
* Set the content width in pixels, based on the theme's design and stylesheet.
*
* Priority 0 to make it available to lower priority callbacks.
*
* @global int $content_width
*/
function colon_content_width() {
$GLOBALS['content_width'] = apply_filters( 'colon_content_width', 640 );
}
add_action( 'after_setup_theme', 'colon_content_width', 0 );
/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function colon_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Blog Sidebar', 'colon' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Add widgets here.', 'colon' ),
'before_widget' => '