get('Version'), 'all');
wp_enqueue_style('arcs_block_editor_styles', get_template_directory_uri() . '/assets/css/block-editor-styles.css', array(), '1.0', 'all');
// Enqueue WordPress core jQuery
wp_enqueue_script('jquery');
// Enqueue JS files
wp_enqueue_script('arcs_bootstrap_js', get_template_directory_uri() . '/assets/js/bootstrap.bundle.min.js', array('jquery'), '5.3.0', true);
wp_enqueue_script('arcs_main_js', get_template_directory_uri() . '/assets/js/main.js', array('jquery'), '1.0', true);
// Enqueue dynamic styles
wp_enqueue_style('arcs_dynamic_styles', get_template_directory_uri() . '/inc/dynamic-styles.php', array(), wp_get_theme()->get('Version'));
// Add editor styles
add_editor_style(get_stylesheet_directory_uri() . '/assets/css/editor-style.css');
}
add_action('wp_enqueue_scripts', 'arcs_enqueue_styles_and_scripts');
// Theme Setup
function arcs_setup_theme() {
// Localization
load_theme_textdomain('arcs', get_template_directory() . '/languages');
// Theme features
add_theme_support('automatic-feed-links');
add_theme_support('post-thumbnails');
add_theme_support('custom-logo');
add_theme_support('title-tag');
add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption'));
add_theme_support('wp-block-styles');
add_theme_support('responsive-embeds');
add_theme_support('align-wide');
// Custom image sizes
add_image_size('arcs_thumbnail', 800, 600, true);
add_image_size('home-featured', 680, 300, array('center', 'center'));
// Menus
register_nav_menus(array(
'primary' => __('Primary Menu', 'arcs'),
'footer' => __('Footer Menu', 'arcs'),
));
// Custom background
add_theme_support('custom-background', apply_filters('arcs_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
'default-repeat' => 'no-repeat',
'default-position-x' => 'center',
'default-attachment' => 'fixed',
)));
}
add_action('after_setup_theme', 'arcs_setup_theme');
// Register Widgets
function arcs_register_widgets() {
register_sidebar(array(
'name' => __('Primary Sidebar', 'arcs'),
'id' => 'main-sidebar',
'description' => 'Main Sidebar on Right Side',
'before_widget' => '',
'before_title' => '
',
));
register_sidebar(array(
'name' => __('Footer Widget 1', 'arcs'),
'id' => 'footer-1',
'before_widget' => '',
'before_title' => '',
));
register_sidebar(array(
'name' => __('Footer Widget 2', 'arcs'),
'id' => 'footer-2',
'before_widget' => '',
'before_title' => '',
));
register_sidebar(array(
'name' => __('Footer Widget 3', 'arcs'),
'id' => 'footer-3',
'before_widget' => '',
'before_title' => '',
));
}
add_action('widgets_init', 'arcs_register_widgets');
// Register Block Styles
function arcs_register_block_styles() {
register_block_style('core/paragraph', array(
'name' => 'custom-paragraph-style',
'label' => __('Custom Paragraph Style', 'arcs'),
'inline_style' => '.wp-block-paragraph.is-style-custom-paragraph-style { font-style: italic; color: #0073aa; }',
));
register_block_style('core/button', array(
'name' => 'custom-button-style',
'label' => __('Custom Button Style', 'arcs'),
'inline_style' => '.wp-block-button.is-style-custom-button-style .wp-block-button__link { background-color: #0073aa; color: white; border-radius: 10px; }',
));
}
add_action('init', 'arcs_register_block_styles');
// Enqueue Comment Reply Script
function arcs_enqueue_comment_reply_script() {
if (is_singular() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
}
add_action('wp_enqueue_scripts', 'arcs_enqueue_comment_reply_script');
// Include Additional Files
// require_once get_template_directory() . '/inc/class-arcs-walker-nav-menu.php';
require_once get_template_directory() . '/inc/dynamic-styles.php';
require_once get_template_directory() . '/inc/class-my-custom-widget.php';
require_once get_template_directory() . '/inc/customizer.php';
require_once get_template_directory() . '/inc/footer-custom-style.php';
require_once get_template_directory() . '/inc/body-fonts.php';
require_once get_template_directory() . '/inc/heading-font.php';
require_once get_template_directory() . '/inc/custom-button.php';
require_once get_template_directory() . '/inc/custom-input.php';
require_once get_template_directory() . '/inc/walkers.php';
require_once get_template_directory() . '/inc/block-patterns.php';
// Add Custom Header Support
function arcs_custom_header_setup() {
$args = array(
'default-image' => get_template_directory_uri() . '/assets/images/default-header.jpg', // Default header image
'width' => 1200, // Header width
'height' => 400, // Header height
'flex-height' => true, // Allow flexible height
'flex-width' => true, // Allow flexible width
'header-text' => true, // Enable header text
'default-text-color' => 'ffffff', // Default text color
'wp-head-callback' => 'arcs_header_style', // Callback for styling header
);
add_theme_support('custom-header', $args);
}
add_action('after_setup_theme', 'arcs_custom_header_setup');
// Custom Header Style Callback
function arcs_header_style() {
$header_text_color = get_header_textcolor();
// If the text is hidden or set to default, exit early
if ($header_text_color === 'blank') {
echo '';
return;
}
echo '';
}