load_dependencies();
$this->widget_init();
}
/**
* 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.
*
* @return void
*/
public function setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
*/
load_theme_textdomain( 'aces', 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(
'menu-1' => esc_html__( 'Primary Menu', 'aces' ), // Primary Menu
'menu-2' => esc_html__( 'Topbar Menu', 'aces' ), // footer menu
'menu-3' => esc_html__( 'Footer Menu', 'aces' ), // footer menu
) );
/*
* 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( 'aces_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 core custom logo.
*
* @link https://codex.wordpress.org/Theme_Logo
*/
add_theme_support( 'custom-logo', array(
'height' => 250,
'width' => 250,
'flex-width' => true,
'flex-height' => true,
) );
/**
* Add support for core custom header.
*
* @link https://developer.wordpress.org/themes/functionality/custom-headers/
*/
add_theme_support( 'custom-header', apply_filters( 'aces_custom_header_args', array(
'default-image' => '',
'default-text-color' => '000000',
'width' => 1920,
'height' => 300,
'flex-height' => true,
'wp-head-callback' => array( $this, 'header_style' ),
) ) );
// This variable is intended to be overruled from themes.
// Open WPCS issue: {@link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/1043}.
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
$GLOBALS['content_width'] = apply_filters( 'aces_content_width', 640 );
}
/**
* Styles the header image and text displayed on the blog.
*
* @see Cream_Magazine_custom_header_setup().
*/
public function header_style() {
$header_text_color = get_header_textcolor();
/*
* If no custom options for text are set, let's bail.
* get_header_textcolor() options: Any hex value, 'blank' to hide text. Default: add_theme_support( 'custom-header' ).
*/
if ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) {
return;
}
// If we get this far, we have custom styles. Let's do this.
?>
';
}
}
/**
* Trailing text for post excerpts.
*
* @return void
*/
public function excerpt_more( $more ) {
if ( is_admin() ) {
return $more;
}
return '';
}
/**
* Load the required dependencies for this this.
*
* @return void
*/
public function load_dependencies() {
// Load theme functions
require get_template_directory() . '/inc/theme-functions.php';
require get_template_directory() . '/inc/theme-hooks.php';
// Load breadcrumb class
require get_template_directory() . '/inc/breadcrumb.php';
/**
* Implement the Custom Header feature.
*/
require get_template_directory() . '/inc/custom-header.php';
/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/template-tags.php';
/**
* Customizer additions.
*/
require get_template_directory() . '/inc/customizer/class-aces-customizer.php';
/**
* Load Jetpack compatibility file.
*/
if ( defined( 'JETPACK__VERSION' ) ) {
require get_template_directory() . '/inc/jetpack.php';
}
// Load main widget class
require get_template_directory() . '/inc/widget/class-aces-widget-init.php';
}
/**
* Initialize Widgets
*
* @return void
*/
public function widget_init() {
$aces_widget = new Aces_Widget_Init();
}
public static function aces_customizer_custom_css( $output = NULL ) {
// Add filter for adding custom css via other functions
$output = apply_filters( 'aces_customizer_head_css', $output );
// Minify and output CSS in the wp_head
if ( ! empty( $output ) ) {
echo "\n";
}
}
}