This is a fresh installation of %1$s theme. Don\'t forget to go to ePanel to set it up. This message will disappear once you have clicked the Save button within the theme\'s options page.
', $themename ) ), wp_get_theme(), admin_url( 'themes.php?page=core_functions.php' ) );
}
}
}
add_filter( 'body_class', 'et_add_fullwidth_body_class' );
function et_add_fullwidth_body_class( $classes ){
$fullwidth_view = false;
if ( is_page_template( 'page-full.php' ) ) $fullwidth_view = true;
if ( is_page() || is_single() ) {
$et_ptemplate_settings = get_post_meta( get_queried_object_id(), 'et_ptemplate_settings', true );
$fullwidth = isset( $et_ptemplate_settings['et_fullwidthpage'] ) ? (bool) $et_ptemplate_settings['et_fullwidthpage'] : false;
if ( $fullwidth ) $fullwidth_view = true;
}
if ( is_single() && 'on' == get_post_meta( get_queried_object_id(), '_et_full_post', true ) ) $fullwidth_view = true;
$classes[] = apply_filters( 'et_fullwidth_view_body_class', $fullwidth_view ) ? 'et_fullwidth_view' : 'et_includes_sidebar';
return $classes;
}
function et_add_responsive_shortcodes_css(){
global $shortname;
if ( 'on' == et_get_option( $shortname . '_responsive_shortcodes', 'on' ) )
wp_enqueue_style( 'et-shortcodes-responsive-css', ET_SHORTCODES_DIR . '/css/shortcodes_responsive.css', false, ET_SHORTCODES_VERSION, 'all' );
}
/**
* Loads theme settings
*
*/
if ( ! function_exists( 'et_load_core_options' ) ) {
function et_load_core_options() {
global $shortname;
require_once get_template_directory() . esc_attr( "/options_{$shortname}.php" );
}
}
/**
* Adds custom css option content to
*
*/
function et_add_custom_css() {
// use default wp custom css system starting from WP 4.7
// fallback to our legacy custom css system otherwise
if ( function_exists( 'wp_get_custom_css_post' ) ) {
return;
}
global $shortname;
$custom_css = et_get_option( "{$shortname}_custom_css" );
if ( false === $custom_css || '' == $custom_css ) return;
/**
* The theme doesn't strip slashes from custom css, when saving to the database,
* so it does that before outputting the code on front-end
*/
echo '';
}
add_action( 'wp_head', 'et_add_custom_css', 100 );
if ( ! function_exists( 'et_get_google_fonts' ) ) :
/**
* Returns the list of popular google fonts
*
*/
function et_get_google_fonts() {
$google_fonts = array(
'Open Sans' => array(
'styles' => '300italic,400italic,600italic,700italic,800italic,400,300,600,700,800',
'character_set' => 'latin,cyrillic-ext,greek-ext,greek,vietnamese,latin-ext,cyrillic',
'type' => 'sans-serif',
),
'Oswald' => array(
'styles' => '400,300,700',
'character_set' => 'latin,latin-ext',
'type' => 'sans-serif',
),
'Droid Sans' => array(
'styles' => '400,700',
'character_set' => 'latin',
'type' => 'sans-serif',
),
'Lato' => array(
'styles' => '400,100,100italic,300,300italic,400italic,700,700italic,900,900italic',
'character_set' => 'latin',
'type' => 'sans-serif',
),
'Open Sans Condensed' => array(
'styles' => '300,300italic,700',
'character_set' => 'latin,cyrillic-ext,latin-ext,greek-ext,greek,vietnamese,cyrillic',
'type' => 'sans-serif',
),
'PT Sans' => array(
'styles' => '400,400italic,700,700italic',
'character_set' => 'latin,latin-ext,cyrillic',
'type' => 'sans-serif',
),
'Ubuntu' => array(
'styles' => '400,300,300italic,400italic,500,500italic,700,700italic',
'character_set' => 'latin,cyrillic-ext,cyrillic,greek-ext,greek,latin-ext',
'type' => 'sans-serif',
),
'PT Sans Narrow' => array(
'styles' => '400,700',
'character_set' => 'latin,latin-ext,cyrillic',
'type' => 'sans-serif',
),
'Yanone Kaffeesatz' => array(
'styles' => '400,200,300,700',
'character_set' => 'latin,latin-ext',
'type' => 'sans-serif',
),
'Roboto Condensed' => array(
'styles' => '400,300,300italic,400italic,700,700italic',
'character_set' => 'latin,cyrillic-ext,latin-ext,greek-ext,cyrillic,greek,vietnamese',
'type' => 'sans-serif',
),
'Source Sans Pro' => array(
'styles' => '400,200,200italic,300,300italic,400italic,600,600italic,700,700italic,900,900italic',
'character_set' => 'latin,latin-ext',
'type' => 'sans-serif',
),
'Nunito' => array(
'styles' => '400,300,700',
'character_set' => 'latin',
'type' => 'sans-serif',
),
'Francois One' => array(
'styles' => '400',
'character_set' => 'latin,latin-ext',
'type' => 'sans-serif',
),
'Roboto' => array(
'styles' => '400,100,100italic,300,300italic,400italic,500,500italic,700,700italic,900,900italic',
'character_set' => 'latin,cyrillic-ext,latin-ext,cyrillic,greek-ext,greek,vietnamese',
'type' => 'sans-serif',
),
'Raleway' => array(
'styles' => '400,100,200,300,600,500,700,800,900',
'character_set' => 'latin',
'type' => 'sans-serif',
),
'Arimo' => array(
'styles' => '400,400italic,700italic,700',
'character_set' => 'latin,cyrillic-ext,latin-ext,greek-ext,cyrillic,greek,vietnamese',
'type' => 'sans-serif',
),
'Cuprum' => array(
'styles' => '400,400italic,700italic,700',
'character_set' => 'latin,latin-ext,cyrillic',
'type' => 'sans-serif',
),
'Play' => array(
'styles' => '400,700',
'character_set' => 'latin,cyrillic-ext,cyrillic,greek-ext,greek,latin-ext',
'type' => 'sans-serif',
),
'Dosis' => array(
'styles' => '400,200,300,500,600,700,800',
'character_set' => 'latin,latin-ext',
'type' => 'sans-serif',
),
'Abel' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'sans-serif',
),
'Droid Serif' => array(
'styles' => '400,400italic,700,700italic',
'character_set' => 'latin',
'type' => 'serif',
),
'Arvo' => array(
'styles' => '400,400italic,700,700italic',
'character_set' => 'latin',
'type' => 'serif',
),
'Lora' => array(
'styles' => '400,400italic,700,700italic',
'character_set' => 'latin',
'type' => 'serif',
),
'Rokkitt' => array(
'styles' => '400,700',
'character_set' => 'latin',
'type' => 'serif',
),
'PT Serif' => array(
'styles' => '400,400italic,700,700italic',
'character_set' => 'latin,cyrillic',
'type' => 'serif',
),
'Bitter' => array(
'styles' => '400,400italic,700',
'character_set' => 'latin,latin-ext',
'type' => 'serif',
),
'Merriweather' => array(
'styles' => '400,300,900,700',
'character_set' => 'latin',
'type' => 'serif',
),
'Vollkorn' => array(
'styles' => '400,400italic,700italic,700',
'character_set' => 'latin',
'type' => 'serif',
),
'Cantata One' => array(
'styles' => '400',
'character_set' => 'latin,latin-ext',
'type' => 'serif',
),
'Kreon' => array(
'styles' => '400,300,700',
'character_set' => 'latin',
'type' => 'serif',
),
'Josefin Slab' => array(
'styles' => '400,100,100italic,300,300italic,400italic,600,700,700italic,600italic',
'character_set' => 'latin',
'type' => 'serif',
),
'Playfair Display' => array(
'styles' => '400,400italic,700,700italic,900italic,900',
'character_set' => 'latin,latin-ext,cyrillic',
'type' => 'serif',
),
'Bree Serif' => array(
'styles' => '400',
'character_set' => 'latin,latin-ext',
'type' => 'serif',
),
'Crimson Text' => array(
'styles' => '400,400italic,600,600italic,700,700italic',
'character_set' => 'latin',
'type' => 'serif',
),
'Old Standard TT' => array(
'styles' => '400,400italic,700',
'character_set' => 'latin',
'type' => 'serif',
),
'Sanchez' => array(
'styles' => '400,400italic',
'character_set' => 'latin,latin-ext',
'type' => 'serif',
),
'Crete Round' => array(
'styles' => '400,400italic',
'character_set' => 'latin,latin-ext',
'type' => 'serif',
),
'Cardo' => array(
'styles' => '400,400italic,700',
'character_set' => 'latin,greek-ext,greek,latin-ext',
'type' => 'serif',
),
'Noticia Text' => array(
'styles' => '400,400italic,700,700italic',
'character_set' => 'latin,vietnamese,latin-ext',
'type' => 'serif',
),
'Judson' => array(
'styles' => '400,400italic,700',
'character_set' => 'latin',
'type' => 'serif',
),
'Lobster' => array(
'styles' => '400',
'character_set' => 'latin,cyrillic-ext,latin-ext,cyrillic',
'type' => 'cursive',
),
'Unkempt' => array(
'styles' => '400,700',
'character_set' => 'latin',
'type' => 'cursive',
),
'Changa One' => array(
'styles' => '400,400italic',
'character_set' => 'latin',
'type' => 'cursive',
),
'Special Elite' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Chewy' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Comfortaa' => array(
'styles' => '400,300,700',
'character_set' => 'latin,cyrillic-ext,greek,latin-ext,cyrillic',
'type' => 'cursive',
),
'Boogaloo' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Fredoka One' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Luckiest Guy' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Cherry Cream Soda' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Lobster Two' => array(
'styles' => '400,400italic,700,700italic',
'character_set' => 'latin',
'type' => 'cursive',
),
'Righteous' => array(
'styles' => '400',
'character_set' => 'latin,latin-ext',
'type' => 'cursive',
),
'Squada One' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Black Ops One' => array(
'styles' => '400',
'character_set' => 'latin,latin-ext',
'type' => 'cursive',
),
'Happy Monkey' => array(
'styles' => '400',
'character_set' => 'latin,latin-ext',
'type' => 'cursive',
),
'Passion One' => array(
'styles' => '400,700,900',
'character_set' => 'latin,latin-ext',
'type' => 'cursive',
),
'Nova Square' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Metamorphous' => array(
'styles' => '400',
'character_set' => 'latin,latin-ext',
'type' => 'cursive',
),
'Poiret One' => array(
'styles' => '400',
'character_set' => 'latin,latin-ext,cyrillic',
'type' => 'cursive',
),
'Bevan' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Shadows Into Light' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'The Girl Next Door' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Coming Soon' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Dancing Script' => array(
'styles' => '400,700',
'character_set' => 'latin',
'type' => 'cursive',
),
'Pacifico' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Crafty Girls' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Calligraffitti' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Rock Salt' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Amatic SC' => array(
'styles' => '400,700',
'character_set' => 'latin',
'type' => 'cursive',
),
'Leckerli One' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Tangerine' => array(
'styles' => '400,700',
'character_set' => 'latin',
'type' => 'cursive',
),
'Reenie Beanie' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Satisfy' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Gloria Hallelujah' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Permanent Marker' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Covered By Your Grace' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Walter Turncoat' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Patrick Hand' => array(
'styles' => '400',
'character_set' => 'latin,vietnamese,latin-ext',
'type' => 'cursive',
),
'Schoolbell' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Indie Flower' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
);
return apply_filters( 'et_google_fonts', $google_fonts );
}
endif;
if ( ! function_exists( 'et_get_websafe_font_stack' ) ) :
/**
* Determines a websafe font stack, using font type
*
*/
function et_get_websafe_font_stack( $type = 'sans-serif' ) {
$font_stack = '';
switch ( $type ) {
case 'sans-serif':
$font_stack = 'Helvetica, Arial, Lucida, sans-serif';
break;
case 'serif':
$font_stack = 'Georgia, "Times New Roman", serif';
break;
case 'cursive':
$font_stack = 'cursive';
break;
}
return $font_stack;
}
endif;
if ( ! function_exists( 'et_gf_attach_font' ) ) :
/**
* Attaches Google Font to given css elements
*
*/
function et_gf_attach_font( $et_gf_font_name, $elements ) {
$google_fonts = et_get_google_fonts();
printf( '%s { font-family: \'%s\', %s; }',
esc_html( $elements ),
esc_html( $et_gf_font_name ),
et_get_websafe_font_stack( $google_fonts[$et_gf_font_name]['type'] )
);
}
endif;
if ( ! function_exists( 'et_gf_enqueue_fonts' ) ) :
/**
* Enqueues Google Fonts
*
*/
function et_gf_enqueue_fonts( $et_gf_font_names ) {
global $shortname;
if ( ! is_array( $et_gf_font_names ) || empty( $et_gf_font_names ) ) return;
$google_fonts = et_get_google_fonts();
$protocol = is_ssl() ? 'https' : 'http';
foreach ( $et_gf_font_names as $et_gf_font_name ) {
$google_font_character_set = $google_fonts[$et_gf_font_name]['character_set'];
// By default, only latin and latin-ext subsets are loaded, all available subsets can be enabled in ePanel
if ( 'false' == et_get_option( "{$shortname}_gf_enable_all_character_sets", 'false' ) ) {
$latin_ext = '';
if ( false !== strpos( $google_fonts[$et_gf_font_name]['character_set'], 'latin-ext' ) )
$latin_ext = ',latin-ext';
$google_font_character_set = "latin{$latin_ext}";
}
$query_args = array(
'family' => sprintf( '%s:%s',
str_replace( ' ', '+', $et_gf_font_name ),
apply_filters( 'et_gf_set_styles', $google_fonts[$et_gf_font_name]['styles'], $et_gf_font_name )
),
'subset' => apply_filters( 'et_gf_set_character_set', $google_font_character_set, $et_gf_font_name ),
);
$et_gf_font_name_slug = strtolower( str_replace( ' ', '-', $et_gf_font_name ) );
wp_enqueue_style( 'et-gf-' . $et_gf_font_name_slug, esc_url( add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" ) ), array(), null );
}
}
endif;
if ( ! function_exists( 'et_pb_get_google_api_key' ) ) :
function et_pb_get_google_api_key() {
$google_api_option = get_option( 'et_google_api_settings' );
$google_api_key = isset( $google_api_option['api_key'] ) ? $google_api_option['api_key'] : '';
return $google_api_key;
}
endif;
if ( ! function_exists( 'et_uc_theme_name' ) ) :
/**
* Fixes the bug with lowercase theme name, preventing a theme to update correctly,
* when an update is being performed via Themes page
*/
function et_uc_theme_name( $key, $raw_key ) {
if ( ! ( is_admin() && isset( $_REQUEST['action'] ) && 'update-theme' === $_REQUEST['action'] ) ) {
return $key;
}
$theme_info = wp_get_theme();
if ( is_child_theme() ) {
$theme_info = wp_get_theme( $theme_info->parent_theme );
}
$theme_name = $theme_info->display( 'Name' );
if ( $raw_key !== $theme_name ) {
return $key;
}
return $theme_name;
}
add_filter( 'sanitize_key', 'et_uc_theme_name', 10, 2 );
endif;
if ( ! function_exists( 'et_core_exists_in_active_plugins' ) ) :
function et_core_exists_in_active_plugins() {
$result = defined( 'ET_BUILDER_PLUGIN_DIR' )
|| defined( 'ET_BLOOM_PLUGIN_DIR' )
|| defined( 'ET_MONARCH_PLUGIN_DIR' );
return $result;
}
endif;