updated theme GeneratePress
version 3.2.0
This commit is contained in:
@ -115,6 +115,12 @@ function generate_add_inline_block_editor_styles( $editor_settings ) {
|
||||
$editor_settings['styles'][] = array( 'css' => $google_fonts_import );
|
||||
}
|
||||
}
|
||||
|
||||
$editor_settings['styles'][] = array( 'css' => wp_strip_all_tags( generate_do_inline_block_editor_css() ) );
|
||||
|
||||
if ( generate_is_using_dynamic_typography() ) {
|
||||
$editor_settings['styles'][] = array( 'css' => wp_strip_all_tags( GeneratePress_Typography::get_css( 'core' ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
return $editor_settings;
|
||||
@ -128,24 +134,10 @@ add_action( 'enqueue_block_editor_assets', 'generate_enqueue_backend_block_edito
|
||||
* @since 2.2
|
||||
*/
|
||||
function generate_enqueue_backend_block_editor_assets() {
|
||||
wp_enqueue_script( 'generate-block-editor-tinycolor', get_template_directory_uri() . '/assets/js/admin/tinycolor.js', false, GENERATE_VERSION, true );
|
||||
wp_enqueue_script( 'generate-block-editor-scripts', get_template_directory_uri() . '/assets/js/admin/block-editor.js', array( 'jquery', 'generate-block-editor-tinycolor' ), GENERATE_VERSION, true );
|
||||
|
||||
$show_editor_styles = apply_filters( 'generate_show_block_editor_styles', true );
|
||||
|
||||
if ( $show_editor_styles ) {
|
||||
// Using wp-edit-blocks for now until we do this: https://github.com/tomusborne/generatepress/pull/343.
|
||||
wp_add_inline_style( 'wp-edit-blocks', wp_strip_all_tags( generate_do_inline_block_editor_css() ) );
|
||||
|
||||
if ( generate_is_using_dynamic_typography() ) {
|
||||
wp_add_inline_style( 'wp-edit-blocks', wp_strip_all_tags( GeneratePress_Typography::get_css( 'core', 'editor' ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
wp_enqueue_script(
|
||||
'generate-block-editor',
|
||||
trailingslashit( get_template_directory_uri() ) . 'assets/dist/block-editor.js',
|
||||
array( 'wp-i18n', 'wp-components', 'wp-element' ),
|
||||
array( 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-plugins', 'wp-polyfill' ),
|
||||
GENERATE_VERSION,
|
||||
true
|
||||
);
|
||||
@ -167,56 +159,36 @@ function generate_enqueue_backend_block_editor_assets() {
|
||||
}
|
||||
|
||||
wp_localize_script(
|
||||
'generate-block-editor-scripts',
|
||||
'generate_block_editor',
|
||||
'generate-block-editor',
|
||||
'generatepressBlockEditor',
|
||||
array(
|
||||
'global_sidebar_layout' => generate_get_block_editor_sidebar_layout( false ),
|
||||
'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' ),
|
||||
'content_padding_right' => absint( $spacing_settings['content_right'] ) . 'px',
|
||||
'content_padding_left' => absint( $spacing_settings['content_left'] ) . 'px',
|
||||
'content_title' => generate_get_block_editor_show_content_title() ? 'true' : 'false',
|
||||
'disable_content_title' => esc_html__( 'Disable Content Title', 'generatepress' ),
|
||||
'show_content_title' => esc_html__( 'Show Content Title', 'generatepress' ),
|
||||
'globalSidebarLayout' => generate_get_block_editor_sidebar_layout( false ),
|
||||
'containerWidth' => generate_get_option( 'container_width' ),
|
||||
'contentPaddingRight' => absint( $spacing_settings['content_right'] ) . 'px',
|
||||
'contentPaddingLeft' => absint( $spacing_settings['content_left'] ) . 'px',
|
||||
'rightSidebarWidth' => apply_filters( 'generate_right_sidebar_width', '25' ),
|
||||
'leftSidebarWidth' => apply_filters( 'generate_left_sidebar_width', '25' ),
|
||||
'text_color' => $text_color,
|
||||
'show_editor_styles' => $show_editor_styles,
|
||||
'show_editor_styles' => apply_filters( 'generate_show_block_editor_styles', true ),
|
||||
'contentAreaType' => apply_filters( 'generate_block_editor_content_area_type', '' ),
|
||||
'customContentWidth' => apply_filters( 'generate_block_editor_container_width', '' ),
|
||||
)
|
||||
);
|
||||
|
||||
wp_register_style( 'generate-block-editor', false, array(), true, true );
|
||||
wp_add_inline_style( 'generate-block-editor', generate_do_inline_block_editor_css( 'block-editor' ) );
|
||||
wp_enqueue_style( 'generate-block-editor' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Write our CSS for the block editor.
|
||||
*
|
||||
* @since 2.2
|
||||
* @param string $for Define whether this CSS for the block content or the block editor.
|
||||
*/
|
||||
function generate_do_inline_block_editor_css() {
|
||||
$color_settings = wp_parse_args(
|
||||
get_option( 'generate_settings', array() ),
|
||||
generate_get_color_defaults()
|
||||
);
|
||||
|
||||
$font_settings = wp_parse_args(
|
||||
get_option( 'generate_settings', array() ),
|
||||
generate_get_default_fonts()
|
||||
);
|
||||
|
||||
function generate_do_inline_block_editor_css( $for = 'block-content' ) {
|
||||
$css = new GeneratePress_CSS();
|
||||
|
||||
$content_width = generate_get_block_editor_content_width();
|
||||
|
||||
$spacing_settings = wp_parse_args(
|
||||
get_option( 'generate_spacing_settings', array() ),
|
||||
generate_spacing_get_defaults()
|
||||
);
|
||||
|
||||
$content_width_calc = sprintf(
|
||||
'calc(%1$s - %2$s - %3$s)',
|
||||
absint( $content_width ) . 'px',
|
||||
absint( $spacing_settings['content_left'] ) . 'px',
|
||||
absint( $spacing_settings['content_right'] ) . 'px'
|
||||
);
|
||||
|
||||
$css->set_selector( ':root' );
|
||||
|
||||
$global_colors = generate_get_global_colors();
|
||||
@ -231,23 +203,55 @@ function generate_do_inline_block_editor_css() {
|
||||
foreach ( (array) $global_colors as $key => $data ) {
|
||||
if ( ! empty( $data['slug'] ) && ! empty( $data['color'] ) ) {
|
||||
$css->set_selector( '.has-' . $data['slug'] . '-color' );
|
||||
$css->add_property( 'color', $data['color'] );
|
||||
$css->add_property( 'color', 'var(--' . $data['slug'] . ')' );
|
||||
|
||||
$css->set_selector( '.has-' . $data['slug'] . '-background-color' );
|
||||
$css->add_property( 'background-color', $data['color'] );
|
||||
$css->add_property( 'background-color', 'var(--' . $data['slug'] . ')' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$css->set_selector( 'body .wp-block, html body.gutenberg-editor-page .editor-post-title__block, html body.gutenberg-editor-page .editor-default-block-appender, html body.gutenberg-editor-page .editor-block-list__block' );
|
||||
|
||||
if ( 'true' === get_post_meta( get_the_ID(), '_generate-full-width-content', true ) ) {
|
||||
$css->add_property( 'max-width', '100%' );
|
||||
} else {
|
||||
$css->add_property( 'max-width', $content_width_calc );
|
||||
// If this CSS is for the editor only (not the block content), we can return here.
|
||||
if ( 'block-editor' === $for ) {
|
||||
return $css->css_output();
|
||||
}
|
||||
|
||||
$css->set_selector( '.editor-styles-wrapper .wp-block[data-align="full"]' );
|
||||
$color_settings = wp_parse_args(
|
||||
get_option( 'generate_settings', array() ),
|
||||
generate_get_color_defaults()
|
||||
);
|
||||
|
||||
$font_settings = wp_parse_args(
|
||||
get_option( 'generate_settings', array() ),
|
||||
generate_get_default_fonts()
|
||||
);
|
||||
|
||||
$content_width = generate_get_block_editor_content_width();
|
||||
|
||||
$spacing_settings = wp_parse_args(
|
||||
get_option( 'generate_spacing_settings', array() ),
|
||||
generate_spacing_get_defaults()
|
||||
);
|
||||
|
||||
$content_width_calc = sprintf(
|
||||
'calc(%1$s - %2$s - %3$s)',
|
||||
absint( $content_width ) . 'px',
|
||||
absint( $spacing_settings['content_left'] ) . 'px',
|
||||
absint( $spacing_settings['content_right'] ) . 'px'
|
||||
);
|
||||
|
||||
$css->set_selector( 'body' );
|
||||
$css->add_property(
|
||||
'--content-width',
|
||||
'true' === get_post_meta( get_the_ID(), '_generate-full-width-content', true )
|
||||
? '100%'
|
||||
: $content_width_calc
|
||||
);
|
||||
|
||||
$css->set_selector( 'body .wp-block' );
|
||||
$css->add_property( 'max-width', 'var(--content-width)' );
|
||||
|
||||
$css->set_selector( '.wp-block[data-align="full"]' );
|
||||
$css->add_property( 'max-width', 'none' );
|
||||
|
||||
$css->set_selector( '.wp-block[data-align="wide"]' );
|
||||
@ -262,6 +266,9 @@ function generate_do_inline_block_editor_css() {
|
||||
}
|
||||
|
||||
if ( 'hover' === $underline_links ) {
|
||||
$css->set_selector( '.wp-block a' );
|
||||
$css->add_property( 'text-decoration', 'none' );
|
||||
|
||||
$css->set_selector( '.wp-block a:hover, .wp-block a:focus' );
|
||||
$css->add_property( 'text-decoration', 'underline' );
|
||||
}
|
||||
@ -276,6 +283,9 @@ function generate_do_inline_block_editor_css() {
|
||||
|
||||
$css->set_selector( 'a.button, .wp-block-button__link' );
|
||||
$css->add_property( 'text-decoration', 'none' );
|
||||
} else {
|
||||
$css->set_selector( '.wp-block a' );
|
||||
$css->add_property( 'text-decoration', 'none' );
|
||||
}
|
||||
|
||||
if ( apply_filters( 'generate_do_group_inner_container_style', true ) ) {
|
||||
@ -286,14 +296,14 @@ function generate_do_inline_block_editor_css() {
|
||||
$css->add_property( 'padding', generate_padding_css( $spacing_settings['content_top'], $spacing_settings['content_right'], $spacing_settings['content_bottom'], $spacing_settings['content_left'] ) );
|
||||
}
|
||||
|
||||
$css->set_selector( '.editor-styles-wrapper a.button, .editor-styles-wrapper a.button:visited, .wp-block-button__link:not(.has-background)' );
|
||||
$css->set_selector( 'a.button, a.button:visited, .wp-block-button__link:not(.has-background)' );
|
||||
$css->add_property( 'color', $color_settings['form_button_text_color'] );
|
||||
$css->add_property( 'background-color', $color_settings['form_button_background_color'] );
|
||||
$css->add_property( 'padding', '10px 20px' );
|
||||
$css->add_property( 'border', '0' );
|
||||
$css->add_property( 'border-radius', '0' );
|
||||
|
||||
$css->set_selector( '.editor-styles-wrapper a.button:hover, .editor-styles-wrapper a.button:active, .editor-styles-wrapper a.button:focus, .wp-block-button__link:not(.has-background):active, .wp-block-button__link:not(.has-background):focus, .wp-block-button__link:not(.has-background):hover' );
|
||||
$css->set_selector( 'a.button:hover, a.button:active, a.button:focus, .wp-block-button__link:not(.has-background):active, .wp-block-button__link:not(.has-background):focus, .wp-block-button__link:not(.has-background):hover' );
|
||||
$css->add_property( 'color', $color_settings['form_button_text_color_hover'] );
|
||||
$css->add_property( 'background-color', $color_settings['form_button_background_color_hover'] );
|
||||
|
||||
@ -308,7 +318,7 @@ function generate_do_inline_block_editor_css() {
|
||||
$buttons_family = generate_get_font_family_css( 'font_buttons', 'generate_settings', generate_get_default_fonts() );
|
||||
}
|
||||
|
||||
$css->set_selector( 'body.gutenberg-editor-page .block-editor-block-list__block, html .editor-styles-wrapper' );
|
||||
$css->set_selector( 'body' );
|
||||
|
||||
if ( ! generate_is_using_dynamic_typography() ) {
|
||||
$css->add_property( 'font-family', $body_family );
|
||||
@ -330,15 +340,15 @@ function generate_do_inline_block_editor_css() {
|
||||
}
|
||||
|
||||
if ( ! generate_is_using_dynamic_typography() ) {
|
||||
$css->set_selector( 'html .editor-styles-wrapper, html .editor-styles-wrapper p, html .editor-styles-wrapper .mce-content-body' );
|
||||
$css->set_selector( 'body, p' );
|
||||
$css->add_property( 'line-height', floatval( $font_settings['body_line_height'] ) );
|
||||
|
||||
$css->set_selector( 'html .editor-styles-wrapper p' );
|
||||
$css->set_selector( 'p' );
|
||||
$css->add_property( 'margin-top', '0px' );
|
||||
$css->add_property( 'margin-bottom', $font_settings['paragraph_margin'], false, 'em' );
|
||||
}
|
||||
|
||||
$css->set_selector( 'html .editor-styles-wrapper h1, .wp-block-heading h1.editor-rich-text__tinymce, .editor-styles-wrapper .editor-post-title__input' );
|
||||
$css->set_selector( 'h1' );
|
||||
|
||||
if ( ! generate_is_using_dynamic_typography() ) {
|
||||
$css->add_property( 'font-family', 'inherit' === $h1_family || '' === $h1_family ? $body_family : $h1_family );
|
||||
@ -363,7 +373,7 @@ function generate_do_inline_block_editor_css() {
|
||||
$css->add_property( 'color', $color_settings['content_title_color'] );
|
||||
}
|
||||
|
||||
$css->set_selector( 'html .editor-styles-wrapper h2, .wp-block-heading h2.editor-rich-text__tinymce' );
|
||||
$css->set_selector( 'h2' );
|
||||
|
||||
if ( ! generate_is_using_dynamic_typography() ) {
|
||||
$css->add_property( 'font-family', $h2_family );
|
||||
@ -383,7 +393,7 @@ function generate_do_inline_block_editor_css() {
|
||||
$css->add_property( 'color', generate_get_option( 'text_color' ) );
|
||||
}
|
||||
|
||||
$css->set_selector( 'html .editor-styles-wrapper h3, .wp-block-heading h3.editor-rich-text__tinymce' );
|
||||
$css->set_selector( 'h3' );
|
||||
|
||||
if ( ! generate_is_using_dynamic_typography() ) {
|
||||
$css->add_property( 'font-family', $h3_family );
|
||||
@ -403,7 +413,7 @@ function generate_do_inline_block_editor_css() {
|
||||
$css->add_property( 'color', generate_get_option( 'text_color' ) );
|
||||
}
|
||||
|
||||
$css->set_selector( 'html .editor-styles-wrapper h4, .wp-block-heading h4.editor-rich-text__tinymce' );
|
||||
$css->set_selector( 'h4' );
|
||||
|
||||
if ( ! generate_is_using_dynamic_typography() ) {
|
||||
$css->add_property( 'font-family', $h4_family );
|
||||
@ -431,7 +441,7 @@ function generate_do_inline_block_editor_css() {
|
||||
$css->add_property( 'color', generate_get_option( 'text_color' ) );
|
||||
}
|
||||
|
||||
$css->set_selector( 'html .editor-styles-wrapper h5, .wp-block-heading h5.editor-rich-text__tinymce' );
|
||||
$css->set_selector( 'h5' );
|
||||
|
||||
if ( ! generate_is_using_dynamic_typography() ) {
|
||||
$css->add_property( 'font-family', $h5_family );
|
||||
@ -459,7 +469,7 @@ function generate_do_inline_block_editor_css() {
|
||||
$css->add_property( 'color', generate_get_option( 'text_color' ) );
|
||||
}
|
||||
|
||||
$css->set_selector( 'html .editor-styles-wrapper h6, .wp-block-heading h6.editor-rich-text__tinymce' );
|
||||
$css->set_selector( 'h6' );
|
||||
|
||||
if ( ! generate_is_using_dynamic_typography() ) {
|
||||
$css->add_property( 'font-family', $h6_family );
|
||||
@ -487,7 +497,7 @@ function generate_do_inline_block_editor_css() {
|
||||
$css->add_property( 'color', generate_get_option( 'text_color' ) );
|
||||
}
|
||||
|
||||
$css->set_selector( '.editor-styles-wrapper a.button, .block-editor-block-list__layout .wp-block-button .wp-block-button__link' );
|
||||
$css->set_selector( 'a.button, .block-editor-block-list__layout .wp-block-button .wp-block-button__link' );
|
||||
|
||||
if ( ! generate_is_using_dynamic_typography() ) {
|
||||
$css->add_property( 'font-family', $buttons_family );
|
||||
@ -505,7 +515,7 @@ function generate_do_inline_block_editor_css() {
|
||||
$css->set_selector( '.block-editor__container .edit-post-visual-editor' );
|
||||
$css->add_property( 'background-color', generate_get_option( 'background_color' ) );
|
||||
|
||||
$css->set_selector( '.block-editor__container .editor-styles-wrapper' );
|
||||
$css->set_selector( 'body' );
|
||||
|
||||
if ( $color_settings['content_background_color'] ) {
|
||||
$css->add_property( 'background-color', $color_settings['content_background_color'] );
|
||||
@ -513,7 +523,7 @@ function generate_do_inline_block_editor_css() {
|
||||
$css->add_property( 'background-color', generate_get_option( 'background_color' ) );
|
||||
}
|
||||
} else {
|
||||
$css->set_selector( 'body .editor-styles-wrapper' );
|
||||
$css->set_selector( 'body' );
|
||||
$css->add_property( 'background-color', generate_get_option( 'background_color' ) );
|
||||
|
||||
if ( $color_settings['content_background_color'] ) {
|
||||
@ -524,7 +534,7 @@ function generate_do_inline_block_editor_css() {
|
||||
}
|
||||
}
|
||||
|
||||
$css->set_selector( '.block-editor-block-list__block a, .block-editor-block-list__block a:visited' );
|
||||
$css->set_selector( 'a, a:visited' );
|
||||
|
||||
if ( $color_settings['content_link_color'] ) {
|
||||
$css->add_property( 'color', $color_settings['content_link_color'] );
|
||||
@ -532,7 +542,7 @@ function generate_do_inline_block_editor_css() {
|
||||
$css->add_property( 'color', generate_get_option( 'link_color' ) );
|
||||
}
|
||||
|
||||
$css->set_selector( '.block-editor-block-list__block a:hover, .block-editor-block-list__block a:focus, .block-editor-block-list__block a:active' );
|
||||
$css->set_selector( 'a:hover, a:focus, a:active' );
|
||||
|
||||
if ( $color_settings['content_link_hover_color'] ) {
|
||||
$css->add_property( 'color', $color_settings['content_link_hover_color'] );
|
||||
|
@ -217,10 +217,10 @@ class GeneratePress_Dashboard {
|
||||
array(
|
||||
'hasPremium' => defined( 'GP_PREMIUM_VERSION' ),
|
||||
'customizeSectionUrls' => array(
|
||||
'siteIdentitySection' => admin_url( 'customize.php?autofocus[section]=title_tagline' ),
|
||||
'colorsSection' => admin_url( 'customize.php?autofocus[section]=generate_colors_section' ),
|
||||
'typographySection' => admin_url( 'customize.php?autofocus[section]=generate_typography_section' ),
|
||||
'layoutSection' => admin_url( 'customize.php?autofocus[panel]=generate_layout_panel' ),
|
||||
'siteIdentitySection' => add_query_arg( rawurlencode( 'autofocus[section]' ), 'title_tagline', wp_customize_url() ),
|
||||
'colorsSection' => add_query_arg( rawurlencode( 'autofocus[section]' ), 'generate_colors_section', wp_customize_url() ),
|
||||
'typographySection' => add_query_arg( rawurlencode( 'autofocus[section]' ), 'generate_typography_section', wp_customize_url() ),
|
||||
'layoutSection' => add_query_arg( rawurlencode( 'autofocus[panel]' ), 'generate_layout_panel', wp_customize_url() ),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
@ -116,6 +116,9 @@ class GeneratePress_HTML_Attributes {
|
||||
|
||||
case 'footer-entry-meta':
|
||||
return $this->footer_entry_meta( $attributes );
|
||||
|
||||
case 'woocommerce-content':
|
||||
return $this->woocommerce_content( $attributes );
|
||||
}
|
||||
|
||||
return $attributes;
|
||||
@ -311,7 +314,7 @@ class GeneratePress_HTML_Attributes {
|
||||
public function post_navigation( $attributes ) {
|
||||
if ( is_single() ) {
|
||||
$attributes['class'] .= ' post-navigation';
|
||||
$attributes['aria-label'] = esc_attr__( 'Single Post', 'generatepress' );
|
||||
$attributes['aria-label'] = esc_attr__( 'Posts', 'generatepress' );
|
||||
} else {
|
||||
$attributes['class'] .= ' paging-navigation';
|
||||
$attributes['aria-label'] = esc_attr__( 'Archive Page', 'generatepress' );
|
||||
@ -460,6 +463,34 @@ class GeneratePress_HTML_Attributes {
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add attributes to our WooCommerce content container.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @param array $attributes The existing attributes.
|
||||
*/
|
||||
public function woocommerce_content( $attributes ) {
|
||||
if ( is_singular() ) {
|
||||
$attributes['id'] = 'post-' . get_the_ID();
|
||||
$attributes['class'] = esc_attr( implode( ' ', get_post_class( '', get_the_ID() ) ) );
|
||||
|
||||
if ( 'microdata' === generate_get_schema_type() ) {
|
||||
$type = apply_filters( 'generate_article_itemtype', 'CreativeWork' );
|
||||
|
||||
$attributes['itemtype'] = sprintf(
|
||||
'itemtype="https://schema.org/%s"',
|
||||
$type
|
||||
);
|
||||
|
||||
$attributes['itemscope'] = true;
|
||||
}
|
||||
} else {
|
||||
$attributes['class'] = 'woocommerce-archive-wrapper';
|
||||
}
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
}
|
||||
|
||||
GeneratePress_HTML_Attributes::get_instance();
|
||||
|
@ -75,6 +75,7 @@ class GeneratePress_Typography {
|
||||
$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 );
|
||||
@ -118,9 +119,8 @@ class GeneratePress_Typography {
|
||||
* Build our typography CSS.
|
||||
*
|
||||
* @param string $module The name of the module we're generating CSS for.
|
||||
* @param string $type Either frontend or editor.
|
||||
*/
|
||||
public static function get_css( $module = 'core', $type = 'frontend' ) {
|
||||
public static function get_css( $module = 'core' ) {
|
||||
$typography = generate_get_option( 'typography' );
|
||||
|
||||
// Get data for a specific module so CSS can be compiled separately.
|
||||
@ -137,18 +137,13 @@ class GeneratePress_Typography {
|
||||
$body_selector = 'body';
|
||||
$paragraph_selector = 'p';
|
||||
|
||||
if ( 'editor' === $type ) {
|
||||
$body_selector = 'html .editor-styles-wrapper';
|
||||
$paragraph_selector = 'html .editor-styles-wrapper p';
|
||||
}
|
||||
|
||||
foreach ( $typography as $key => $data ) {
|
||||
$options = wp_parse_args(
|
||||
$data,
|
||||
self::get_defaults()
|
||||
);
|
||||
|
||||
$selector = self::get_css_selector( $options['selector'], $type );
|
||||
$selector = self::get_css_selector( $options['selector'] );
|
||||
|
||||
if ( 'custom' === $selector ) {
|
||||
$selector = $options['customSelector'];
|
||||
@ -160,6 +155,8 @@ class GeneratePress_Typography {
|
||||
$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'] );
|
||||
|
||||
@ -221,98 +218,63 @@ class GeneratePress_Typography {
|
||||
* Get the CSS selector.
|
||||
*
|
||||
* @param string $selector The saved selector to look up.
|
||||
* @param string $type Whether we're getting the selectors for the frontend or editor.
|
||||
*/
|
||||
public static function get_css_selector( $selector, $type ) {
|
||||
if ( 'frontend' === $type ) {
|
||||
switch ( $selector ) {
|
||||
case 'body':
|
||||
$selector = 'body, button, input, select, textarea';
|
||||
break;
|
||||
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 'main-title':
|
||||
$selector = '.main-title';
|
||||
break;
|
||||
|
||||
case 'site-description':
|
||||
$selector = '.site-description';
|
||||
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-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-sub-menu-items':
|
||||
$selector = '.main-navigation .main-nav ul ul li a';
|
||||
break;
|
||||
|
||||
case 'primary-menu-toggle':
|
||||
$selector = '.main-navigation .menu-toggle';
|
||||
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 '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 'all-headings':
|
||||
$selector = 'h1, h2, h3, h4, h5, h6';
|
||||
break;
|
||||
|
||||
case 'single-content-title':
|
||||
$selector = 'h1.entry-title';
|
||||
break;
|
||||
case 'single-content-title':
|
||||
$selector = 'h1.entry-title';
|
||||
break;
|
||||
|
||||
case 'archive-content-title':
|
||||
$selector = 'h2.entry-title';
|
||||
break;
|
||||
case 'archive-content-title':
|
||||
$selector = 'h2.entry-title';
|
||||
break;
|
||||
|
||||
case 'top-bar':
|
||||
$selector = '.top-bar';
|
||||
break;
|
||||
case 'top-bar':
|
||||
$selector = '.top-bar';
|
||||
break;
|
||||
|
||||
case 'widget-titles':
|
||||
$selector = '.widget-title';
|
||||
break;
|
||||
case 'widget-titles':
|
||||
$selector = '.widget-title';
|
||||
break;
|
||||
|
||||
case 'footer':
|
||||
$selector = '.site-info';
|
||||
break;
|
||||
}
|
||||
case 'footer':
|
||||
$selector = '.site-info';
|
||||
break;
|
||||
}
|
||||
|
||||
if ( 'editor' === $type ) {
|
||||
switch ( $selector ) {
|
||||
case 'body':
|
||||
$selector = 'html .editor-styles-wrapper';
|
||||
break;
|
||||
|
||||
case 'buttons':
|
||||
$selector = '.editor-styles-wrapper a.button, .block-editor-block-list__layout .wp-block-button .wp-block-button__link';
|
||||
break;
|
||||
|
||||
case 'all-headings':
|
||||
$selector = 'html .editor-styles-wrapper h1, html .editor-styles-wrapper h2, html .editor-styles-wrapper h3, html .editor-styles-wrapper h4, html .editor-styles-wrapper h5, html .editor-styles-wrapper h6';
|
||||
break;
|
||||
|
||||
case 'h1':
|
||||
$selector = 'html .editor-styles-wrapper h1, html .editor-styles-wrapper .editor-post-title__input';
|
||||
break;
|
||||
|
||||
case 'single-content-title':
|
||||
$selector = 'html .editor-styles-wrapper .editor-post-title__input';
|
||||
break;
|
||||
|
||||
case 'h2':
|
||||
case 'h3':
|
||||
case 'h4':
|
||||
case 'h5':
|
||||
case 'h6':
|
||||
$selector = 'html .editor-styles-wrapper ' . $selector;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return apply_filters( 'generate_typography_css_selector', $selector, $type );
|
||||
return apply_filters( 'generate_typography_css_selector', $selector );
|
||||
}
|
||||
|
||||
/**
|
||||
@ -338,6 +300,11 @@ class GeneratePress_Typography {
|
||||
}
|
||||
|
||||
if ( ! empty( $font_family_args['googleFont'] ) && ! empty( $font_family_args['googleFontCategory'] ) ) {
|
||||
// Add quotations around font names with standalone numbers.
|
||||
if ( preg_match( '/(?<!\S)\d+(?!\S)/', $font_family ) ) {
|
||||
$font_family = '"' . $font_family . '"';
|
||||
}
|
||||
|
||||
$font_family = $font_family . ', ' . $font_family_args['googleFontCategory'];
|
||||
} elseif ( 'System Default' === $font_family ) {
|
||||
$font_family = generate_get_system_default_font();
|
||||
@ -355,6 +322,8 @@ class GeneratePress_Typography {
|
||||
'fontFamily' => '',
|
||||
'fontWeight' => '',
|
||||
'textTransform' => '',
|
||||
'textDecoration' => '',
|
||||
'fontStyle' => '',
|
||||
'fontSize' => '',
|
||||
'fontSizeTablet' => '',
|
||||
'fontSizeMobile' => '',
|
||||
|
@ -125,6 +125,12 @@ if ( ! function_exists( 'generate_base_css' ) ) {
|
||||
$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' ) ) {
|
||||
@ -255,10 +261,10 @@ if ( ! function_exists( 'generate_base_css' ) ) {
|
||||
foreach ( (array) $global_colors as $key => $data ) {
|
||||
if ( ! empty( $data['slug'] ) && ! empty( $data['color'] ) ) {
|
||||
$css->set_selector( '.has-' . $data['slug'] . '-color' );
|
||||
$css->add_property( 'color', $data['color'] );
|
||||
$css->add_property( 'color', 'var(--' . $data['slug'] . ')' );
|
||||
|
||||
$css->set_selector( '.has-' . $data['slug'] . '-background-color' );
|
||||
$css->add_property( 'background-color', $data['color'] );
|
||||
$css->add_property( 'background-color', 'var(--' . $data['slug'] . ')' );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -819,7 +825,7 @@ if ( ! function_exists( 'generate_spacing_css' ) ) {
|
||||
$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), .one-container.blog .post:not(:last-child)' );
|
||||
$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' );
|
||||
|
@ -274,7 +274,7 @@ if ( ! function_exists( 'generate_customize_register' ) ) {
|
||||
|
||||
return $new_settings;
|
||||
},
|
||||
'transport' => 'refresh',
|
||||
'transport' => 'postMessage',
|
||||
),
|
||||
array(
|
||||
'type' => 'generate-color-manager-control',
|
||||
@ -440,6 +440,8 @@ if ( ! function_exists( 'generate_customize_register' ) ) {
|
||||
'fontFamily' => 'sanitize_text_field',
|
||||
'fontWeight' => 'sanitize_text_field',
|
||||
'textTransform' => 'sanitize_text_field',
|
||||
'textDecoration' => 'sanitize_text_field',
|
||||
'fontStyle' => 'sanitize_text_field',
|
||||
'fontSize' => 'generate_sanitize_empty_decimal_integer',
|
||||
'fontSizeTablet' => 'generate_sanitize_empty_decimal_integer',
|
||||
'fontSizeMobile' => 'generate_sanitize_empty_decimal_integer',
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,142 +1,142 @@
|
||||
.customize-control-generatepress-range-slider .generatepress-slider {
|
||||
position: relative;
|
||||
width: calc(100% - 60px);
|
||||
height: 6px;
|
||||
background-color: rgba(0,0,0,.10);
|
||||
cursor: pointer;
|
||||
-webkit-transition: background .5s;
|
||||
-moz-transition: background .5s;
|
||||
transition: background .5s;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .has-unit .generatepress-slider {
|
||||
width: calc(100% - 90px);
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp_range_value.hide-value {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp_range_value.hide-value + .generatepress-slider {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .generatepress-slider .ui-slider-handle {
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
background-color: #3498D9;
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
-webkit-transform: translateY(-50%) translateX(-4px);
|
||||
transform: translateY(-50%) translateX(-4px);
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.gp-range-title-area {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.gp-range-slider-controls {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .wrapper {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-pack: justify;
|
||||
-ms-flex-pack: justify;
|
||||
justify-content: space-between;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp_range_value {
|
||||
font-size: 14px;
|
||||
padding: 0;
|
||||
font-weight: 400;
|
||||
width: 50px;
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .has-unit .gp_range_value {
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp_range_value span.value {
|
||||
font-size: 12px;
|
||||
width: calc(100% - 2px);
|
||||
text-align: center;
|
||||
min-height: 30px;
|
||||
background: #FFF;
|
||||
line-height: 30px;
|
||||
border: 1px solid #DDD;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .has-unit .gp_range_value span.value {
|
||||
width: calc(100% - 32px);
|
||||
display: block;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp_range_value .unit {
|
||||
width: 29px;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
line-height: 30px;
|
||||
background: #fff;
|
||||
border: 1px solid #ddd;
|
||||
margin-left: 1px;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .generatepress-range-slider-reset span {
|
||||
font-size: 16px;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp_range_value input {
|
||||
font-size: 12px;
|
||||
padding: 0px;
|
||||
text-align: center;
|
||||
min-height: 30px;
|
||||
height: auto;
|
||||
border-radius: 0;
|
||||
border-color: #ddd;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .has-unit .gp_range_value input {
|
||||
width: calc(100% - 30px);
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp-range-title-area .dashicons {
|
||||
cursor: pointer;
|
||||
font-size: 11px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
color: #222;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp-range-title-area .dashicons:hover {
|
||||
background: #fafafa;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp-range-title-area .dashicons.selected {
|
||||
background: #fff;
|
||||
color: #222;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp-device-controls > span:first-child:last-child {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .sub-description {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.customize-control-generatepress-range-slider .generatepress-slider {
|
||||
position: relative;
|
||||
width: calc(100% - 60px);
|
||||
height: 6px;
|
||||
background-color: rgba(0,0,0,.10);
|
||||
cursor: pointer;
|
||||
-webkit-transition: background .5s;
|
||||
-moz-transition: background .5s;
|
||||
transition: background .5s;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .has-unit .generatepress-slider {
|
||||
width: calc(100% - 90px);
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp_range_value.hide-value {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp_range_value.hide-value + .generatepress-slider {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .generatepress-slider .ui-slider-handle {
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
background-color: #3498D9;
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
-webkit-transform: translateY(-50%) translateX(-4px);
|
||||
transform: translateY(-50%) translateX(-4px);
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.gp-range-title-area {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.gp-range-slider-controls {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .wrapper {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-pack: justify;
|
||||
-ms-flex-pack: justify;
|
||||
justify-content: space-between;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp_range_value {
|
||||
font-size: 14px;
|
||||
padding: 0;
|
||||
font-weight: 400;
|
||||
width: 50px;
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .has-unit .gp_range_value {
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp_range_value span.value {
|
||||
font-size: 12px;
|
||||
width: calc(100% - 2px);
|
||||
text-align: center;
|
||||
min-height: 30px;
|
||||
background: #FFF;
|
||||
line-height: 30px;
|
||||
border: 1px solid #DDD;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .has-unit .gp_range_value span.value {
|
||||
width: calc(100% - 32px);
|
||||
display: block;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp_range_value .unit {
|
||||
width: 29px;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
line-height: 30px;
|
||||
background: #fff;
|
||||
border: 1px solid #ddd;
|
||||
margin-left: 1px;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .generatepress-range-slider-reset span {
|
||||
font-size: 16px;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp_range_value input {
|
||||
font-size: 12px;
|
||||
padding: 0px;
|
||||
text-align: center;
|
||||
min-height: 30px;
|
||||
height: auto;
|
||||
border-radius: 0;
|
||||
border-color: #ddd;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .has-unit .gp_range_value input {
|
||||
width: calc(100% - 30px);
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp-range-title-area .dashicons {
|
||||
cursor: pointer;
|
||||
font-size: 11px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
color: #222;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp-range-title-area .dashicons:hover {
|
||||
background: #fafafa;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp-range-title-area .dashicons.selected {
|
||||
background: #fff;
|
||||
color: #222;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .gp-device-controls > span:first-child:last-child {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.customize-control-generatepress-range-slider .sub-description {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
@ -1,47 +1,47 @@
|
||||
.generatepress-font-family {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.generatepress-weight-transform-wrapper {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-pack: justify;
|
||||
-ms-flex-pack: justify;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.generatepress-font-weight,
|
||||
.generatepress-font-transform {
|
||||
width: calc(50% - 5px);
|
||||
}
|
||||
|
||||
span.select2-container.select2-container--default.select2-container--open li.select2-results__option {
|
||||
margin:0;
|
||||
}
|
||||
|
||||
span.select2-container.select2-container--default.select2-container--open{
|
||||
z-index:999999;
|
||||
}
|
||||
|
||||
.select2-selection__rendered li {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single,
|
||||
.select2-container--default.select2-container .select2-selection--multiple,
|
||||
.select2-dropdown,
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__choice {
|
||||
border-color: #ddd;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-results__option[aria-selected=true] {
|
||||
color: rgba(0,0,0,0.4);
|
||||
}
|
||||
|
||||
#customize-control-font_heading_1_control,
|
||||
#customize-control-font_heading_2_control,
|
||||
#customize-control-font_heading_3_control {
|
||||
margin-top: 20px;
|
||||
}
|
||||
.generatepress-font-family {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.generatepress-weight-transform-wrapper {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-pack: justify;
|
||||
-ms-flex-pack: justify;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.generatepress-font-weight,
|
||||
.generatepress-font-transform {
|
||||
width: calc(50% - 5px);
|
||||
}
|
||||
|
||||
span.select2-container.select2-container--default.select2-container--open li.select2-results__option {
|
||||
margin:0;
|
||||
}
|
||||
|
||||
span.select2-container.select2-container--default.select2-container--open{
|
||||
z-index:999999;
|
||||
}
|
||||
|
||||
.select2-selection__rendered li {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single,
|
||||
.select2-container--default.select2-container .select2-selection--multiple,
|
||||
.select2-dropdown,
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__choice {
|
||||
border-color: #ddd;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-results__option[aria-selected=true] {
|
||||
color: rgba(0,0,0,0.4);
|
||||
}
|
||||
|
||||
#customize-control-font_heading_1_control,
|
||||
#customize-control-font_heading_2_control,
|
||||
#customize-control-font_heading_3_control {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
@ -499,4 +499,24 @@ function generatepress_typography_live_update( id, selector, property, unit, med
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
wp.customize( 'generate_settings[global_colors]', function( value ) {
|
||||
value.bind( function( newval ) {
|
||||
var globalColors = '';
|
||||
|
||||
newval.forEach( function( item ) {
|
||||
globalColors += '--' + item.slug + ':' + item.color + ';';
|
||||
} );
|
||||
|
||||
if ( $( 'style#global_colors' ).length ) {
|
||||
$( 'style#global_colors' ).html( ':root{' + globalColors + '}' );
|
||||
} else {
|
||||
$( 'head' ).append( '<style id="global_colors">:root{' + globalColors + '}</style>' );
|
||||
|
||||
setTimeout( function() {
|
||||
$( 'style#global_colors' ).not( ':last' ).remove();
|
||||
}, 100 );
|
||||
}
|
||||
} );
|
||||
} );
|
||||
}( jQuery ) );
|
||||
|
@ -1,154 +1,154 @@
|
||||
( function( api ) {
|
||||
|
||||
api.controlConstructor['gp-customizer-typography'] = api.Control.extend( {
|
||||
ready: function() {
|
||||
var control = this;
|
||||
|
||||
control.container.on( 'change', '.generatepress-font-family select',
|
||||
function() {
|
||||
var _this = jQuery( this ),
|
||||
_value = _this.val(),
|
||||
_categoryID = _this.attr( 'data-category' ),
|
||||
_variantsID = _this.attr( 'data-variants' );
|
||||
|
||||
// Set our font family
|
||||
control.settings['family'].set( _this.val() );
|
||||
|
||||
// Bail if our controls don't exist
|
||||
if ( 'undefined' == typeof control.settings['category'] || 'undefined' == typeof control.settings['variant'] ) {
|
||||
return;
|
||||
}
|
||||
|
||||
setTimeout( function() {
|
||||
// Send our request to the generate_get_all_google_fonts_ajax function
|
||||
var response = jQuery.getJSON({
|
||||
type: 'POST',
|
||||
url: ajaxurl,
|
||||
data: {
|
||||
action: 'generate_get_all_google_fonts_ajax',
|
||||
gp_customize_nonce: gp_customize.nonce
|
||||
},
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
});
|
||||
|
||||
// Get our response
|
||||
var fonts = response.responseJSON;
|
||||
|
||||
// Create an ID from our selected font
|
||||
var id = _value.split(' ').join('_').toLowerCase();
|
||||
|
||||
// Set our values if we have them
|
||||
if ( id in fonts ) {
|
||||
|
||||
// Get existing variants if this font is already selected
|
||||
var got_variants = false;
|
||||
jQuery( '.generatepress-font-family select' ).not( _this ).each( function( key, select ) {
|
||||
var parent = jQuery( this ).closest( '.generatepress-font-family' );
|
||||
|
||||
if ( _value == jQuery( select ).val() && _this.data( 'category' ) !== jQuery( select ).data( 'category' ) ) {
|
||||
if ( ! got_variants ) {
|
||||
updated_variants = jQuery( parent.next( '.generatepress-font-variant' ).find( 'select' ) ).val();
|
||||
got_variants = true;
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
// We're using a Google font, so show the variants field
|
||||
_this.closest( '.generatepress-font-family' ).next( 'div' ).show();
|
||||
|
||||
// Remove existing variants
|
||||
jQuery( 'select[name="' + _variantsID + '"]' ).find( 'option' ).remove();
|
||||
|
||||
// Populate our select input with available variants
|
||||
jQuery.each( fonts[ id ].variants, function( key, value ) {
|
||||
jQuery( 'select[name="' + _variantsID + '"]' ).append( jQuery( '<option></option>' ).attr( 'value', value ).text( value ) );
|
||||
} );
|
||||
|
||||
// Set our variants
|
||||
if ( ! got_variants ) {
|
||||
control.settings[ 'variant' ].set( fonts[ id ].variants );
|
||||
} else {
|
||||
control.settings[ 'variant' ].set( updated_variants );
|
||||
}
|
||||
|
||||
// Set our font category
|
||||
control.settings[ 'category' ].set( fonts[ id ].category );
|
||||
jQuery( 'input[name="' + _categoryID + '"' ).val( fonts[ id ].category );
|
||||
} else {
|
||||
_this.closest( '.generatepress-font-family' ).next( 'div' ).hide();
|
||||
control.settings[ 'category' ].set( '' )
|
||||
control.settings[ 'variant' ].set( '' )
|
||||
jQuery( 'input[name="' + _categoryID + '"' ).val( '' );
|
||||
jQuery( 'select[name="' + _variantsID + '"]' ).find( 'option' ).remove();
|
||||
}
|
||||
}, 25 );
|
||||
}
|
||||
);
|
||||
|
||||
control.container.on( 'change', '.generatepress-font-variant select',
|
||||
function() {
|
||||
var _this = jQuery( this );
|
||||
var variants = _this.val();
|
||||
|
||||
control.settings['variant'].set( variants );
|
||||
|
||||
jQuery( '.generatepress-font-variant select' ).each( function( key, value ) {
|
||||
var this_control = jQuery( this ).closest( 'li' ).attr( 'id' ).replace( 'customize-control-', '' );
|
||||
var parent = jQuery( this ).closest( '.generatepress-font-variant' );
|
||||
var font_val = api.control( this_control ).settings['family'].get();
|
||||
|
||||
if ( font_val == control.settings['family'].get() && _this.attr( 'name' ) !== jQuery( value ).attr( 'name' ) ) {
|
||||
jQuery( parent.find( 'select' ) ).not( _this ).val( variants ).triggerHandler( 'change' );
|
||||
api.control( this_control ).settings['variant'].set( variants );
|
||||
}
|
||||
} );
|
||||
}
|
||||
);
|
||||
|
||||
control.container.on( 'change', '.generatepress-font-category input',
|
||||
function() {
|
||||
control.settings['category'].set( jQuery( this ).val() );
|
||||
}
|
||||
);
|
||||
|
||||
control.container.on( 'change', '.generatepress-font-weight select',
|
||||
function() {
|
||||
control.settings['weight'].set( jQuery( this ).val() );
|
||||
}
|
||||
);
|
||||
|
||||
control.container.on( 'change', '.generatepress-font-transform select',
|
||||
function() {
|
||||
control.settings['transform'].set( jQuery( this ).val() );
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
} );
|
||||
|
||||
} )( wp.customize );
|
||||
|
||||
jQuery( document ).ready( function( $ ) {
|
||||
|
||||
$( '.generatepress-font-family select' ).select2();
|
||||
|
||||
$( '.generatepress-font-variant' ).each( function( key, value ) {
|
||||
var _this = $( this );
|
||||
var value = _this.data( 'saved-value' );
|
||||
|
||||
if ( value ) {
|
||||
value = value.toString().split( ',' );
|
||||
}
|
||||
|
||||
_this.find( 'select' ).select2().val( value ).trigger( 'change.select2' );
|
||||
} );
|
||||
|
||||
$( ".generatepress-font-family" ).each( function( key, value ) {
|
||||
var _this = $( this );
|
||||
if ( $.inArray( _this.find( 'select' ).val(), typography_defaults ) !== -1 ) {
|
||||
_this.next( '.generatepress-font-variant' ).hide();
|
||||
}
|
||||
} );
|
||||
|
||||
} );
|
||||
( function( api ) {
|
||||
|
||||
api.controlConstructor['gp-customizer-typography'] = api.Control.extend( {
|
||||
ready: function() {
|
||||
var control = this;
|
||||
|
||||
control.container.on( 'change', '.generatepress-font-family select',
|
||||
function() {
|
||||
var _this = jQuery( this ),
|
||||
_value = _this.val(),
|
||||
_categoryID = _this.attr( 'data-category' ),
|
||||
_variantsID = _this.attr( 'data-variants' );
|
||||
|
||||
// Set our font family
|
||||
control.settings['family'].set( _this.val() );
|
||||
|
||||
// Bail if our controls don't exist
|
||||
if ( 'undefined' == typeof control.settings['category'] || 'undefined' == typeof control.settings['variant'] ) {
|
||||
return;
|
||||
}
|
||||
|
||||
setTimeout( function() {
|
||||
// Send our request to the generate_get_all_google_fonts_ajax function
|
||||
var response = jQuery.getJSON({
|
||||
type: 'POST',
|
||||
url: ajaxurl,
|
||||
data: {
|
||||
action: 'generate_get_all_google_fonts_ajax',
|
||||
gp_customize_nonce: gp_customize.nonce
|
||||
},
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
});
|
||||
|
||||
// Get our response
|
||||
var fonts = response.responseJSON;
|
||||
|
||||
// Create an ID from our selected font
|
||||
var id = _value.split(' ').join('_').toLowerCase();
|
||||
|
||||
// Set our values if we have them
|
||||
if ( id in fonts ) {
|
||||
|
||||
// Get existing variants if this font is already selected
|
||||
var got_variants = false;
|
||||
jQuery( '.generatepress-font-family select' ).not( _this ).each( function( key, select ) {
|
||||
var parent = jQuery( this ).closest( '.generatepress-font-family' );
|
||||
|
||||
if ( _value == jQuery( select ).val() && _this.data( 'category' ) !== jQuery( select ).data( 'category' ) ) {
|
||||
if ( ! got_variants ) {
|
||||
updated_variants = jQuery( parent.next( '.generatepress-font-variant' ).find( 'select' ) ).val();
|
||||
got_variants = true;
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
// We're using a Google font, so show the variants field
|
||||
_this.closest( '.generatepress-font-family' ).next( 'div' ).show();
|
||||
|
||||
// Remove existing variants
|
||||
jQuery( 'select[name="' + _variantsID + '"]' ).find( 'option' ).remove();
|
||||
|
||||
// Populate our select input with available variants
|
||||
jQuery.each( fonts[ id ].variants, function( key, value ) {
|
||||
jQuery( 'select[name="' + _variantsID + '"]' ).append( jQuery( '<option></option>' ).attr( 'value', value ).text( value ) );
|
||||
} );
|
||||
|
||||
// Set our variants
|
||||
if ( ! got_variants ) {
|
||||
control.settings[ 'variant' ].set( fonts[ id ].variants );
|
||||
} else {
|
||||
control.settings[ 'variant' ].set( updated_variants );
|
||||
}
|
||||
|
||||
// Set our font category
|
||||
control.settings[ 'category' ].set( fonts[ id ].category );
|
||||
jQuery( 'input[name="' + _categoryID + '"' ).val( fonts[ id ].category );
|
||||
} else {
|
||||
_this.closest( '.generatepress-font-family' ).next( 'div' ).hide();
|
||||
control.settings[ 'category' ].set( '' )
|
||||
control.settings[ 'variant' ].set( '' )
|
||||
jQuery( 'input[name="' + _categoryID + '"' ).val( '' );
|
||||
jQuery( 'select[name="' + _variantsID + '"]' ).find( 'option' ).remove();
|
||||
}
|
||||
}, 25 );
|
||||
}
|
||||
);
|
||||
|
||||
control.container.on( 'change', '.generatepress-font-variant select',
|
||||
function() {
|
||||
var _this = jQuery( this );
|
||||
var variants = _this.val();
|
||||
|
||||
control.settings['variant'].set( variants );
|
||||
|
||||
jQuery( '.generatepress-font-variant select' ).each( function( key, value ) {
|
||||
var this_control = jQuery( this ).closest( 'li' ).attr( 'id' ).replace( 'customize-control-', '' );
|
||||
var parent = jQuery( this ).closest( '.generatepress-font-variant' );
|
||||
var font_val = api.control( this_control ).settings['family'].get();
|
||||
|
||||
if ( font_val == control.settings['family'].get() && _this.attr( 'name' ) !== jQuery( value ).attr( 'name' ) ) {
|
||||
jQuery( parent.find( 'select' ) ).not( _this ).val( variants ).triggerHandler( 'change' );
|
||||
api.control( this_control ).settings['variant'].set( variants );
|
||||
}
|
||||
} );
|
||||
}
|
||||
);
|
||||
|
||||
control.container.on( 'change', '.generatepress-font-category input',
|
||||
function() {
|
||||
control.settings['category'].set( jQuery( this ).val() );
|
||||
}
|
||||
);
|
||||
|
||||
control.container.on( 'change', '.generatepress-font-weight select',
|
||||
function() {
|
||||
control.settings['weight'].set( jQuery( this ).val() );
|
||||
}
|
||||
);
|
||||
|
||||
control.container.on( 'change', '.generatepress-font-transform select',
|
||||
function() {
|
||||
control.settings['transform'].set( jQuery( this ).val() );
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
} );
|
||||
|
||||
} )( wp.customize );
|
||||
|
||||
jQuery( document ).ready( function( $ ) {
|
||||
|
||||
$( '.generatepress-font-family select' ).select2();
|
||||
|
||||
$( '.generatepress-font-variant' ).each( function( key, value ) {
|
||||
var _this = $( this );
|
||||
var value = _this.data( 'saved-value' );
|
||||
|
||||
if ( value ) {
|
||||
value = value.toString().split( ',' );
|
||||
}
|
||||
|
||||
_this.find( 'select' ).select2().val( value ).trigger( 'change.select2' );
|
||||
} );
|
||||
|
||||
$( ".generatepress-font-family" ).each( function( key, value ) {
|
||||
var _this = $( this );
|
||||
if ( $.inArray( _this.find( 'select' ).val(), typography_defaults ) !== -1 ) {
|
||||
_this.next( '.generatepress-font-variant' ).hide();
|
||||
}
|
||||
} );
|
||||
|
||||
} );
|
||||
|
@ -17,7 +17,6 @@ GeneratePress_Customize_Field::add_title(
|
||||
'choices' => array(
|
||||
'toggleId' => 'top-bar-colors',
|
||||
),
|
||||
'active_callback' => 'generate_is_top_bar_active',
|
||||
)
|
||||
);
|
||||
|
||||
|
@ -351,6 +351,7 @@ function generate_do_control_inline_scripts() {
|
||||
'generateCustomizerControls',
|
||||
array(
|
||||
'palette' => $colors,
|
||||
'showGoogleFonts' => apply_filters( 'generate_font_manager_show_google_fonts', true ),
|
||||
)
|
||||
);
|
||||
|
||||
|
@ -241,15 +241,33 @@ if ( ! function_exists( 'generate_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' ) && 'preconnect' === $relation_type ) {
|
||||
if ( version_compare( $GLOBALS['wp_version'], '4.7-alpha', '>=' ) ) {
|
||||
$urls[] = array(
|
||||
'href' => 'https://fonts.gstatic.com',
|
||||
'crossorigin',
|
||||
);
|
||||
} else {
|
||||
$urls[] = 'https://fonts.gstatic.com';
|
||||
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 ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,17 @@ function generate_setup_woocommerce() {
|
||||
add_action( 'woocommerce_sidebar', 'generate_construct_sidebars' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the tag name for our WooCommerce wrappers.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
function generate_get_woocommerce_wrapper_tagname() {
|
||||
echo is_singular()
|
||||
? 'article'
|
||||
: 'div';
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_woocommerce_start' ) ) {
|
||||
add_action( 'woocommerce_before_main_content', 'generate_woocommerce_start', 10 );
|
||||
/**
|
||||
@ -51,7 +62,7 @@ if ( ! function_exists( 'generate_woocommerce_start' ) ) {
|
||||
*/
|
||||
do_action( 'generate_before_main_content' );
|
||||
?>
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_do_microdata( 'article' ); ?>>
|
||||
<<?php generate_get_woocommerce_wrapper_tagname(); ?> <?php generate_do_attr( 'woocommerce-content' ); ?>>
|
||||
<div class="inside-article">
|
||||
<?php
|
||||
/**
|
||||
@ -93,7 +104,7 @@ if ( ! function_exists( 'generate_woocommerce_end' ) ) {
|
||||
do_action( 'generate_after_content' );
|
||||
?>
|
||||
</div>
|
||||
</article>
|
||||
</<?php generate_get_woocommerce_wrapper_tagname(); ?>>
|
||||
<?php
|
||||
/**
|
||||
* generate_after_main_content hook.
|
||||
|
@ -52,9 +52,18 @@ if ( ! function_exists( 'generate_comment' ) ) {
|
||||
do_action( 'generate_after_comment_author_name' );
|
||||
|
||||
if ( apply_filters( 'generate_show_comment_entry_meta', true ) ) :
|
||||
$has_comment_date_link = apply_filters( 'generate_add_comment_date_link', true );
|
||||
|
||||
?>
|
||||
<div class="entry-meta comment-metadata">
|
||||
<a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
|
||||
<?php
|
||||
if ( $has_comment_date_link ) {
|
||||
printf(
|
||||
'<a href="%s">',
|
||||
esc_url( get_comment_link( $comment->comment_ID ) )
|
||||
);
|
||||
}
|
||||
?>
|
||||
<time datetime="<?php comment_time( 'c' ); ?>" itemprop="datePublished">
|
||||
<?php
|
||||
printf(
|
||||
@ -65,8 +74,13 @@ if ( ! function_exists( 'generate_comment' ) ) {
|
||||
);
|
||||
?>
|
||||
</time>
|
||||
</a>
|
||||
<?php edit_comment_link( __( 'Edit', 'generatepress' ), '<span class="edit-link">| ', '</span>' ); ?>
|
||||
<?php
|
||||
if ( $has_comment_date_link ) {
|
||||
echo '</a>';
|
||||
}
|
||||
|
||||
edit_comment_link( __( 'Edit', 'generatepress' ), '<span class="edit-link">| ', '</span>' );
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
|
@ -222,7 +222,7 @@ if ( ! function_exists( 'generate_back_to_top' ) ) {
|
||||
echo apply_filters( // phpcs:ignore
|
||||
'generate_back_to_top_output',
|
||||
sprintf(
|
||||
'<a title="%1$s" aria-label="%1$s" rel="nofollow" href="#" class="generate-back-to-top" style="opacity:0;visibility:hidden;" data-scroll-speed="%2$s" data-start-scroll="%3$s">
|
||||
'<a title="%1$s" aria-label="%1$s" rel="nofollow" href="#" class="generate-back-to-top" data-scroll-speed="%2$s" data-start-scroll="%3$s">
|
||||
%5$s
|
||||
</a>',
|
||||
esc_attr__( 'Scroll back to top', 'generatepress' ),
|
||||
|
@ -112,7 +112,6 @@ if ( ! function_exists( 'generate_construct_logo' ) ) {
|
||||
'class' => 'header-image is-logo-image',
|
||||
'alt' => esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ),
|
||||
'src' => $logo_url,
|
||||
'title' => esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ),
|
||||
)
|
||||
);
|
||||
|
||||
@ -134,8 +133,13 @@ if ( ! function_exists( 'generate_construct_logo' ) ) {
|
||||
$data = wp_get_attachment_metadata( get_theme_mod( 'custom_logo' ) );
|
||||
|
||||
if ( ! empty( $data ) ) {
|
||||
$attr['width'] = $data['width'];
|
||||
$attr['height'] = $data['height'];
|
||||
if ( isset( $data['width'] ) ) {
|
||||
$attr['width'] = $data['width'];
|
||||
}
|
||||
|
||||
if ( isset( $data['height'] ) ) {
|
||||
$attr['height'] = $data['height'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -152,12 +156,11 @@ if ( ! function_exists( 'generate_construct_logo' ) ) {
|
||||
'generate_logo_output',
|
||||
sprintf(
|
||||
'<div class="site-logo">
|
||||
<a href="%1$s" title="%2$s" rel="home">
|
||||
<img %3$s />
|
||||
<a href="%1$s" rel="home">
|
||||
<img %2$s />
|
||||
</a>
|
||||
</div>',
|
||||
esc_url( apply_filters( 'generate_logo_href', home_url( '/' ) ) ),
|
||||
esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ),
|
||||
$html_attr
|
||||
),
|
||||
$logo_url,
|
||||
|
@ -36,16 +36,14 @@ if ( ! function_exists( 'generate_content_nav' ) ) {
|
||||
}
|
||||
?>
|
||||
<nav <?php generate_do_attr( 'post-navigation', array( 'id' => esc_attr( $nav_id ) ) ); ?>>
|
||||
<span class="screen-reader-text"><?php esc_html_e( 'Post navigation', 'generatepress' ); ?></span>
|
||||
|
||||
<?php
|
||||
if ( is_single() ) : // navigation links for single posts.
|
||||
|
||||
$post_navigation_args = apply_filters(
|
||||
'generate_post_navigation_args',
|
||||
array(
|
||||
'previous_format' => '<div class="nav-previous">' . generate_get_svg_icon( 'arrow-left' ) . '<span class="prev" title="' . esc_attr__( 'Previous', 'generatepress' ) . '">%link</span></div>',
|
||||
'next_format' => '<div class="nav-next">' . generate_get_svg_icon( 'arrow-right' ) . '<span class="next" title="' . esc_attr__( 'Next', 'generatepress' ) . '">%link</span></div>',
|
||||
'previous_format' => '<div class="nav-previous">' . generate_get_svg_icon( 'arrow-left' ) . '<span class="prev">%link</span></div>',
|
||||
'next_format' => '<div class="nav-next">' . generate_get_svg_icon( 'arrow-right' ) . '<span class="next">%link</span></div>',
|
||||
'link' => '%title',
|
||||
'in_same_term' => apply_filters( 'generate_category_post_navigation', false ),
|
||||
'excluded_terms' => '',
|
||||
|
@ -562,26 +562,10 @@ function generate_do_template_part( $template ) {
|
||||
if ( apply_filters( 'generate_do_template_part', true, $template ) ) {
|
||||
if ( 'archive' === $template || 'index' === $template ) {
|
||||
get_template_part( 'content', get_post_format() );
|
||||
}
|
||||
|
||||
if ( 'page' === $template ) {
|
||||
get_template_part( 'content', 'page' );
|
||||
}
|
||||
|
||||
if ( 'single' === $template ) {
|
||||
get_template_part( 'content', 'single' );
|
||||
}
|
||||
|
||||
if ( 'search' === $template ) {
|
||||
get_template_part( 'content', 'search' );
|
||||
}
|
||||
|
||||
if ( '404' === $template ) {
|
||||
get_template_part( 'content', '404' );
|
||||
}
|
||||
|
||||
if ( 'none' === $template ) {
|
||||
} elseif ( 'none' === $template ) {
|
||||
get_template_part( 'no-results' );
|
||||
} else {
|
||||
get_template_part( 'content', $template );
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user