100, 'width' => 300, 'flex-height' => true, 'flex-width' => true, 'header-text' => array('site-title', 'site-description'), )); // Editor style support add_theme_support('editor-styles'); add_editor_style('editor-style.css'); // Gutenberg: Responsive Embeds add_theme_support('responsive-embeds'); add_theme_support('widgets'); register_nav_menus(array( 'main-menu' => esc_html('Main Menu', 'ascora'), 'top-menu' => esc_html('Sub Header Menu', 'ascora'), 'Footer Menu' => esc_html('Footer Menu', 'ascora'), )); function default_menu() { echo '
'; } } } function ascora_get_remaining_posts() { global $wp_query; $total_posts = wp_count_posts()->publish; // মোট প্রকাশিত পোস্ট সংখ্যা $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $posts_per_page = get_option('posts_per_page'); $posts_loaded = ($paged - 1) * $posts_per_page + $wp_query->post_count; $remaining_posts = $total_posts - $posts_loaded; return $remaining_posts; } } // Class Initialize if (class_exists('Ascora_Theme_Setup')) { new Ascora_Theme_Setup(); } function ascora_activation_redirect() { // Check if the theme is activated for the first time if (get_option('ascora_activation_redirect', false)) { // Clear the activation redirect option delete_option('ascora_activation_redirect'); // Redirect to the desired admin page wp_safe_redirect(admin_url('admin.php?page=ascora-options')); exit; } } add_action('admin_init', 'ascora_activation_redirect'); // Set the activation redirect option upon theme activation function ascora_activation_redirect_set() { update_option('ascora_activation_redirect', true); } add_action('after_switch_theme', 'ascora_activation_redirect_set');