Exemple #1
0
function et_setup_theme()
{
    global $themename, $shortname, $et_store_options_in_one_row, $default_colorscheme;
    $themename = 'Divi';
    $shortname = 'divi';
    $et_store_options_in_one_row = true;
    $default_colorscheme = "Default";
    $template_directory = get_template_directory();
    $theme_version = et_get_theme_version();
    define('ET_CORE_VERSION', $theme_version);
    require_once $template_directory . '/core/init.php';
    et_core_setup(get_template_directory_uri());
    require_once $template_directory . '/epanel/custom_functions.php';
    require_once $template_directory . '/includes/functions/choices.php';
    require_once $template_directory . '/includes/functions/sanitization.php';
    require_once $template_directory . '/includes/functions/sidebars.php';
    load_theme_textdomain('Divi', $template_directory . '/lang');
    require_once $template_directory . '/epanel/core_functions.php';
    require_once $template_directory . '/post_thumbnails_divi.php';
    include $template_directory . '/includes/widgets.php';
    register_nav_menus(array('primary-menu' => esc_html__('Primary Menu', 'Divi'), 'secondary-menu' => esc_html__('Secondary Menu', 'Divi'), 'footer-menu' => esc_html__('Footer Menu', 'Divi')));
    // don't display the empty title bar if the widget title is not set
    remove_filter('widget_title', 'et_widget_force_title');
    remove_filter('body_class', 'et_add_fullwidth_body_class');
    add_action('wp_enqueue_scripts', 'et_add_responsive_shortcodes_css', 11);
    // Declare theme supports
    add_theme_support('title-tag');
    add_theme_support('post-formats', array('video', 'audio', 'quote', 'gallery', 'link'));
    add_theme_support('woocommerce');
    remove_action('woocommerce_sidebar', 'woocommerce_get_sidebar', 10);
    remove_action('woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
    add_action('woocommerce_before_main_content', 'et_divi_output_content_wrapper', 10);
    remove_action('woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
    add_action('woocommerce_after_main_content', 'et_divi_output_content_wrapper_end', 10);
    remove_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10);
    // deactivate page templates and custom import functions
    remove_action('init', 'et_activate_features');
    remove_action('admin_menu', 'et_add_epanel');
    // Load editor styling
    add_editor_style('css/editor-style.css');
}
 function et_plugin_setup_builder()
 {
     define('ET_BUILDER_PLUGIN_ACTIVE', true);
     define('ET_BUILDER_VERSION', '1.3.1');
     define('ET_BUILDER_DIR', ET_BUILDER_PLUGIN_DIR . 'framework/');
     define('ET_BUILDER_URI', trailingslashit(plugins_url('', __FILE__)) . 'framework');
     define('ET_BUILDER_LAYOUT_POST_TYPE', 'et_pb_layout');
     define('ET_CORE_VERSION', $this->plugin_version);
     load_theme_textdomain('et_builder', ET_BUILDER_DIR . 'languages');
     load_plugin_textdomain('et_builder_plugin', false, dirname(plugin_basename(__FILE__)) . '/lang/');
     require ET_BUILDER_PLUGIN_DIR . 'functions.php';
     require ET_BUILDER_PLUGIN_DIR . 'theme-compat.php';
     require ET_BUILDER_DIR . 'framework.php';
     require_once ET_BUILDER_PLUGIN_DIR . 'core/init.php';
     et_core_setup(ET_BUILDER_PLUGIN_URI);
     et_pb_register_posttypes();
     add_action('admin_menu', array($this, 'add_divi_menu'));
 }