setup_hooks(); } protected function setup_hooks(){ /** * Action And Filter */ add_action('after_setup_theme', [$this, 'atlantisak_support']); add_action('wp_enqueue_scripts', [$this, 'atlantisak_enqueue_comments_reply']); add_action('init', [$this, 'atlantisak_block_style']); } public function atlantisak_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. * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ */ add_theme_support('post-thumbnails'); /** * Register Image Size */ add_image_size( 'atlantisak-image-size', 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(); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( "html5", [ 'search-form', 'comment-form', 'comment-list', 'gsllery', 'caption', 'script', 'style', ]); // 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", [ '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 atlantisak_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 atlantisak_block_style(){ // phpcs:ignore WPThemeReview.PluginTerritory.ForbiddenFunctions.editor_blocks_register_block_style register_block_style('core/cover', [ 'name' => 'my-cover', 'label' => __('My custom cover', 'atlantisak'), ]); } }