setup_hooks();
}
protected function setup_hooks(){
/**
* Action And Filter
*/
add_action('after_setup_theme', [$this, 'atlantis_ak_support']);
add_action('wp_enqueue_scripts', [$this, 'atlantis_ak_enqueue_comments_reply']);
add_action('init', [$this, 'atlantis_ak_block_style']);
}
public function atlantis_ak_support(){
// Add default posts and comments RSS feed links to head.
add_theme_support('automatic-feed-links');
/*
* Let WordPress manage the document title.
* hard-coded
tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support('title-tag');
add_theme_support( "wp-block-styles" );
add_theme_support( "responsive-embeds" );
add_theme_support( "align-wide" );
// Add custome header
add_theme_support('custom-header');
/*
* Enable support for Post Thumbnails on posts and pages.
*/
add_theme_support('post-thumbnails');
/**
* Register Image Size
*/
add_image_size( 'future-thumbnail', 228, 221, true );
// Add default post type like gallery, aside, video etc.
add_theme_support('post-formats', array('aside', 'gallery', 'video') );
add_theme_support('has_post_format');
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'atlantisAk_custome_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ));
wp_link_pages();
the_tags();
add_editor_style();
add_theme_support( "html5", [
'search-form',
'comment-form',
'comment-list',
'gsllery',
'caption',
'script',
'style',
]);
add_theme_support( "custom-logo", [
'header-text' => ['site-title', 'site-description'],
'height' => 100,
'width' => 400,
'flex-height' => true,
'flex-width' => true,
]);
if ( ! isset( $content_width ) ) {
$content_width = 900;
}
}
public function atlantis_ak_enqueue_comments_reply() {
if( is_singular() && comments_open() && ( get_option( 'thread_comments' ) == 1) ) {
// Load comment-reply.js (into footer)
wp_enqueue_script( 'comment-reply', '/wp-includes/js/comment-reply.min.js', array(), false, true );
}
}
public function atlantis_ak_block_style(){
register_block_style('core/cover', [
'name' => 'my-cover',
'label' => __('My custom cover', 'atlantisak'),
]);
}
}