/** * @package Layers */ /** * Add define Layers constants to be used around Layers themes, plugins etc. */ /** * The current version of the theme. Use a random number for SCRIPT_DEBUG mode */ define( 'LAYERS_VERSION', '1.0.3' ); define( 'LAYERS_TEMPLATE_URI' , get_template_directory_uri() ); define( 'LAYERS_TEMPLATE_DIR' , get_template_directory() ); define( 'LAYERS_THEME_TITLE' , 'Layers' ); define( 'LAYERS_THEME_SLUG' , 'layers' ); define( 'LAYERS_BUILDER_TEMPLATE' , 'builder.php' ); /** * Set the content width based on the theme's design and stylesheet. */ if ( ! isset( $content_width ) ) $content_width = 1080; /* pixels */ /** * Adjust the content width when the full width page template is being used */ function layers_set_content_width() { global $content_width; $left_sidebar_active = layers_can_show_sidebar( 'left-sidebar' ); $right_sidebar_active = layers_can_show_sidebar( 'right-sidebar' ); if( is_page_template( LAYERS_BUILDER_TEMPLATE ) ) { $content_width = 1080; } else if( is_page_template( 'template-both-sidebar.php' ) || is_page_template( 'template-left-sidebar.php' ) || is_page_template( 'template-right-sidebar.php' ) ){ $content_width = 660; } elseif ( is_page_template( 'template-blog.php' ) ) { $content_width = 1080; } elseif( $left_sidebar_active || $right_sidebar_active ){ $content_width = 660; } } add_action( 'template_redirect', 'layers_set_content_width' ); /* * Third Party Scripts */ require_once get_template_directory() . '/core/third-party/site-logo.php'; /* * Load Customizer Support */ require_once get_template_directory() . '/core/customizer/init.php'; require_once get_template_directory() . '/core/customizer/pro-controls.php'; /* * Load Custom Post Meta */ require_once get_template_directory() . '/core/meta/init.php'; /* * Load Front-end helpers */ require_once get_template_directory() . '/core/helpers/color.php'; require_once get_template_directory() . '/core/helpers/controls.php'; require_once get_template_directory() . '/core/helpers/custom-fonts.php'; require_once get_template_directory() . '/core/helpers/extensions.php'; require_once get_template_directory() . '/core/helpers/post.php'; require_once get_template_directory() . '/core/helpers/post-types.php'; require_once get_template_directory() . '/core/helpers/sanitization.php'; require_once get_template_directory() . '/core/helpers/template.php'; require_once get_template_directory() . '/core/helpers/woocommerce.php'; require_once get_template_directory() . '/core/helpers/pro-helpers.php'; /* * Load Admin-specific files */ if( is_admin() ){ // Include form item class require_once get_template_directory() . '/core/helpers/forms.php'; // Include API class require_once get_template_directory() . '/core/helpers/api.php'; // Include widget export/import class require_once get_template_directory() . '/core/helpers/migrator.php'; //Load Options Panel require_once get_template_directory() . '/core/options-panel/init.php'; } if( ! function_exists( 'layers_setup' ) ) { function layers_setup(){ global $pagenow; /** * Add support for HTML5 */ add_theme_support('html5'); /** * Add support for Title Tags */ add_theme_support('title-tag'); /** * Add support for widgets inside the customizer */ add_theme_support('widget-customizer'); /** * Add support for WooCommerce */ add_theme_support( 'woocommerce' ); /** * Add support for featured images */ add_theme_support( 'post-thumbnails' ); // Set Large Image Sizes add_image_size( 'layers-square-large', 1000, 1000, true ); add_image_size( 'layers-portrait-large', 720, 1000, true ); add_image_size( 'layers-landscape-large', 1000, 720, true ); // Set Medium Image Sizes add_image_size( 'layers-square-medium', 480, 480, true ); add_image_size( 'layers-portrait-medium', 340, 480, true ); add_image_size( 'layers-landscape-medium', 480, 340, true ); /** * Add text domain */ load_theme_textdomain('layerswp', get_template_directory() . '/languages'); /** * Add Site Logo Support */ // Custom Site Logo if( !function_exists( 'the_custom_logo' ) ){ $logo_support = 'site-logo'; } else { $logo_support = 'custom-logo'; } add_theme_support( $logo_support, array( 'header-text' => array( 'sitetitle', 'tagline', ), 'flex-width' => true, 'size' => 'large', ) ); // Automatic Feed Links add_theme_support( 'automatic-feed-links' ); // Add support for excerpts in pages add_post_type_support( 'page', 'excerpt' ); /** * Register nav menus */ register_nav_menus( array( LAYERS_THEME_SLUG . '-secondary-left' => __( 'Top Left Menu' , 'layerswp' ), LAYERS_THEME_SLUG . '-secondary-right' => __( 'Top Right Menu' , 'layerswp' ), LAYERS_THEME_SLUG . '-primary' => __( 'Header Menu' , 'layerswp' ), LAYERS_THEME_SLUG . '-primary-right' => __( 'Right Header Menu' , 'layerswp' ), LAYERS_THEME_SLUG . '-footer' => __( 'Footer Menu' , 'layerswp' ), ) ); /** * Welcome Redirect */ if( isset($_GET["activated"]) && $pagenow = "themes.php" ) { //&& '' == get_option( 'layers_welcome' ) update_option( 'layers_welcome' , 1); wp_safe_redirect( admin_url('admin.php?page=layerswp-get-started')); } /** * Add support for Partial Widget Refresh. */ add_theme_support( 'customize-selective-refresh-widgets' ); /** * Add theme support for WooCommerce Gallery */ add_theme_support( 'wc-product-gallery-zoom' ); add_theme_support( 'wc-product-gallery-lightbox' ); add_theme_support( 'wc-product-gallery-slider' ); } // function layers_setup } // if !function layers_setup add_action( 'after_setup_theme' , 'layers_setup', 100 ); /** * Port Widgets between Layers Parent theme and Child themes */ function layers_backup_site( $value ){ $theme = wp_get_theme(); update_option( 'layers_tm_backup', get_theme_mods() ); } add_action( 'pre_set_theme_mod_sidebars_widgets' , 'layers_backup_site' ); function layers_resore_site(){ global $layers_widgets; $theme = wp_get_theme(); $layers_tm_backup = get_option( 'layers_tm_backup' ); if( $layers_tm_backup ) { update_option( 'theme_mods_' . $theme->stylesheet, $layers_tm_backup ); delete_option ( 'layers_tm_backup' ); } } add_action( 'after_switch_theme' , 'layers_resore_site', 50 ); /** * Enqueue front end styles and scripts */ if( ! function_exists( 'layers_register_standard_sidebars' ) ) { function layers_register_standard_sidebars(){ /** * Register Standard Sidebars */ register_sidebar( array( 'id' => LAYERS_THEME_SLUG . '-off-canvas-sidebar', 'name' => __( 'Mobile Sidebar' , 'layerswp' ), 'description' => __( 'This sidebar will only appear on mobile devices.' , 'layerswp' ), 'before_widget' => '', 'before_title' => '
register_location( 'header' ); $elementor_theme_manager->register_location( 'footer' ); $elementor_theme_manager->register_location( 'single' ); $elementor_theme_manager->register_location( 'product' ); $elementor_theme_manager->register_location( 'archive' ); } add_action( 'elementor/theme/register_locations', 'theme_prefix_register_elementor_locations' );{"id":7,"date":"2020-03-29T10:36:07","date_gmt":"2020-03-29T10:36:07","guid":{"rendered":"http:\/\/acmeprofessionalsindia.com\/acmenew\/?page_id=7"},"modified":"2021-03-21T08:21:57","modified_gmt":"2021-03-21T08:21:57","slug":"home","status":"publish","type":"page","link":"https:\/\/acmeprofessionalsindia.com\/","title":{"rendered":"Home"},"content":{"rendered":"\t\t