deepsite-project / functions.php
evaku's picture
а ты можешь адаптировать генерируемый код под сайт на вордпресс, чтобы я потом мог его редактировать в elementor?
069f622 verified
Raw History Blame Contribute Delete
1.36 kB
```php
<?php
function your_theme_setup() {
// Add theme support
add_theme_support('title-tag');
add_theme_support('post-thumbnails');
add_theme_support('custom-logo');
add_theme_support('html5', array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
));
// Register menus
register_nav_menus(array(
'primary' => __('Primary Menu', 'your-theme'),
));
// Register widget areas
register_sidebar(array(
'name' => __('Footer Widgets', 'your-theme'),
'id' => 'footer-1',
'description' => __('Add widgets here to appear in your footer.', 'your-theme'),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
));
}
add_action('after_setup_theme', 'your_theme_setup');
function your_theme_scripts() {
// Enqueue styles and scripts
wp_enqueue_style('your-theme-style', get_stylesheet_uri());
wp_enqueue_style('your-theme-main', get_template_directory_uri() . '/css/main.css');
wp_enqueue_script('your-theme-main', get_template_directory_uri() . '/js/main.js', array(), '1.0', true);
}
add_action('wp_enqueue_scripts', 'your_theme_scripts');
```