'6644',
'slug' => 'elation',
'premium_slug' => 'elation-pro',
'type' => 'theme',
'public_key' => 'pk_e8612540d1a6dff63a4eaac789cc6',
'is_premium' => false,
'premium_suffix' => 'Pro',
'has_addons' => false,
'has_paid_plans' => true,
'trial' => array(
'days' => 7,
'is_require_payment' => true,
),
'has_affiliation' => 'selected',
'menu' => array(
'slug' => 'elation_info',
'contact' => false,
'support' => false,
'affiliation' => false,
'parent' => array(
'slug' => 'themes.php',
),
),
'is_live' => true,
) );
}
return $elation_fs;
}
// Init Freemius.
elation_fs();
// Signal that SDK was initiated.
do_action( 'elation_fs_loaded' );
}
// Include Overlay Upgrade page
require get_template_directory() . '/inc/admin/admin.php';
// Load Customizer Library scripts
require get_template_directory() . '/customizer/customizer-options.php';
require get_template_directory() . '/customizer/customizer-library/customizer-library.php';
require get_template_directory() . '/customizer/styles.php';
require get_template_directory() . '/customizer/mods.php';
// Load TGM plugin class
require_once get_template_directory() . '/inc/class-tgm-plugin-activation.php';
if ( !function_exists( 'elation_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 elation_setup()
{
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Elation, use a find and replace
* to change 'elation' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'elation', 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
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(
'elation-main-menu' => esc_html__( 'Header Main Menu', 'elation' ),
'elation-topbar-menu' => esc_html__( 'Header Secondary Menu', 'elation' ),
'elation-bottombar-menu' => esc_html__( 'Footer Menu', 'elation' ),
) );
/*
* 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'
) );
// Add theme support for custom header.
add_theme_support( 'custom-header', apply_filters( 'elation_custom_header_args', array(
'default-image' => '',
'width' => 1200,
'height' => 500,
'flex-height' => true,
'flex-width' => true,
'header-text' => false,
'video' => true,
) ) );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'elation_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 support for Editor Styles.
*/
add_theme_support( 'editor-styles' );
add_editor_style( 'editor-style.css' );
}
}
add_action( 'after_setup_theme', 'elation_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 elation_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( 'elation_content_width', 640 );
if ( !isset( $content_width ) ) {
$content_width = 1110;
}
}
add_action( 'after_setup_theme', 'elation_content_width', 0 );
/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function elation_widgets_init()
{
// Sidear Widget Area
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'elation' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Add widgets to the Sidebar here.', 'elation' ),
'before_widget' => '',
'before_title' => '',
) );
// Default/Custom Footer Layout
register_sidebar( array(
'name' => esc_html__( 'Elation Custom Footer 1', 'elation' ),
'id' => 'elation-site-footer-custom-1',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Elation Custom Footer 2', 'elation' ),
'id' => 'elation-site-footer-custom-2',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Elation Custom Footer 3', 'elation' ),
'id' => 'elation-site-footer-custom-3',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Elation Custom Footer 4', 'elation' ),
'id' => 'elation-site-footer-custom-4',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Elation Custom Footer 5', 'elation' ),
'id' => 'elation-site-footer-custom-5',
'before_title' => '',
) );
// Split Footer Layout
register_sidebar( array(
'name' => esc_html__( 'Elation Footer - Split Widgets Layout', 'elation' ),
'id' => 'elation-site-footer-split',
'description' => esc_html__( 'The footer will be split by the amount of widgets added', 'elation' ),
'before_title' => '',
) );
}
add_action( 'widgets_init', 'elation_widgets_init' );
/*
* Change Widgets Title Tags for SEO
*/
function elation_change_widget_titles( array $params )
{
$elation_widgettitle_tag = get_theme_mod( 'elation-seo-widget-title', customizer_library_get_default( 'elation-seo-widget-title' ) );
$widget =& $params[0];
$widget['before_title'] = '<' . tag_escape( $elation_widgettitle_tag ) . ' class="widget-title">';
$widget['after_title'] = '' . tag_escape( $elation_widgettitle_tag ) . '>';
return $params;
}
add_filter( 'dynamic_sidebar_params', 'elation_change_widget_titles', 20 );
/**
* Enqueue scripts and styles.
*/
function elation_scripts()
{
if ( !get_theme_mod( 'elation-responsive-disable', customizer_library_get_default( 'elation-responsive-disable' ) ) ) {
wp_enqueue_style(
'elation-fonts',
'//fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,700;1,400;1,700&family=Nunito+Sans:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap',
array(),
ELATION_THEME_VERSION
);
}
wp_enqueue_style( 'elation-style', get_stylesheet_uri() );
wp_enqueue_style(
'elation-font-awesome',
get_template_directory_uri() . '/inc/font-awesome/css/all.css',
array(),
'5.11.2'
);
// Load Header Style
wp_enqueue_style(
'elation-header-style',
get_template_directory_uri() . "/templates/header/header-style.css",
array( 'elation-style' ),
ELATION_THEME_VERSION
);
// Load Footer Style
wp_enqueue_style(
'elation-footer-style',
get_template_directory_uri() . "/templates/footer/css/" . get_theme_mod( 'elation-footer-layout', customizer_library_get_default( 'elation-footer-layout' ) ) . ".css",
array( 'elation-style' ),
ELATION_THEME_VERSION
);
// Load Responsive Stylesheets
if ( !get_theme_mod( 'elation-responsive-disable', customizer_library_get_default( 'elation-responsive-disable' ) ) ) {
$elation_resp_menu = get_theme_mod( 'elation-menu-breakat', customizer_library_get_default( 'elation-menu-breakat' ) );
$elation_resp_tablet = get_theme_mod( 'elation-tablet-breakat', customizer_library_get_default( 'elation-tablet-breakat' ) );
$elation_resp_mobile = get_theme_mod( 'elation-mobile-breakat', customizer_library_get_default( 'elation-mobile-breakat' ) );
switch ( $elation_resp_menu ) {
case 'always':
$elation_resp_menu = 'all';
break;
case 'mobile':
$elation_resp_menu = '(max-width: ' . esc_attr( $elation_resp_mobile ) . 'px)';
break;
case 'custom':
$elation_resp_menu = '(max-width: ' . esc_attr( get_theme_mod( 'elation-menu-custom-breakat', customizer_library_get_default( 'elation-menu-custom-breakat' ) ) ) . 'px)';
break;
default:
// Defaults to Tablet
$elation_resp_menu = '(max-width: ' . esc_attr( $elation_resp_tablet ) . 'px)';
}
wp_enqueue_style(
'elation-resp-menu',
get_template_directory_uri() . "/inc/css/menu-mobile.css",
array( 'elation-style', 'elation-header-style', 'elation-footer-style' ),
ELATION_THEME_VERSION,
esc_attr( $elation_resp_menu )
);
wp_enqueue_style(
'elation-resp-tablet',
get_template_directory_uri() . "/inc/css/responsive-tablet.css",
array( 'elation-style', 'elation-header-style', 'elation-footer-style' ),
ELATION_THEME_VERSION,
'(max-width: ' . esc_attr( $elation_resp_tablet ) . 'px)'
);
wp_enqueue_style(
'elation-resp-mobile',
get_template_directory_uri() . "/inc/css/responsive-mobile.css",
array( 'elation-style', 'elation-header-style', 'elation-footer-style' ),
ELATION_THEME_VERSION,
'(max-width: ' . esc_attr( $elation_resp_mobile ) . 'px)'
);
}
wp_enqueue_script(
'elation-custom',
get_template_directory_uri() . '/js/custom.js',
array( 'jquery' ),
ELATION_THEME_VERSION,
true
);
wp_localize_script( 'elation-custom', 'elation_js', array(
'menu_breakpoint' => get_theme_mod( 'elation-menu-breakat', customizer_library_get_default( 'elation-menu-breakat' ) ),
'menu_mobile' => get_theme_mod( 'elation-mobile-breakat', customizer_library_get_default( 'elation-mobile-breakat' ) ),
'menu_tablet' => get_theme_mod( 'elation-tablet-breakat', customizer_library_get_default( 'elation-tablet-breakat' ) ),
) );
wp_enqueue_script( 'elation-custom' );
if ( 'elation-blog-grid' == get_theme_mod( 'elation-blog-list-layout', customizer_library_get_default( 'elation-blog-list-layout' ) ) || 'elation-blog-tile' == get_theme_mod( 'elation-blog-list-layout', customizer_library_get_default( 'elation-blog-list-layout' ) ) ) {
wp_enqueue_script( 'jquery-masonry' );
wp_enqueue_script(
'elation-masonry',
get_template_directory_uri() . '/js/layout-blocks.js',
array( 'jquery' ),
ELATION_THEME_VERSION,
true
);
if ( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'infinite-scroll' ) ) {
wp_enqueue_script(
'elation-jetpack-scroll',
get_template_directory_uri() . '/js/jetpack-infinite-scroll.js',
array( 'jquery' ),
ELATION_THEME_VERSION,
true
);
}
}
// EDD Styling
if ( get_theme_mod( 'elation-plugin-edd-style', customizer_library_get_default( 'elation-plugin-edd-style' ) ) ) {
wp_enqueue_style(
'elation-edd-css',
get_template_directory_uri() . "/inc/css/edd.css",
array( 'dashicons' ),
ELATION_THEME_VERSION
);
}
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'elation_scripts' );
/**
* Fix skip link focus in IE11. Too small to load as own script
*/
function elation_custom_footer_scripts()
{
// The following is minified via 'terser --compress --mangle -- js/skip-link-focus-fix.js'
?>
__( 'Elementor Page Builder', 'elation' ),
'slug' => 'elementor',
'required' => false,
),
array(
'name' => __( 'WooCommerce', 'elation' ),
'slug' => 'woocommerce',
'required' => false,
),
array(
'name' => __( 'WooCustomizer', 'elation' ),
'slug' => 'woocustomizer',
'required' => false,
),
array(
'name' => __( 'Breadcrumb NavXT', 'elation' ),
'slug' => 'breadcrumb-navxt',
'required' => false,
),
array(
'name' => __( 'Contact Form by WPForms', 'elation' ),
'slug' => 'wpforms-lite',
'required' => false,
),
array(
'name' => __( 'Google Analytics for WordPress by MonsterInsights', 'elation' ),
'slug' => 'google-analytics-for-wordpress',
'required' => false,
)
);
$config = array(
'id' => 'elation',
'menu' => 'tgmpa-install-plugins',
);
tgmpa( $plugins, $config );
}
add_action( 'tgmpa_register', 'elation_tgm_recommended_plugins' );
/**
* Admin notice to enter a purchase license
*/
function elation_add_premium_license_notice()
{
global $pagenow ;
global $current_user ;
$elation_user_id = $current_user->ID;
$elationpage = ( isset( $_GET['page'] ) ? $pagenow . '?page=' . $_GET['page'] : $pagenow );
if ( current_user_can( 'manage_options' ) && !get_user_meta( $elation_user_id, 'elation_license_dismiss_pro_count' ) ) {
?>
' . __( 'useful links to help you get started', 'elation' ) . '', array(
'a' => array(
'href' => array(),
),
) ) );
?>
ID;
if ( isset( $_GET['elation_add_premium_license_notice_ignore'] ) ) {
update_user_meta( $elation_user_id, 'elation_license_dismiss_pro_count', true );
}
}
add_action( 'admin_init', 'elation_add_premium_license_notice_ignore' );
/**
* Register Elementor Locations
*/
function elation_register_elementor_locations( $elementor_theme_manager )
{
$elementor_theme_manager->register_all_core_location();
}
add_action( 'elementor/theme/register_locations', 'elation_register_elementor_locations' );
/**
* Adjust is_home query if elation-blog-cats is set
*/
function elation_adjust_blog_queries( $query )
{
$elation_query_set = '';
if ( get_theme_mod( 'elation-blog-cats', false ) ) {
$elation_query_set = get_theme_mod( 'elation-blog-cats' );
}
if ( $elation_query_set ) {
// do not alter the query on wp-admin pages and only alter it if it's the main query
if ( !is_admin() && $query->is_main_query() ) {
// if ( is_home() ){
$query->set( 'cat', $elation_query_set );
// }
}
}
}
add_action( 'pre_get_posts', 'elation_adjust_blog_queries' );
/**
* Exclude slider category from sidebar widgets
*/
function elation_exclude_categories_widget( $args )
{
$exclude = '';
// ID's of the categories to exclude
if ( get_theme_mod( 'elation-blog-cats', false ) ) {
$exclude = esc_attr( get_theme_mod( 'elation-blog-cats' ) );
}
$args['exclude'] = $exclude;
return $args;
}
add_filter( 'widget_categories_args', 'elation_exclude_categories_widget' );
/**
* Adjust the Recent Posts widget query if elation-blog-cats is set
*/
function elation_exclude_categories_recentposts( $params )
{
$exclude_cats = get_theme_mod( 'elation-blog-cats', false );
if ( $exclude_cats ) {
if ( count( $exclude_cats ) > 0 ) {
// do not alter the query on wp-admin pages and only alter it if it's the main query
$params['category__not_in'] = $exclude_cats;
}
}
return $params;
}
add_filter( 'widget_posts_args', 'elation_exclude_categories_recentposts' );