100, 'width' => 400, 'flex-width' => true, 'flex-height' => true, ) ); add_theme_support( 'woocommerce' ); add_theme_support( 'custom-background' ); register_nav_menus( array( 'primary' => esc_html__( 'Primary', 'aether-blog' ), ) ); }); // Enqueue Styles & Scripts function aether_blog_enqueue_scripts() { // Bootstrap wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/assets/css/bootstrap.min.css' ); wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/assets/js/bootstrap.min.js', array( 'jquery' ), '', true ); // Menu Styles and JS wp_enqueue_style( 'aether-blog-menu', get_template_directory_uri() . '/menu/menu.css', array(), '1.0' ); wp_enqueue_script( 'aether-blog-menu', get_template_directory_uri() . '/menu/menu.js', array( 'jquery' ), '1.0', true ); // Back to Top JS wp_enqueue_script( 'aether-blog-custom', get_template_directory_uri() . '/assets/js/custom.js', array(), null, true ); // Customizer Button CSS wp_enqueue_style( 'aether-blog-customizer-css', get_stylesheet_directory_uri() . '/inc/customizer-button/customizer-custom.css' ); // Main Stylesheet wp_enqueue_style( 'aether-blog-style', get_stylesheet_uri() ); // Fonts via Local Loader require_once get_theme_file_path( 'inc/wptt-webfont-loader.php' ); wp_add_inline_style( 'aether-blog-style', wptt_get_webfont_styles( 'https://fonts.googleapis.com/css2?family=Literata&display=swap' ) ); // Inline color selector (make sure $custom_css is set correctly inside the included file) require get_parent_theme_file_path( '/inc/color-selector.php' ); if ( isset( $custom_css ) ) { wp_add_inline_style( 'aether-blog-style', $custom_css ); } } add_action( 'wp_enqueue_scripts', 'aether_blog_enqueue_scripts' ); function aether_blog_enqueue_ajax_script() { wp_enqueue_script('aether-ajax', get_template_directory_uri() . '/assets/js/aether-ajax.js', array('jquery'), null, true); wp_localize_script('aether-ajax', 'aether_ajax_obj', array( 'ajax_url' => admin_url('admin-ajax.php'), )); } add_action('wp_enqueue_scripts', 'aether_blog_enqueue_ajax_script'); function aether_load_more_posts_callback() { $paged = isset($_POST['page']) ? absint($_POST['page']) : 1; $category = isset($_POST['category']) ? absint($_POST['category']) : 0; $args = array( 'post_type' => 'post', 'posts_per_page' => 4, 'paged' => $paged, 'ignore_sticky_posts' => true, ); if ($category) { $args['cat'] = $category; } $query = new WP_Query($args); if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post(); ?>
'card-img-top']); ?> <?php the_title_attribute(); ?>
'; echo '
  • ' . esc_html__( 'Click here to add a menu', 'aether-blog' ) . '
  • '; echo ''; } } endif; // Sidebar function aether_blog_theme_register_sidebars() { register_sidebar( array( 'name' => __( 'Primary Sidebar', 'aether-blog' ), 'id' => 'primary-sidebar', 'description' => __( 'Widgets in this area will be shown in the sidebar.', 'aether-blog' ), 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); } add_action( 'widgets_init', 'aether_blog_theme_register_sidebars' ); // Register Footer Widget Area function aether_blog_register_footer_widget_area() { register_sidebar( array( 'name' => __( 'Footer 1 Widget Area', 'aether-blog' ), 'id' => 'footer_widget_area1', 'description' => __( 'Add widgets here to appear in your footer.', 'aether-blog' ), 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); register_sidebar( array( 'name' => __( 'Footer 2 Widget Area', 'aether-blog' ), 'id' => 'footer_widget_area2', 'description' => __( 'Add widgets here to appear in your footer.', 'aether-blog' ), 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); register_sidebar( array( 'name' => __( 'Footer 3 Widget Area', 'aether-blog' ), 'id' => 'footer_widget_area3', 'description' => __( 'Add widgets here to appear in your footer.', 'aether-blog' ), 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); } add_action( 'widgets_init', 'aether_blog_register_footer_widget_area' ); // Customizer and Helpers require get_template_directory() . '/inc/customizer.php'; require get_template_directory() . '/inc/custom-customizer.php'; require get_template_directory() . '/inc/getstarted/getstart.php'; // Radio button sanitizer function aether_blog_sanitize_choices( $input, $setting ) { global $wp_customize; $control = $wp_customize->get_control( $setting->id ); return ( isset( $control->choices[ $input ] ) ) ? $input : $setting->default; } // Credit Link define( 'aether_blog_URL', 'https://cawpthemes.com/' ); function aether_blog_credit_link() { echo esc_html__( 'Powered by WordPress | By ', 'aether-blog' ) . '' . esc_html__( 'CA WP Themes', 'aether-blog' ) . ''; } function aether_blog_mytheme_register_block_styles() { // Register a block style for the heading block wp_register_style( 'heading-style-aether-blog', get_template_directory_uri() . '/css/blocks.css', array( 'wp-blocks' ), '1.0', 'all' ); register_block_style( 'core/heading', array( 'name' => 'aether-blog-heading', 'label' => __( 'My Theme Heading', 'aether-blog' ), 'style_handle' => 'heading-style-aether-blog-', ) ); } add_action( 'init', 'aether_blog_mytheme_register_block_styles' ); //------Custom Block--------- function aether_blog_mytheme_register_block_patterns() { if ( function_exists( 'register_block_pattern' ) ) { register_block_pattern( 'aether-blog/custom-pattern', array( 'title' => __( 'My Custom Pattern', 'aether-blog' ), 'description' => __( 'A custom block pattern for my theme', 'aether-blog' ), 'categories' => array( 'text' ), 'content' => '

    This is my custom block pattern

    ', ) ); } } add_action( 'init', 'aether_blog_mytheme_register_block_patterns' ); function aether_blog_add_editor_styles() { add_editor_style( 'editor-style.css' ); } add_action( 'admin_init', 'aether_blog_add_editor_styles' ); //------------------------Comments------------- function aether_blog_enable_threaded_comments() { if (is_singular() && comments_open() && (get_option('thread_comments') == 1)) { wp_enqueue_script('comment-reply'); } } add_action('wp_enqueue_scripts', 'aether_blog_enable_threaded_comments'); // ----------------------------Menu navigation keyboard-------------- function aether_blog_add_tabindex_to_menu_items( $atts, $item, $args, $depth ) { // Add tabindex="0" to the menu item $atts['tabindex'] = '0'; return $atts; } add_filter( 'nav_menu_link_attributes', 'aether_blog_add_tabindex_to_menu_items', 10, 4 ); //--------------------Define-------------------- define('aether_blog_PRO_URL', 'https://cawpthemes.com/aether-blog-premium-wordpress-theme/'); define('aether_blog_PRO_SUPPORT', 'https://cawpthemes.com/support/'); define('aether_blog_PRO_DEMO', 'https://demo.cawpthemes.com/aether-blog-pro'); define('aether_blog_PRO_DOCUMENTATION', 'https://cawpthemes.com/docs/aether-blog-free-theme-documentation/'); define('aether_blog_FREE_URL', 'https://demo.cawpthemes.com/aether-blog');