| Server IP : 10.19.1.101 / Your IP : 216.73.216.158 Web Server : Apache System : Linux web1f13.kinghost.net 5.4.282-1.el8.elrepo.x86_64 #1 SMP Mon Aug 19 18:33:22 EDT 2024 x86_64 User : schererimoveisrs ( 170628) PHP Version : 7.4.33 Disable Function : apache_child_terminate,c99_buff_prepare,c99_sess_put,dl,exec,leak,link,myshellexec,openlog,passthru,pclose,pcntl_exec,php_check_syntax,php_strip_whitespace,popen,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,symlink,system,socket_listen,socket_create_listen,putenv MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/schererimoveisrs/www/wp-content/themes/sleeky/ |
Upload File : |
<?php
/**
* sleeky functions and definitions [sleeky]
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package sleeky SLEEKY_THEME_URI SLEEKY
*/
defined( 'SLEEKY_THEME_URI' ) or define( 'SLEEKY_THEME_URI', get_template_directory_uri() );
define( 'SLEEKY_THEME_DRI', get_template_directory() );
define( 'SLEEKY_IMG_URL', SLEEKY_THEME_URI . '/assets/images/' );
define( 'SLEEKY_CSS_URL', SLEEKY_THEME_URI . '/assets/css/' );
define( 'SLEEKY_JS_URL', SLEEKY_THEME_URI . '/assets/js/' );
define( 'SLEEKY_FRAMEWORK_DRI', SLEEKY_THEME_DRI . '/framework/' );
require_once SLEEKY_FRAMEWORK_DRI . 'styles/index.php';
require_once SLEEKY_FRAMEWORK_DRI . 'styles/daynamic-style.php';
require_once SLEEKY_FRAMEWORK_DRI . 'scripts/index.php';
if ( class_exists( 'Kirki' ) ) {
require_once SLEEKY_FRAMEWORK_DRI . 'kirki/class-kirki-installer-section.php';
}
require_once SLEEKY_FRAMEWORK_DRI . 'tgm/class-tgm-plugin-activation.php';
require_once SLEEKY_FRAMEWORK_DRI . 'tgm/config-tgm.php';
require_once SLEEKY_FRAMEWORK_DRI . 'classes/sleeky-int.php';
require_once SLEEKY_FRAMEWORK_DRI . 'classes/sleeky-act.php';
if ( class_exists( 'woocommerce' ) ) {
require_once SLEEKY_THEME_DRI . '/woocommerce-functions.php';
require_once SLEEKY_THEME_DRI . '/woocommerce-other.php';
}
/**
* Theme option compatibility.
*/
if ( ! function_exists( 'sleeky_get_options' ) ) :
function sleeky_get_options( $key ) {
$opt_pref = 'sleeky_theme_option';
if ( class_exists( 'Kirki' ) ) {
$sleeky_options = Kirki::get_option( $opt_pref, $key );
} else {
$sleeky_options = null;
}
return $sleeky_options;
}
endif;
if ( ! function_exists( 'sleeky_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function sleeky_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on love us, use a find and replace
* to change 'sleeky' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'sleeky', get_template_directory() . '/languages' );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
*/
add_theme_support( 'post-thumbnails' );
// This theme uses wp_nav_menu() in one location.
register_nav_menus(
array(
'primary' => esc_html__( 'Primary', 'sleeky' ),
)
);
add_theme_support( 'custom-logo' );
add_theme_support( 'responsive-embeds' );
add_theme_support( 'custom-header' );
add_theme_support( 'custom-background' );
add_theme_support( 'align-wide' );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support(
'html5',
array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
)
);
// Set up the WordPress core custom background feature.
add_theme_support(
'custom-background',
apply_filters(
'sleeky_custom_background_args',
array(
'default-color' => 'ffffff',
'default-image' => '',
)
)
);
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
/**
* Add support for core custom logo.
*
* @link https://codex.wordpress.org/Theme_Logo
*/
add_theme_support(
'custom-logo',
array(
'height' => 250,
'width' => 250,
'flex-width' => true,
'flex-height' => true,
)
);
add_image_size( 'sleeky-sidebar-post-size', 110, 72, true );
add_image_size( 'sleeky-blog-grid', 345, 226, true );
add_image_size( 'sleeky-blog-list', 380, 250, true );
$GLOBALS['content_width'] = apply_filters( 'sleeky_content_width', 640 );
add_theme_support( 'woocommerce' );
add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );
}
endif;
add_action( 'after_setup_theme', 'sleeky_setup', 9 );
/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function sleeky_widgets_init() {
register_sidebar(
array(
'name' => esc_html__( 'Blog Sidebar', 'sleeky' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Add widgets here.', 'sleeky' ),
'before_widget' => '<div id="%1$s" class="sidebar-widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<div class="widget-title"><h5>',
'after_title' => '</h5></div>',
)
);
}
add_action( 'widgets_init', 'sleeky_widgets_init' );
/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/template-tags.php';
/**
* Functions which enhance the theme by hooking into WordPress.
*/
require get_template_directory() . '/inc/template-functions.php';
/**
* google font compatibility.
*/
function sleeky_google_font() {
$protocol = is_ssl() ? 'https' : 'http';
$subsets = 'latin,cyrillic-ext,latin-ext,cyrillic,greek-ext,greek,vietnamese';
$variants = ':300,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i';
$query_args = array(
'family' => 'Inter|Londrina+Solid' . $variants,
'family' => 'Londrina+Solid' . $variants . '%7CInter' . $variants,
'subset' => $subsets,
);
$font_url = add_query_arg( $query_args, $protocol . '://fonts.googleapis.com/css?display=swap' );
wp_enqueue_style( 'sleeky-google-fonts', $font_url, array(), null );
}
add_action( 'init', 'sleeky_google_font' );
function sleeky_elementor_library() {
$pageslist = get_posts(
array(
'post_type' => 'elementor_library',
'posts_per_page' => -1,
)
);
$pagearray = array();
if ( ! empty( $pageslist ) ) {
foreach ( $pageslist as $page ) {
$pagearray[ $page->ID ] = $page->post_title;
}
}
return $pagearray;
}
// Demo content file include here
function sleeky_import_files() {
return array(
array(
'import_file_name' => 'Free Demo Import',
'categories' => array( 'Demo' ),
'import_file_url' => 'https://themesmaster.com/sleeky/demofiles/content.xml',
'import_widget_file_url' => 'https://themesmaster.com/sleeky/demofiles/widget.wie',
'import_customizer_file_url' => 'https://themesmaster.com/sleeky/demofiles/customize.dat',
'import_notice' => esc_html__( 'Caution: For importing demo data please click on "Import Demo Data" button. During demo data installation please do not refresh the page.', 'sleeky' ),
'preview_url' => 'https://themesmaster.com/sleeky/',
),
);
}
add_filter( 'ocdi/import_files', 'sleeky_import_files', 15 );
function sleeky_after_import_setup() {
// Assign menus to their locations.
$main_menu = get_term_by( 'name', 'Primary Menu', 'nav_menu' );
set_theme_mod(
'nav_menu_locations',
array(
'primary' => $main_menu->term_id,
)
);
// Assign front page and posts page (blog page).
$front_page_id = get_page_by_title( 'Home 01' );
$blog_page_id = get_page_by_title( 'Blog Posts' );
update_option( 'show_on_front', 'page' );
update_option( 'page_on_front', $front_page_id->ID );
update_option( 'page_for_posts', $blog_page_id->ID );
}
add_action( 'ocdi/after_import', 'sleeky_after_import_setup' );