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 = get_theme_mod('popularfx_template'); 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' => 1000, 'height' => 250, 'flex-height' => true, 'wp-head-callback' => 'popularfx_header_style', ) ) ); } } } 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 ); } // Backward compat function popularfx_copyright(){ return popularfx_theme_credits(); } // Show credit of our theme function popularfx_theme_credits(){ return ''.__('PopularFX Theme', 'popularfx').''; } // Shows the promos function popularfx_promos(){ if(is_admin() && current_user_can('install_themes')){ // Show the promo popularfx_maybe_promo([ 'after' => 1,// In days 'interval' => 30,// In days 'pro_url' => esc_url(POPULARFX_PRO_URL), 'rating' => esc_url('https://wordpress.org/themes/popularfx/#reviews'), 'twitter' => esc_url('https://twitter.com/PopularFXthemes?status=').rawurlencode('I love #PopularFX Theme by @pagelayer team for my #WordPress site - '.esc_url(home_url())), 'facebook' => esc_url('https://facebook.com/popularfx'), 'website' => esc_url(POPULARFX_WWW_URL), 'image' => POPULARFX_URL.'/images/popularfx-logo.png', 'name' => 'popularfx_show_promo' ]); $template = get_theme_mod('popularfx_template'); if(empty($template)){ // Show the image promo popularfx_maybe_promo([ 'after' => 0,// In days 'interval' => 30,// In days 'pro_url' => esc_url(POPULARFX_PRO_URL), 'rating' => esc_url('https://wordpress.org/themes/popularfx/#reviews'), 'twitter' => esc_url('https://twitter.com/PopularFXthemes?status=').rawurlencode('I love #PopularFX Theme by @pagelayer team for my #WordPress site - '.esc_url(home_url())), 'facebook' => esc_url('https://facebook.com/popularfx'), 'website' => esc_url(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' => ' ', 'before_title' => '
'.(empty($opts['pro_url']) || !empty($popularfx['license']) ? '' : ''.__('Buy PopularFX Pro', 'popularfx').'').' '.(empty($opts['rating']) ? '' : ''.__('Rate it 5★\'s', 'popularfx').'').' '.(empty($opts['facebook']) ? '' : ' '.__('Facebook', 'popularfx').'').' '.(empty($opts['twitter']) ? '' : ' '.__('Tweet', 'popularfx').'').' '.(empty($opts['website']) ? '' : ''.__('Visit our website', 'popularfx').'').'
'.sprintf( __('We are glad you are using %1$s to build your website. We really appreciate it !
We would like to request you to give us a 5 Star rating on %2$s.
It will greatly boost our motivation !', 'popularfx'), 'PopularFX', 'WordPress.org').'
'.(empty($opts['pro_url']) || !empty($popularfx['license']) ? '' : ''.__('Buy PopularFX Pro', 'popularfx').'').' '.(empty($opts['rating']) ? '' : ''.__('Rate it 5★\'s', 'popularfx').'').' '.(empty($opts['facebook']) ? '' : ' '.__('Facebook', 'popularfx').'').' '.(empty($opts['twitter']) ? '' : ' '.__('Tweet', 'popularfx').'').' '.(empty($opts['website']) ? '' : ''.__('Visit our website', 'popularfx').'').'
'.(empty($opts['pro_url']) || !empty($popularfx['license']) ? '' : ''.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'), 'PopularFX Pro', '', '').'
').'