diff --git a/admin/images/edit.svg b/admin/images/edit.svg new file mode 100644 index 000000000..f7151a17b --- /dev/null +++ b/admin/images/edit.svg @@ -0,0 +1,4 @@ + + + + diff --git a/admin/images/reply.svg b/admin/images/reply.svg new file mode 100644 index 000000000..154c4a0f6 --- /dev/null +++ b/admin/images/reply.svg @@ -0,0 +1,3 @@ + + + diff --git a/admin/starter-custom-page/responsive-home-starter-content.php b/admin/starter-custom-page/responsive-home-starter-content.php index 95b89a30a..36c69b029 100644 --- a/admin/starter-custom-page/responsive-home-starter-content.php +++ b/admin/starter-custom-page/responsive-home-starter-content.php @@ -220,8 +220,8 @@ public function get() { 'responsive_footer_bar_mobile_right_padding' => 0, // Typography - 'body_typography[font-family]' => "'Libre Franklin', sans-serif", - 'button_typography[font-family]' => "'Libre Franklin', sans-serif", + 'body_typography[font-family]' => '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif', + 'button_typography[font-family]' => '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif', 'button_typography[font-size]' => '22px', 'button_typography_font_size_value' => 22, 'button_tablet_typography[font-size]' => '20px', @@ -282,6 +282,7 @@ public function get() { 'responsive_button_text_color' => '#1c1c1c', 'responsive_button_hover_text_color' => '#1c1c1c', 'responsive_content_header_heading_color' => '#ffffff', + 'responsive_all_heading_text_color' => '#404040', // Buttons Radius 'responsive_buttons_radius_bottom_left_radius' => 13, diff --git a/changelog.txt b/changelog.txt index 8f43d98ff..884717833 100644 --- a/changelog.txt +++ b/changelog.txt @@ -8,6 +8,16 @@ Changelog Legend: [x] = Deleted [!] = Bugs +(10/08/2026) Version 6.4.2 +[+] = New = Introducing the Post Title Area, Blog Title Area, and Page Title Area features for customizing the title areas of posts, blog/archives , and page layouts. +[*] = Improvement = Improved mobile page performance and streamlined WooCommerce asset loading to reduce unnecessary resource usage. + +(03/08/2026) Version 6.4.1 +[+] = New = Introduced Narrow Container layout option in the Theme Customizer. +[+] = New = Introduced native System Fonts in typography settings. +[*] = Improvement = Optimized speed and overall theme performance. +[*] = Improvement = Enhanced frontend UI elements across the theme. + (23/07/2026) Version 6.4.0 [+] = New = Introduced Sidebar Style settings in the Theme Customizer for enhanced sidebar customization. [+] = New = Introduced Container Layout and Container Style controls for Pages, Single Posts, Blog/Archive pages, WooCommerce Product Catalog, and Single Product pages to provide more flexible layout customization. diff --git a/comments.php b/comments.php index 97afc269b..9a6c34737 100644 --- a/comments.php +++ b/comments.php @@ -25,8 +25,8 @@ $is_comments_enabled = get_theme_mod( 'responsive_single_blog_comments', Responsive\Core\get_responsive_customizer_defaults( 'responsive_single_blog_comments' ) ); -// Exit early if password protected, comments disabled, or no comments and discussion is off. -if ( post_password_required() || ! $is_comments_enabled || ( ! have_comments() && ! comments_open() && ! pings_open() ) ) { +// Exit early if password protected, comments disabled, or no comments and comments are closed. +if ( post_password_required() || ! $is_comments_enabled || ( ! have_comments() && ! comments_open() ) ) { return; } ?> diff --git a/core/css/icomoon/style.css b/core/css/icomoon/style.css index 8c76c1288..9c5b8e57a 100755 --- a/core/css/icomoon/style.css +++ b/core/css/icomoon/style.css @@ -7,7 +7,7 @@ url('fonts/icomoon.svg?fcynq8#icomoon') format('svg'); font-weight: normal; font-style: normal; - font-display: block; + font-display: swap; } [class^="icon-"], [class*=" icon-"] { diff --git a/core/gutenberg/gutenberg-support.php b/core/gutenberg/gutenberg-support.php index ed4d45f94..fa058d26c 100644 --- a/core/gutenberg/gutenberg-support.php +++ b/core/gutenberg/gutenberg-support.php @@ -20,7 +20,7 @@ function responsive_gutenberg_color_palette() { $body_typography = get_theme_mod( 'body_typography' ); - $body_text_color = esc_html( responsive_prepare_css_value( 'responsive_body_text_color', '#333333' ) ); + $body_text_color = esc_html( responsive_prepare_css_value( 'responsive_body_text_color', '#404040' ) ); $box_background_color = esc_html( responsive_prepare_css_value( 'responsive_box_background_color', '#ffffff' ) ); $button_color = esc_html( responsive_prepare_css_value( 'responsive_button_color', '#0066CC' ) ); @@ -152,20 +152,20 @@ function responsive_gutenberg_customizer_css() { $box_background_color = esc_html( get_theme_mod( 'responsive_box_background_color', '#ffffff' ) ); // Buttons border width new control. - $buttons_border_width_top = esc_html( get_theme_mod( 'responsive_buttons_border_width_top_border', 1 ) ); - $buttons_border_width_right = esc_html( get_theme_mod( 'responsive_buttons_border_width_right_border', 1 ) ); - $buttons_border_width_bottom = esc_html( get_theme_mod( 'responsive_buttons_border_width_bottom_border', 1 ) ); - $buttons_border_width_left = esc_html( get_theme_mod( 'responsive_buttons_border_width_left_border', 1 ) ); + $buttons_border_width_top = esc_html( get_theme_mod( 'responsive_buttons_border_width_top_border', 0 ) ); + $buttons_border_width_right = esc_html( get_theme_mod( 'responsive_buttons_border_width_right_border', 0 ) ); + $buttons_border_width_bottom = esc_html( get_theme_mod( 'responsive_buttons_border_width_bottom_border', 0 ) ); + $buttons_border_width_left = esc_html( get_theme_mod( 'responsive_buttons_border_width_left_border', 0 ) ); - $buttons_border_tablet_width_top = esc_html( get_theme_mod( 'responsive_buttons_border_width_tablet_top_border', 1 ) ); - $buttons_border_tablet_width_right = esc_html( get_theme_mod( 'responsive_buttons_border_width_tablet_right_border', 1 ) ); - $buttons_border_tablet_width_bottom = esc_html( get_theme_mod( 'responsive_buttons_border_width_tablet_bottom_border', 1 ) ); - $buttons_border_tablet_width_left = esc_html( get_theme_mod( 'responsive_buttons_border_width_tablet_left_border', 1 ) ); + $buttons_border_tablet_width_top = esc_html( get_theme_mod( 'responsive_buttons_border_width_tablet_top_border', 0 ) ); + $buttons_border_tablet_width_right = esc_html( get_theme_mod( 'responsive_buttons_border_width_tablet_right_border', 0 ) ); + $buttons_border_tablet_width_bottom = esc_html( get_theme_mod( 'responsive_buttons_border_width_tablet_bottom_border', 0 ) ); + $buttons_border_tablet_width_left = esc_html( get_theme_mod( 'responsive_buttons_border_width_tablet_left_border', 0 ) ); - $buttons_border_mobile_width_top = esc_html( get_theme_mod( 'responsive_buttons_border_width_mobile_top_border', 1 ) ); - $buttons_border_mobile_width_right = esc_html( get_theme_mod( 'responsive_buttons_border_width_mobile_right_border', 1 ) ); - $buttons_border_mobile_width_bottom = esc_html( get_theme_mod( 'responsive_buttons_border_width_mobile_bottom_border', 1 ) ); - $buttons_border_mobile_width_left = esc_html( get_theme_mod( 'responsive_buttons_border_width_mobile_left_border', 1 ) ); + $buttons_border_mobile_width_top = esc_html( get_theme_mod( 'responsive_buttons_border_width_mobile_top_border', 0 ) ); + $buttons_border_mobile_width_right = esc_html( get_theme_mod( 'responsive_buttons_border_width_mobile_right_border', 0 ) ); + $buttons_border_mobile_width_bottom = esc_html( get_theme_mod( 'responsive_buttons_border_width_mobile_bottom_border', 0 ) ); + $buttons_border_mobile_width_left = esc_html( get_theme_mod( 'responsive_buttons_border_width_mobile_left_border', 0 ) ); // button desktop border radius $button_top_left_radius = esc_html( get_theme_mod( 'responsive_buttons_radius_top_left_radius', Responsive\Core\get_responsive_customizer_defaults( 'responsive_buttons_radius' ) ) ); @@ -263,7 +263,12 @@ function responsive_gutenberg_customizer_css() { $all_headings_typography = get_theme_mod( 'headings_typography' ); $box_background_image = get_theme_mod( 'responsive_box_background_image_toggle' ) ? esc_url( get_theme_mod( 'responsive_box_background_image' ) ) : null ; - $responsive_container_width = get_theme_mod( 'responsive_container_width', 1140 ); + $global_container_layout = get_theme_mod( 'responsive_width', 'contained' ); + if ( 'narrow' === $global_container_layout ) { + $responsive_container_width = get_theme_mod( 'responsive_narrow_container_width', Responsive\Core\get_responsive_customizer_defaults( 'responsive_narrow_container_width' ) ); + } else { + $responsive_container_width = get_theme_mod( 'responsive_container_width', Responsive\Core\get_responsive_customizer_defaults( 'responsive_container_width' ) ); + } $responsive_page_content_width = get_theme_mod( 'responsive_page_content_width', Responsive\Core\get_responsive_customizer_defaults( 'page_content_width' ) ); $global_sidebar_position = get_theme_mod( 'responsive_default_sidebar_position', 'no' ); $page_sidebar_setting = get_theme_mod( 'responsive_page_sidebar_position' ); diff --git a/core/includes/compatibility/woocommerce/customizer/settings/class-responsive-woocommerce-shop-layout-customizer.php b/core/includes/compatibility/woocommerce/customizer/settings/class-responsive-woocommerce-shop-layout-customizer.php index 97698d926..3bfff620a 100644 --- a/core/includes/compatibility/woocommerce/customizer/settings/class-responsive-woocommerce-shop-layout-customizer.php +++ b/core/includes/compatibility/woocommerce/customizer/settings/class-responsive-woocommerce-shop-layout-customizer.php @@ -181,7 +181,7 @@ public function customizer_options( $wp_customize ) { // Sidebar Layout heading. $shop_sidebar_heading = esc_html__( 'Sidebar Layout', 'responsive' ); - responsive_separator_control( $wp_customize, 'shop_sidebar_separator', $shop_sidebar_heading, 'responsive_woocommerce_shop', 37); + responsive_separator_control( $wp_customize, 'shop_sidebar_separator', $shop_sidebar_heading, 'responsive_woocommerce_shop', 37, 'responsive_active_shop_sidebar_section'); // Sidebar Position. $sidebar_label = esc_html__( 'WooCommerce Sidebar Position', 'responsive' ); @@ -201,7 +201,7 @@ public function customizer_options( $wp_customize ) { ); } - responsive_imageradio_button_control( $wp_customize, 'shop_sidebar_position', $sidebar_label, 'responsive_woocommerce_shop', 38, $sidebar_choices, 'global', null, 'svg'); + responsive_imageradio_button_control( $wp_customize, 'shop_sidebar_position', $sidebar_label, 'responsive_woocommerce_shop', 38, $sidebar_choices, 'global', 'responsive_active_shop_sidebar_section', 'svg'); $shop_sidebar_style_label = __( 'Sidebar Style', 'responsive' ); $shop_sidebar_style_choice = array( diff --git a/core/includes/compatibility/woocommerce/customizer/settings/class-responsive-woocommerce-single-product-layout-customizer.php b/core/includes/compatibility/woocommerce/customizer/settings/class-responsive-woocommerce-single-product-layout-customizer.php index e4934b427..4708d3a05 100644 --- a/core/includes/compatibility/woocommerce/customizer/settings/class-responsive-woocommerce-single-product-layout-customizer.php +++ b/core/includes/compatibility/woocommerce/customizer/settings/class-responsive-woocommerce-single-product-layout-customizer.php @@ -104,7 +104,7 @@ public function customizer_options( $wp_customize ) { // Sidebar Options Heading. $single_product_sidebar_heading = esc_html__( 'Sidebar Layout', 'responsive' ); - responsive_separator_control( $wp_customize, 'single_product_sidebar_separator', $single_product_sidebar_heading, 'responsive_woocommerce_single_product_layout', 65); + responsive_separator_control( $wp_customize, 'single_product_sidebar_separator', $single_product_sidebar_heading, 'responsive_woocommerce_single_product_layout', 65, 'responsive_active_single_product_sidebar_section'); // Sidebar Position. $sidebar_label = esc_html__( 'Sidebar Position', 'responsive' ); @@ -124,7 +124,7 @@ public function customizer_options( $wp_customize ) { ); } - responsive_imageradio_button_control( $wp_customize, 'single_product_sidebar_position', $sidebar_label, 'responsive_woocommerce_single_product_layout', 66, $sidebar_choices, 'global', null, 'svg' ); + responsive_imageradio_button_control( $wp_customize, 'single_product_sidebar_position', $sidebar_label, 'responsive_woocommerce_single_product_layout', 66, $sidebar_choices, 'global', 'responsive_active_single_product_sidebar_section', 'svg' ); $single_product_sidebar_style_label = __( 'Sidebar Style', 'responsive' ); $single_product_sidebar_style_choice = array( diff --git a/core/includes/customizer/assets/images/contained.svg b/core/includes/customizer/assets/images/contained.svg index 86dda7f27..b68b6c909 100644 --- a/core/includes/customizer/assets/images/contained.svg +++ b/core/includes/customizer/assets/images/contained.svg @@ -1,19 +1,9 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + diff --git a/core/includes/customizer/assets/images/default_container.svg b/core/includes/customizer/assets/images/default_container.svg index a9ae88b8d..a7884dbdd 100644 --- a/core/includes/customizer/assets/images/default_container.svg +++ b/core/includes/customizer/assets/images/default_container.svg @@ -1,23 +1,6 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + diff --git a/core/includes/customizer/assets/images/full-width.svg b/core/includes/customizer/assets/images/full-width.svg index e0e7a2f08..bf6aac4cf 100644 --- a/core/includes/customizer/assets/images/full-width.svg +++ b/core/includes/customizer/assets/images/full-width.svg @@ -1,19 +1,9 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + diff --git a/core/includes/customizer/assets/images/global.svg b/core/includes/customizer/assets/images/global.svg index 75a076d1b..a7884dbdd 100644 --- a/core/includes/customizer/assets/images/global.svg +++ b/core/includes/customizer/assets/images/global.svg @@ -1,20 +1,6 @@ - - - - - - - - - - - - - - - - - - - + + + + + diff --git a/core/includes/customizer/assets/images/left.svg b/core/includes/customizer/assets/images/left.svg index 262736d07..5d56d5d4a 100644 --- a/core/includes/customizer/assets/images/left.svg +++ b/core/includes/customizer/assets/images/left.svg @@ -1,18 +1,10 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + diff --git a/core/includes/customizer/assets/images/narrow.svg b/core/includes/customizer/assets/images/narrow.svg new file mode 100644 index 000000000..f678bcc7f --- /dev/null +++ b/core/includes/customizer/assets/images/narrow.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/core/includes/customizer/assets/images/no.svg b/core/includes/customizer/assets/images/no.svg index 049d3b4dd..bf6aac4cf 100644 --- a/core/includes/customizer/assets/images/no.svg +++ b/core/includes/customizer/assets/images/no.svg @@ -1,17 +1,9 @@ - - - - - - - - - - - - - - - - + + + + + + + + diff --git a/core/includes/customizer/assets/images/normal.svg b/core/includes/customizer/assets/images/normal.svg index 43d877606..b68b6c909 100644 --- a/core/includes/customizer/assets/images/normal.svg +++ b/core/includes/customizer/assets/images/normal.svg @@ -1,19 +1,9 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + diff --git a/core/includes/customizer/assets/images/post_title_layout1.svg b/core/includes/customizer/assets/images/post_title_layout1.svg new file mode 100644 index 000000000..2f2cfc39c --- /dev/null +++ b/core/includes/customizer/assets/images/post_title_layout1.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/core/includes/customizer/assets/images/post_title_layout2.svg b/core/includes/customizer/assets/images/post_title_layout2.svg new file mode 100644 index 000000000..6bcc4d289 --- /dev/null +++ b/core/includes/customizer/assets/images/post_title_layout2.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/core/includes/customizer/assets/images/right.svg b/core/includes/customizer/assets/images/right.svg index 753493675..aed17ae14 100644 --- a/core/includes/customizer/assets/images/right.svg +++ b/core/includes/customizer/assets/images/right.svg @@ -1,18 +1,10 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + diff --git a/core/includes/customizer/assets/js/conditional-display-controls.js b/core/includes/customizer/assets/js/conditional-display-controls.js index 084fd3a8f..49ef232dc 100644 --- a/core/includes/customizer/assets/js/conditional-display-controls.js +++ b/core/includes/customizer/assets/js/conditional-display-controls.js @@ -60,7 +60,6 @@ function( newval ) { switch (newval) { case 'full-width': - api.control( 'responsive_container_width' ).toggle( false ); // api.control( 'responsive_footer_full_width' ).toggle( false ); api.control( 'responsive_header_full_width' ).toggle( false ); api.control( 'responsive_inline_logo_site_title' ).toggle( false ); @@ -69,11 +68,14 @@ * The select was switched to »show«. */ case 'contained': - api.control( 'responsive_container_width' ).toggle( true ); // api.control( 'responsive_footer_full_width' ).toggle( true ); api.control( 'responsive_header_full_width' ).toggle( true ); api.control( 'responsive_inline_logo_site_title' ).toggle( true ); break; + case 'narrow': + api.control( 'responsive_header_full_width' ).toggle( true ); + api.control( 'responsive_inline_logo_site_title' ).toggle( true ); + break; } } ); diff --git a/core/includes/customizer/assets/js/customize-preview-color-control.js b/core/includes/customizer/assets/js/customize-preview-color-control.js index bef5e3856..b9ca81213 100644 --- a/core/includes/customizer/assets/js/customize-preview-color-control.js +++ b/core/includes/customizer/assets/js/customize-preview-color-control.js @@ -110,7 +110,7 @@ '.responsive-site-style-boxed .custom-home-team-section,' + '.responsive-site-style-boxed .custom-home-testimonial-section,' + '.responsive-site-style-boxed .custom-home-contact-section,' + - '.responsive-site-style-boxed .custom-home-widget-section,' + + '.responsive-site-style-boxed .custom-home-widget-section .widget-wrapper,' + '.responsive-site-style-boxed .custom-home-featured-area,' + '.responsive-site-style-boxed .site-content-header,' + '.responsive-site-style-boxed .site-content .hentry:not(.bbp-forum-status-open),' + @@ -125,7 +125,7 @@ '.woocommerce.responsive-site-style-content-boxed .products-wrapper,' + '.woocommerce-page:not(.responsive-site-style-flat) .woocommerce-pagination,' + '.woocommerce-page.single-product:not(.responsive-site-style-flat) div.product,' + - '.woocommerce.single-product:not(.responsive-site-style-flat) div.product' + + '.woocommerce.single-product:not(.responsive-site-style-flat) div.product,' + '.elementor-element.elementor-products-grid ul.products li.product .responsive-shop-summary-wrap' ).css({ 'background': gradient, @@ -171,7 +171,7 @@ '.responsive-site-style-boxed .custom-home-team-section,' + '.responsive-site-style-boxed .custom-home-testimonial-section,' + '.responsive-site-style-boxed .custom-home-contact-section,' + - '.responsive-site-style-boxed .custom-home-widget-section,' + + '.responsive-site-style-boxed .custom-home-widget-section .widget-wrapper,' + '.responsive-site-style-boxed .custom-home-featured-area,' + '.responsive-site-style-boxed .site-content-header,' + '.responsive-site-style-boxed .site-content .hentry:not(.bbp-forum-status-open),' + @@ -186,7 +186,7 @@ '.woocommerce.responsive-site-style-content-boxed .products-wrapper,' + '.woocommerce-page:not(.responsive-site-style-flat) .woocommerce-pagination,' + '.woocommerce-page.single-product:not(.responsive-site-style-flat) div.product,' + - '.woocommerce.single-product:not(.responsive-site-style-flat) div.product' + + '.woocommerce.single-product:not(.responsive-site-style-flat) div.product,' + '.elementor-element.elementor-products-grid ul.products li.product .responsive-shop-summary-wrap' ).css({ 'background': 'none', @@ -603,7 +603,7 @@ if( newval && newval.startsWith('palette') ) { newval = `var(--responsive-global-${newval})`; } - $('a, .woocommerce a.remove:hover').not('nav a').not('a.add_to_cart_button').not('.site-title-tagline a').not('.widget-area .widget-wrapper a').not('a.product_type_grouped').not('.woocommerce-tabs .description_tab').not('.woocommerce-tabs .reviews_tab').not('.post-meta a').not('.post-meta a:hover').not('.responsive-single-related-posts-container a').not('.responsive-single-related-posts-container a:hover').css('color', newval ); + $('a, .woocommerce a.remove:hover').not('nav a').not('a.add_to_cart_button').not('.site-title-tagline a').not('.widget-area .widget-wrapper a').not('a.product_type_grouped').not('.woocommerce-tabs .description_tab').not('.woocommerce-tabs .reviews_tab').not('.post-meta a').not('.post-meta a:hover').not('.responsive-single-related-posts-container a').not('.responsive-single-related-posts-container a:hover').not('h1 a, h2 a, h3 a, h4 a, h5 a, h6 a').css('color', newval ); } ); } ); @@ -1818,7 +1818,7 @@ //Hover Colors //Links Hover Color - $("a").not('.responsive-single-related-posts-container a').not('.widget-area .widget-wrapper a').not('.footer-widget-area .footer-widget-wrapper a').not('.footer-navigation #footer-menu li a').not('.responsive-header-button').not('.post-meta a').hover( + $("a").not('.responsive-single-related-posts-container a').not('.widget-area .widget-wrapper a').not('.footer-widget-area .footer-widget-wrapper a').not('.footer-navigation #footer-menu li a').not('.responsive-header-button').not('.post-meta a').not('h1 a, h2 a,h3 a,h4 a,h5 a,h6 a').hover( function() { const linkHoverColor = processThemeSettingForCSS('responsive_link_hover_color'); $(this).css("color", linkHoverColor); @@ -4999,4 +4999,93 @@ }); }); + // Blog/Archive Site Background Color + api( 'responsive_blog_site_background_color', function( value ) { + value.bind( function( newval ) { + if ( newval && newval.includes( 'palette' ) ) { + newval = 'var(--responsive-global-' + newval + ')'; + } + $( 'body.blog, body.archive, body.search-results' ).css( 'background-color', newval ); + } ); + } ); + + // Blog/Archive Content Background Color + api( 'responsive_blog_content_background_color', function( value ) { + value.bind( function( newval ) { + if ( newval && newval.includes( 'palette' ) ) { + newval = 'var(--responsive-global-' + newval + ')'; + } + $( + '.blog:not(.custom-home-page-active) .site-content .hentry,' + + '.archive:not(.post-type-archive-product) .site-content .hentry,' + + '.search-results .site-content article.hentry' + ).css( 'background-color', newval ); + } ); + } ); + + // Blog/Archive Item Category Color + api( 'responsive_blog_category_color', function( value ) { + value.bind( function( newval ) { + if ( newval && newval.includes( 'palette' ) ) { + newval = 'var(--responsive-global-' + newval + ')'; + } + $( '.blog .hentry .post-meta .entry-category a, .archive .hentry .post-meta .entry-category a' ).css( 'color', newval ); + } ); + } ); + + // Blog/Archive Item Category Hover Color + api( 'responsive_blog_category_hover_color', function( value ) { + value.bind( function( newval ) { + jQuery( 'style#responsive-blog-category-hover-color' ).remove(); + jQuery( 'head' ).append( + '' + ); + } ); + } ); + + // Blog/Archive Item Meta Color + api( 'responsive_blog_item_meta_color', function( value ) { + value.bind( function( newval ) { + if ( newval && newval.includes( 'palette' ) ) { + newval = 'var(--responsive-global-' + newval + ')'; + } + $( '.blog .hentry .post-meta .entry-author a, .archive .hentry .post-meta .entry-author a, .blog .hentry .post-meta .entry-date a, .archive .hentry .post-meta .entry-date a' ).css( 'color', newval ); + } ); + } ); + + // Blog/Archive Item Meta Hover Color + api( 'responsive_blog_item_meta_hover_color', function( value ) { + value.bind( function( newval ) { + jQuery( 'style#responsive-blog-item-meta-hover-color' ).remove(); + jQuery( 'head' ).append( + '' + ); + } ); + } ); + // Single Page Site Background Color + api( 'responsive_page_site_background_color', function( value ) { + value.bind( function( newval ) { + if ( newval && newval.includes( 'palette' ) ) { + newval = 'var(--responsive-global-' + newval + ')'; + } + $( 'body.page' ).css( 'background-color', newval ); + } ); + } ); + + // Single Page Content Background Color + api( 'responsive_page_content_background_color', function( value ) { + value.bind( function( newval ) { + if ( newval && newval.includes( 'palette' ) ) { + newval = 'var(--responsive-global-' + newval + ')'; + } + $( + '.page:not(.front-page):not(.woocommerce-cart):not(.woocommerce-checkout):not(.page-template-gutenberg-fullwidth) .site-content .hentry' + ).css( 'background-color', newval ); + } ); + } ); + } )( jQuery ); diff --git a/core/includes/customizer/assets/js/customize-preview-drag-number-control.js b/core/includes/customizer/assets/js/customize-preview-drag-number-control.js index e96a60f67..a3bd8fddd 100644 --- a/core/includes/customizer/assets/js/customize-preview-drag-number-control.js +++ b/core/includes/customizer/assets/js/customize-preview-drag-number-control.js @@ -26,6 +26,24 @@ } ); } ); + api( 'responsive_narrow_container_width', function( value ) { + value.bind( function( newval ) { + if ( api( 'responsive_width' ).get() === 'narrow' ) { + $('.container,[class*=\'__inner-container\'],.site-header-full-width-main-navigation:not(.responsive-site-full-width) .main-navigation-wrapper').css('max-width', newval+'px' ); + jQuery('style#responsive-gutenberg-wide-size').remove(); + jQuery('head').append( + '' + ); + if ( $(window).width() > 769 ) { + $( '.floatingb-container' ).css( 'width', newval+'px' ); + } else { + $( '.floatingb-container' ).css( 'width', '100%' ); + } + } + } ); + } ); //Logo Width api( 'responsive_logo_width', function( value ) { value.bind( function( newval ) { @@ -299,13 +317,189 @@ api( 'responsive_width', function( value ) { value.bind( function( newval ) { - if(newval !== "contained") - $('.container,[class*=\'__inner-container\'],.site-header-full-width-main-navigation:not(.responsive-site-full-width) .main-navigation-wrapper').css('max-width', 'none' ); - else + if ( newval === 'contained' ) { $('.container,[class*=\'__inner-container\'],.site-header-full-width-main-navigation:not(.responsive-site-full-width) .main-navigation-wrapper').css('max-width', api( 'responsive_container_width' ).get()+'px' ); + } else if ( newval === 'narrow' ) { + $('.container,[class*=\'__inner-container\'],.site-header-full-width-main-navigation:not(.responsive-site-full-width) .main-navigation-wrapper').css('max-width', api( 'responsive_narrow_container_width' ).get()+'px' ); + } else { + $('.container,[class*=\'__inner-container\'],.site-header-full-width-main-navigation:not(.responsive-site-full-width) .main-navigation-wrapper').css('max-width', 'none' ); + } } ); } ); + api( 'responsive_single_blog_banner_custom_width', function( value ) { + value.bind( function( newval ) { + $('body .responsive-blog-single-banner2').css('max-width', newval+'px'); + } ); + }); + + api( 'responsive_single_blog_banner_min_height', function( value ) { + value.bind( function( newval ) { + const styleId = 'responsive-single-blog-banner-min-height-desktop'; + jQuery(`style#${styleId}`).remove(); + + jQuery('head').append( + `` + ); + }); + }); + + api( 'responsive_single_blog_banner_min_height_tablet', function( value ) { + value.bind( function( newval ) { + const styleId = 'responsive-single-blog-banner-min-height-tablet'; + jQuery(`style#${styleId}`).remove(); + + jQuery('head').append( + `` + ); + }); + }); + + api( 'responsive_single_blog_banner_min_height_mobile', function( value ) { + value.bind( function( newval ) { + const styleId = 'responsive-single-blog-banner-min-height-mobile'; + jQuery(`style#${styleId}`).remove(); + + jQuery('head').append( + `` + ); + }); + }); + + api( 'responsive_single_blog_post_title_inner_elements_spacing', function( value ) { + value.bind( function( newval ) { + $('body .responsive-blog-single-banner2 .container > *:not(:last-child), .single .entry-header > *:not(:last-child)').css('margin-bottom', newval+'px'); + }) + }); + + // Blog/Archive Title + api( 'responsive_blog_banner_custom_width', function( value ) { + value.bind( function( newval ) { + $('body .responsive-archive-entry-banner').css('max-width', newval+'px'); + } ); + }); + + api( 'responsive_blog_banner_min_height', function( value ) { + value.bind( function( newval ) { + const styleId = 'responsive-blog-banner-min-height-desktop'; + jQuery(`style#${styleId}`).remove(); + + jQuery('head').append( + `` + ); + }); + }); + + api( 'responsive_blog_banner_min_height_tablet', function( value ) { + value.bind( function( newval ) { + const styleId = 'responsive-blog-banner-min-height-tablet'; + jQuery(`style#${styleId}`).remove(); + + jQuery('head').append( + `` + ); + }); + }); + + api( 'responsive_blog_banner_min_height_mobile', function( value ) { + value.bind( function( newval ) { + const styleId = 'responsive-blog-banner-min-height-mobile'; + jQuery(`style#${styleId}`).remove(); + + jQuery('head').append( + `` + ); + }); + }); + + api( 'responsive_blog_post_title_inner_elements_spacing', function( value ) { + value.bind( function( newval ) { + $('body .responsive-archive-entry-banner .container > *:not(:last-child), .archive:not(.woocommerce) .site-content-header > *:not(:last-child)').css('margin-bottom', newval+'px'); + }) + }); + + // Page Title Area + api( 'responsive_page_title_custom_width', function( value ) { + value.bind( function( newval ) { + $('body .responsive-single-entry-banner').css('max-width', newval+'px'); + } ); + }); + + api( 'responsive_page_title_banner_min_height', function( value ) { + value.bind( function( newval ) { + const styleId = 'responsive-page-banner-min-height-desktop'; + jQuery(`style#${styleId}`).remove(); + + jQuery('head').append( + `` + ); + }); + }); + + api( 'responsive_page_title_banner_min_height_tablet', function( value ) { + value.bind( function( newval ) { + const styleId = 'responsive-page-banner-min-height-tablet'; + jQuery(`style#${styleId}`).remove(); + + jQuery('head').append( + `` + ); + }); + }); + + api( 'responsive_page_title_banner_min_height_mobile', function( value ) { + value.bind( function( newval ) { + const styleId = 'responsive-page-banner-min-height-mobile'; + jQuery(`style#${styleId}`).remove(); + + jQuery('head').append( + `` + ); + }); + }); + + api( 'responsive_page_title_inner_elements_spacing', function( value ) { + value.bind( function( newval ) { + $('body .responsive-single-entry-banner .container > *:not(:last-child), .page .entry-header > *:not(:last-child)').css('margin-bottom', newval+'px'); + }) + }); + //Footer Layout -> Footer Widgets //Number Of Columns api( diff --git a/core/includes/customizer/assets/js/customize-preview-padding-control.js b/core/includes/customizer/assets/js/customize-preview-padding-control.js index 2d1a849ea..92be979d5 100644 --- a/core/includes/customizer/assets/js/customize-preview-padding-control.js +++ b/core/includes/customizer/assets/js/customize-preview-padding-control.js @@ -45,6 +45,67 @@ } + function responsive_dynamic_unit_padding(control, selector) { + var mobile_menu_breakpoint = api( 'responsive_mobile_menu_breakpoint' ).get(); + if( 0 == api( 'responsive_disable_mobile_menu').get()) { + mobile_menu_breakpoint = 0; + } + + var desktopUnit = api('responsive_'+control+'_desktop_unit') ? api('responsive_'+control+'_desktop_unit').get() : 'px'; + var tabletUnit = api('responsive_'+control+'_tablet_unit') ? api('responsive_'+control+'_tablet_unit').get() : 'px'; + var mobileUnit = api('responsive_'+control+'_mobile_unit') ? api('responsive_'+control+'_mobile_unit').get() : 'px'; + + jQuery( 'style#responsive-'+control+'-padding' ).remove(); + var desktopPadding = 'padding-top:'+ api('responsive_'+control+'_top_padding').get()+desktopUnit+'; '+'padding-bottom:'+ api('responsive_'+control+'_bottom_padding').get()+desktopUnit+'; '+'padding-left:'+ api('responsive_'+control+'_left_padding').get()+desktopUnit+'; '+'padding-right:'+ api('responsive_'+control+'_right_padding').get()+desktopUnit+';'; + var tabletPadding = 'padding-top:'+ api('responsive_'+control+'_tablet_top_padding').get()+tabletUnit+'; '+'padding-bottom:'+ api('responsive_'+control+'_tablet_bottom_padding').get()+tabletUnit+'; '+'padding-left:'+ api('responsive_'+control+'_tablet_left_padding').get()+tabletUnit+'; '+'padding-right:'+ api('responsive_'+control+'_tablet_right_padding').get()+tabletUnit+';'; + var mobilePadding = 'padding-top:'+ api('responsive_'+control+'_mobile_top_padding').get()+mobileUnit+'; '+'padding-bottom:'+ api('responsive_'+control+'_mobile_bottom_padding').get()+mobileUnit+'; '+'padding-left:'+ api('responsive_'+control+'_mobile_left_padding').get()+mobileUnit+'; '+'padding-right:'+ api('responsive_'+control+'_mobile_right_padding').get()+mobileUnit+';'; + jQuery( 'head' ).append( + '' + ); + } + + function responsive_dynamic_unit_margin(control, selector) { + var mobile_menu_breakpoint = api( 'responsive_mobile_menu_breakpoint' ).get(); + if( 0 == api( 'responsive_disable_mobile_menu').get()) { + mobile_menu_breakpoint = 0; + } + + var desktopUnit = api('responsive_'+control+'_desktop_unit') ? api('responsive_'+control+'_desktop_unit').get() : 'px'; + var tabletUnit = api('responsive_'+control+'_tablet_unit') ? api('responsive_'+control+'_tablet_unit').get() : 'px'; + var mobileUnit = api('responsive_'+control+'_mobile_unit') ? api('responsive_'+control+'_mobile_unit').get() : 'px'; + + var dTop = api('responsive_'+control+'_top_padding').get(); + var dBottom = api('responsive_'+control+'_bottom_padding').get(); + var dLeft = api('responsive_'+control+'_left_padding').get(); + var dRight = api('responsive_'+control+'_right_padding').get(); + var desktopMargin = (dTop === '' && dBottom === '' && dLeft === '' && dRight === '') ? 'margin: 0 0;' : 'margin-top:'+ dTop+desktopUnit+'; '+'margin-bottom:'+ dBottom+desktopUnit+'; '+'margin-left:'+ dLeft+desktopUnit+'; '+'margin-right:'+ dRight+desktopUnit+';'; + + var tTop = api('responsive_'+control+'_tablet_top_padding').get(); + var tBottom = api('responsive_'+control+'_tablet_bottom_padding').get(); + var tLeft = api('responsive_'+control+'_tablet_left_padding').get(); + var tRight = api('responsive_'+control+'_tablet_right_padding').get(); + var tabletMargin = (tTop === '' && tBottom === '' && tLeft === '' && tRight === '') ? 'margin: 0 0;' : 'margin-top:'+ tTop+tabletUnit+'; '+'margin-bottom:'+ tBottom+tabletUnit+'; '+'margin-left:'+ tLeft+tabletUnit+'; '+'margin-right:'+ tRight+tabletUnit+';'; + + var mTop = api('responsive_'+control+'_mobile_top_padding').get(); + var mBottom = api('responsive_'+control+'_mobile_bottom_padding').get(); + var mLeft = api('responsive_'+control+'_mobile_left_padding').get(); + var mRight = api('responsive_'+control+'_mobile_right_padding').get(); + var mobileMargin = (mTop === '' && mBottom === '' && mLeft === '' && mRight === '') ? 'margin: 0 0;' : 'margin-top:'+ mTop+mobileUnit+'; '+'margin-bottom:'+ mBottom+mobileUnit+'; '+'margin-left:'+ mLeft+mobileUnit+'; '+'margin-right:'+ mRight+mobileUnit+';'; + + jQuery( 'style#responsive-'+control+'-margin' ).remove(); + jQuery( 'head' ).append( + '' + ); + } + function responsive_dynamic_box_padding( ) { var mobile_menu_breakpoint = api( 'responsive_mobile_menu_breakpoint' ).get(); if( 0 == api( 'responsive_disable_mobile_menu').get()) { @@ -53,7 +114,7 @@ var style = '
  • + render_content(); ?> +
  • + json['id'] = $this->id; + $this->json['l10n'] = $this->l10n(); + $this->json['title'] = esc_html__( 'Link values together', 'responsive' ); + + $this->json['inputAttrs'] = ''; + foreach ( $this->input_attrs as $attr => $value ) { + $this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" '; + } + + $this->json['desktop'] = array(); + $this->json['tablet'] = array(); + $this->json['mobile'] = array(); + + $this->json['units'] = array(); + + foreach ( $this->settings as $setting_key => $setting ) { + if ( strpos( $setting_key, '_unit' ) !== false ) { + // Handle unit settings: desktop_unit, tablet_unit, mobile_unit + $this->json['units'][ $setting_key ] = array( + 'id' => $setting->id, + 'link' => $this->get_link( $setting_key ), + 'value' => $this->value( $setting_key ), + ); + } else { + // Handle dimension settings: desktop_top, tablet_top, etc. + list( $_key ) = explode( '_', $setting_key ); + + if ( in_array( $_key, array( 'desktop', 'tablet', 'mobile' ) ) ) { + $this->json[ $_key ][ $setting_key ] = array( + 'id' => $setting->id, + 'link' => $this->get_link( $setting_key ), + 'value' => $this->value( $setting_key ), + ); + } + } + } + + } + + /** + * Returns an array of translation strings. + * + * @access protected + * @param string|false $id The string-ID. + * @return string + */ + protected function l10n( $id = false ) { + $translation_strings = array( + 'desktop_top' => esc_attr__( 'Top', 'responsive' ), + 'desktop_right' => esc_attr__( 'Right', 'responsive' ), + 'desktop_bottom' => esc_attr__( 'Bottom', 'responsive' ), + 'desktop_left' => esc_attr__( 'Left', 'responsive' ), + 'tablet_top' => esc_attr__( 'Top', 'responsive' ), + 'tablet_right' => esc_attr__( 'Right', 'responsive' ), + 'tablet_bottom' => esc_attr__( 'Bottom', 'responsive' ), + 'tablet_left' => esc_attr__( 'Left', 'responsive' ), + 'mobile_top' => esc_attr__( 'Top', 'responsive' ), + 'mobile_right' => esc_attr__( 'Right', 'responsive' ), + 'mobile_bottom' => esc_attr__( 'Bottom', 'responsive' ), + 'mobile_left' => esc_attr__( 'Left', 'responsive' ), + ); + if ( false === $id ) { + return $translation_strings; + } + return $translation_strings[ $id ]; + } + + /** + * Render the control's content. + * + * @see WP_Customize_Control::render_content() + */ + protected function render_content() {} + } +endif; diff --git a/core/includes/customizer/custom-styles.php b/core/includes/customizer/custom-styles.php index beaf34c50..e6a08fdd9 100644 --- a/core/includes/customizer/custom-styles.php +++ b/core/includes/customizer/custom-styles.php @@ -116,7 +116,8 @@ function responsive_customizer_styles() { $underline_content_links = esc_html( get_theme_mod( 'responsive_underline_content_links', false ) ); // Site custom styles. - $container_max_width = esc_html( get_theme_mod( 'responsive_container_width', 1140 ) ); + $container_max_width = esc_html( get_theme_mod( 'responsive_container_width', Responsive\Core\get_responsive_customizer_defaults( 'responsive_container_width' ) ) ); + $narrow_container_max_width = esc_html( get_theme_mod( 'responsive_narrow_container_width', Responsive\Core\get_responsive_customizer_defaults( 'responsive_narrow_container_width' ) ) ); $logo_custom_width = esc_html( get_theme_mod( 'responsive_logo_width' ) ); $logo_custom_width_tablet = esc_html( get_theme_mod( 'responsive_logo_width_tablet' ) ); $logo_custom_width_mobile = esc_html( get_theme_mod( 'responsive_logo_width_mobile') ); @@ -124,7 +125,10 @@ function responsive_customizer_styles() { $global_sidebar_position = get_theme_mod( 'responsive_default_sidebar_position', 'no' ); $page_sidebar_setting = get_theme_mod( 'responsive_page_sidebar_position', 'global' ); $responsive_page_sidebar_position = esc_html( ($page_sidebar_setting === 'global' || $page_sidebar_setting === 'default') ? $global_sidebar_position : $page_sidebar_setting); - if($page_sidebar_setting === 'global' || $page_sidebar_setting === 'default') + if ( Responsive\Core\responsive_is_narrow_container_layout() ) { + $responsive_page_sidebar_width = 0; + $page_primary_content_area_width = 100; + } else if($page_sidebar_setting === 'global' || $page_sidebar_setting === 'default') { $responsive_page_sidebar_width = esc_html(get_theme_mod('responsive_default_sidebar_width', 30)); $page_primary_content_area_width = 100 - $responsive_page_sidebar_width; @@ -146,7 +150,10 @@ function responsive_customizer_styles() { ( $blog_sidebar_setting === 'global' || $blog_sidebar_setting === 'default' ) ? $global_sidebar_position : $blog_sidebar_setting ); - if($blog_sidebar_setting === 'left' || $blog_sidebar_setting === 'right') + if ( Responsive\Core\responsive_is_narrow_container_layout() ) { + $responsive_blog_archive_sidebar_width = 0; + $blog_archive_primary_content_area_width = 100; + } else if($blog_sidebar_setting === 'left' || $blog_sidebar_setting === 'right') { $responsive_blog_archive_sidebar_width = esc_html( get_theme_mod( 'responsive_blog_sidebar_width', 30 ) ); $blog_archive_primary_content_area_width = 100 - $responsive_blog_archive_sidebar_width; @@ -169,7 +176,10 @@ function responsive_customizer_styles() { ( $single_blog_sidebar_setting === 'global' || $single_blog_sidebar_setting === 'default' ) ? $global_sidebar_position : $single_blog_sidebar_setting ); - if($single_blog_sidebar_setting === 'global' || $single_blog_sidebar_setting === 'default') + if ( Responsive\Core\responsive_is_narrow_container_layout() ) { + $responsive_single_blog_sidebar_width = 0; + $single_blog_primary_content_area_width = 100; + } else if($single_blog_sidebar_setting === 'global' || $single_blog_sidebar_setting === 'default') { $responsive_single_blog_sidebar_width = esc_html(get_theme_mod('responsive_default_sidebar_width', 30)); $single_blog_primary_content_area_width = 100 - $responsive_single_blog_sidebar_width; @@ -195,42 +205,50 @@ function responsive_customizer_styles() { $site_background_color_type = get_theme_mod( 'responsive_site_background_color_type', 'color' ); // Inside Container Spacing. - $blog_inside_container_padding_right = esc_html( get_theme_mod( 'responsive_blog_inside_container_right_padding', 15 ) ); - $blog_inside_container_padding_left = esc_html( get_theme_mod( 'responsive_blog_inside_container_left_padding', 15 ) ); - $blog_inside_container_padding_top = esc_html( get_theme_mod( 'responsive_blog_inside_container_top_padding', 15 ) ); - $blog_inside_container_padding_bottom = esc_html( get_theme_mod( 'responsive_blog_inside_container_bottom_padding', 15 ) ); + $blog_inside_container_padding_right = esc_html( get_theme_mod( 'responsive_blog_inside_container_right_padding', 30 ) ); + $blog_inside_container_padding_left = esc_html( get_theme_mod( 'responsive_blog_inside_container_left_padding', 30 ) ); + $blog_inside_container_padding_top = esc_html( get_theme_mod( 'responsive_blog_inside_container_top_padding', 30 ) ); + $blog_inside_container_padding_bottom = esc_html( get_theme_mod( 'responsive_blog_inside_container_bottom_padding', 30 ) ); - $blog_inside_container_tablet_padding_right = esc_html( get_theme_mod( 'responsive_blog_inside_container_tablet_right_padding', 15 ) ); - $blog_inside_container_tablet_padding_left = esc_html( get_theme_mod( 'responsive_blog_inside_container_tablet_left_padding', 15 ) ); - $blog_inside_container_tablet_padding_top = esc_html( get_theme_mod( 'responsive_blog_inside_container_tablet_top_padding', 15 ) ); - $blog_inside_container_tablet_padding_bottom = esc_html( get_theme_mod( 'responsive_blog_inside_container_tablet_bottom_padding', 15 ) ); + $blog_inside_container_tablet_padding_right = esc_html( get_theme_mod( 'responsive_blog_inside_container_tablet_right_padding', 30 ) ); + $blog_inside_container_tablet_padding_left = esc_html( get_theme_mod( 'responsive_blog_inside_container_tablet_left_padding', 30 ) ); + $blog_inside_container_tablet_padding_top = esc_html( get_theme_mod( 'responsive_blog_inside_container_tablet_top_padding', 30 ) ); + $blog_inside_container_tablet_padding_bottom = esc_html( get_theme_mod( 'responsive_blog_inside_container_tablet_bottom_padding', 30 ) ); - $blog_inside_container_mobile_padding_right = esc_html( get_theme_mod( 'responsive_blog_inside_container_mobile_right_padding', 15 ) ); - $blog_inside_container_mobile_padding_left = esc_html( get_theme_mod( 'responsive_blog_inside_container_mobile_left_padding', 15 ) ); - $blog_inside_container_mobile_padding_top = esc_html( get_theme_mod( 'responsive_blog_inside_container_mobile_top_padding', 15 ) ); - $blog_inside_container_mobile_padding_bottom = esc_html( get_theme_mod( 'responsive_blog_inside_container_mobile_bottom_padding', 15 ) ); + $blog_inside_container_mobile_padding_right = esc_html( get_theme_mod( 'responsive_blog_inside_container_mobile_right_padding', 30 ) ); + $blog_inside_container_mobile_padding_left = esc_html( get_theme_mod( 'responsive_blog_inside_container_mobile_left_padding', 30 ) ); + $blog_inside_container_mobile_padding_top = esc_html( get_theme_mod( 'responsive_blog_inside_container_mobile_top_padding', 30 ) ); + $blog_inside_container_mobile_padding_bottom = esc_html( get_theme_mod( 'responsive_blog_inside_container_mobile_bottom_padding', 30 ) ); - $outside_container_padding_right = esc_html( get_theme_mod( 'responsive_outside_container_right_padding', 15 ) ); - $outside_container_padding_left = esc_html( get_theme_mod( 'responsive_outside_container_left_padding', 15 ) ); + $outside_container_padding_right = esc_html( get_theme_mod( 'responsive_outside_container_right_padding', 12 ) ); + $outside_container_padding_left = esc_html( get_theme_mod( 'responsive_outside_container_left_padding', 12 ) ); $outside_container_padding_top = esc_html( get_theme_mod( 'responsive_outside_container_top_padding', 0 ) ); $outside_container_padding_bottom = esc_html( get_theme_mod( 'responsive_outside_container_bottom_padding', 0 ) ); - $blog_outside_container_padding_right = esc_html( get_theme_mod( 'responsive_blog_outside_container_right_padding', 15 ) ); - $blog_outside_container_padding_left = esc_html( get_theme_mod( 'responsive_blog_outside_container_left_padding', 15 ) ); + $blog_outside_container_padding_right = esc_html( get_theme_mod( 'responsive_blog_outside_container_right_padding', 12 ) ); + $blog_outside_container_padding_left = esc_html( get_theme_mod( 'responsive_blog_outside_container_left_padding', 12 ) ); $blog_outside_container_padding_top = esc_html( get_theme_mod( 'responsive_blog_outside_container_top_padding', 0 ) ); $blog_outside_container_padding_bottom = esc_html( get_theme_mod( 'responsive_blog_outside_container_bottom_padding', 0 ) ); // product card spacing desktop - $product_card_outside_container_padding_top = esc_html( get_theme_mod( 'responsive_product_card_outside_container_top_padding', 15 ) ); - $product_card_outside_container_padding_bottom = esc_html( get_theme_mod( 'responsive_product_card_outside_container_bottom_padding', 15 ) ); + $product_card_outside_container_padding_top = esc_html( get_theme_mod( 'responsive_product_card_outside_container_top_padding', 12 ) ); + $product_card_outside_container_padding_bottom = esc_html( get_theme_mod( 'responsive_product_card_outside_container_bottom_padding', 12 ) ); $product_card_outside_container_padding_left = esc_html( get_theme_mod( 'responsive_product_card_outside_container_left_padding', 15 ) ); $product_card_outside_container_padding_right = esc_html( get_theme_mod( 'responsive_product_card_outside_container_right_padding', 15 ) ); - // Container Layout (Default / Normal / Full Width) + // Container Layout (Default / Normal / Narrow / Full Width) $global_container_layout = get_theme_mod( 'responsive_width', 'contained' ); - $global_container_layout_key = ( 'full-width' === $global_container_layout ) ? 'full-width' : 'normal'; + if ( 'full-width' === $global_container_layout ) { + $global_container_layout_key = 'full-width'; + } elseif ( 'narrow' === $global_container_layout ) { + $global_container_layout_key = 'narrow'; + } else { + $global_container_layout_key = 'normal'; + } + + $default_container_max_width = ( 'narrow' === $global_container_layout ) ? $narrow_container_max_width : $container_max_width; // Page Container Layout. if ( is_page() ) { @@ -249,6 +267,12 @@ function responsive_customizer_styles() { .page:not(.front-page):not(.woocommerce-cart):not(.woocommerce-checkout) [class*='__inner-container'] { max-width: 100%; }"; + } elseif ( 'narrow' === $responsive_page_container_layout ) { + $custom_css .= " + .page:not(.front-page):not(.woocommerce-cart):not(.woocommerce-checkout) .container, + .page:not(.front-page):not(.woocommerce-cart):not(.woocommerce-checkout) [class*='__inner-container'] { + max-width: {$narrow_container_max_width}px; + }"; } elseif ( 'normal' === $responsive_page_container_layout ) { $custom_css .= " .page:not(.front-page):not(.woocommerce-cart):not(.woocommerce-checkout) .container, @@ -268,6 +292,14 @@ function responsive_customizer_styles() { .archive:not(.post-type-archive-product) [class*='__inner-container'] { max-width: 100%; }"; + } elseif ( 'narrow' === $responsive_blog_container_layout ) { + $custom_css .= " + .blog:not(.custom-home-page-active) .container, + .archive:not(.post-type-archive-product) .container, + .blog:not(.custom-home-page-active) [class*='__inner-container'], + .archive:not(.post-type-archive-product) [class*='__inner-container'] { + max-width: {$narrow_container_max_width}px; + }"; } elseif ( 'normal' === $responsive_blog_container_layout ) { $custom_css .= " .blog:not(.custom-home-page-active) .container, @@ -288,6 +320,12 @@ function responsive_customizer_styles() { .single:not(.single-product) [class*='__inner-container'] { max-width: 100%; }"; + } elseif ( 'narrow' === $responsive_single_blog_container_layout ) { + $custom_css .= " + .single:not(.single-product) .container, + .single:not(.single-product) [class*='__inner-container'] { + max-width: {$narrow_container_max_width}px; + }"; } elseif ( 'normal' === $responsive_single_blog_container_layout ) { $custom_css .= " .single:not(.single-product) .container, @@ -306,6 +344,12 @@ function responsive_customizer_styles() { .woocommerce-shop [class*='__inner-container'] { max-width: 100% !important; }"; + } elseif ( 'narrow' === $responsive_product_catalog_container_layout ) { + $custom_css .= " + .woocommerce-shop .container, + .woocommerce-shop [class*='__inner-container'] { + max-width: {$narrow_container_max_width}px !important; + }"; } elseif ( 'normal' === $responsive_product_catalog_container_layout ) { $custom_css .= " .woocommerce-shop .container, @@ -324,6 +368,12 @@ function responsive_customizer_styles() { .single-product [class*='__inner-container'] { max-width: 100% !important; }"; + } elseif ( 'narrow' === $responsive_single_product_container_layout ) { + $custom_css .= " + .single-product .container, + .single-product [class*='__inner-container'] { + max-width: {$narrow_container_max_width}px !important; + }"; } elseif ( 'normal' === $responsive_single_product_container_layout ) { $custom_css .= " .single-product .container, @@ -356,26 +406,26 @@ function responsive_customizer_styles() { if ( 'boxed' === $responsive_page_container_style ) { $custom_css .= " - .page:not(.front-page):not(.woocommerce-cart):not(.woocommerce-checkout) .site-content .hentry { + .page:not(.front-page):not(.woocommerce-cart):not(.woocommerce-checkout):not(.page-template-gutenberg-fullwidth) .site-content .hentry { background-color: {$box_background_color}; border-radius: {$box_top_left_radius}px {$box_top_right_radius}px {$box_bottom_right_radius}px {$box_bottom_left_radius}px; padding: " . responsive_spacing_css( $box_padding_top, $box_padding_right, $box_padding_bottom, $box_padding_left ) . "; } @media screen and ( max-width: 992px ) { - .page:not(.front-page):not(.woocommerce-cart):not(.woocommerce-checkout) .site-content .hentry { + .page:not(.front-page):not(.woocommerce-cart):not(.woocommerce-checkout):not(.page-template-gutenberg-fullwidth) .site-content .hentry { border-radius: {$box_tablet_top_left_radius}px {$box_tablet_top_right_radius}px {$box_tablet_bottom_right_radius}px {$box_tablet_bottom_left_radius}px; padding: " . responsive_spacing_css( $box_tablet_padding_top, $box_tablet_padding_right, $box_tablet_padding_bottom, $box_tablet_padding_left ) . "; } } @media screen and ( max-width: 576px ) { - .page:not(.front-page):not(.woocommerce-cart):not(.woocommerce-checkout) .site-content .hentry { + .page:not(.front-page):not(.woocommerce-cart):not(.woocommerce-checkout):not(.page-template-gutenberg-fullwidth) .site-content .hentry { border-radius: {$box_mobile_top_left_radius}px {$box_mobile_top_right_radius}px {$box_mobile_bottom_right_radius}px {$box_mobile_bottom_left_radius}px; padding: " . responsive_spacing_css( $box_mobile_padding_top, $box_mobile_padding_right, $box_mobile_padding_bottom, $box_mobile_padding_left ) . "; } }"; } elseif ( 'unboxed' === $responsive_page_container_style ) { $custom_css .= " - .page:not(.front-page):not(.woocommerce-cart):not(.woocommerce-checkout) .site-content .hentry { + .page:not(.front-page):not(.woocommerce-cart):not(.woocommerce-checkout):not(.page-template-gutenberg-fullwidth) .site-content .hentry { background-color: {$site_background_color}; border-radius: 0; @@ -429,24 +479,21 @@ function responsive_customizer_styles() { : "background-color: {$box_background_color};"; $custom_css .= " .single:not(.single-product) .site-content .hentry, - .single:not(.single-product) .comments-area, - .single:not(.single-product) .comment-respond { + .single:not(.single-product) .comments-area { {$single_boxed_background_css} border-radius: {$box_top_left_radius}px {$box_top_right_radius}px {$box_bottom_right_radius}px {$box_bottom_left_radius}px; padding: " . responsive_spacing_css( $box_padding_top, $box_padding_right, $box_padding_bottom, $box_padding_left ) . "; } @media screen and ( max-width: 992px ) { .single:not(.single-product) .site-content .hentry, - .single:not(.single-product) .comments-area, - .single:not(.single-product) .comment-respond { + .single:not(.single-product) .comments-area { border-radius: {$box_tablet_top_left_radius}px {$box_tablet_top_right_radius}px {$box_tablet_bottom_right_radius}px {$box_tablet_bottom_left_radius}px; padding: " . responsive_spacing_css( $box_tablet_padding_top, $box_tablet_padding_right, $box_tablet_padding_bottom, $box_tablet_padding_left ) . "; } } @media screen and ( max-width: 576px ) { .single:not(.single-product) .site-content .hentry, - .single:not(.single-product) .comments-area, - .single:not(.single-product) .comment-respond { + .single:not(.single-product) .comments-area { border-radius: {$box_mobile_top_left_radius}px {$box_mobile_top_right_radius}px {$box_mobile_bottom_right_radius}px {$box_mobile_bottom_left_radius}px; padding: " . responsive_spacing_css( $box_mobile_padding_top, $box_mobile_padding_right, $box_mobile_padding_bottom, $box_mobile_padding_left ) . "; } @@ -454,8 +501,7 @@ function responsive_customizer_styles() { } elseif ( 'unboxed' === $responsive_single_blog_container_style ) { $custom_css .= " .single:not(.single-product) .site-content .hentry, - .single:not(.single-product) .comments-area, - .single:not(.single-product) .comment-respond { + .single:not(.single-product) .comments-area { background-color: {$site_background_color}; border-radius: 0; padding: " . responsive_spacing_css( $outside_container_padding_top, $outside_container_padding_right, $outside_container_padding_bottom, $outside_container_padding_left) . "; @@ -584,6 +630,7 @@ function responsive_customizer_styles() { .responsive-site-style-boxed .comments-area, .responsive-site-style-boxed .comment-respond, .responsive-site-style-boxed .comment-respond, + .responsive-site-style-boxed .custom-home-widget-section .widget-wrapper, aside#secondary.responsive-sidebar-style-boxed .widget-wrapper, .responsive-site-style-boxed .site-content article.product, .woocommerce.responsive-site-style-content-boxed .related-product-wrapper, @@ -630,6 +677,7 @@ function responsive_customizer_styles() { .responsive-site-style-boxed .comments-area, .responsive-site-style-boxed .comment-respond, .responsive-site-style-boxed .comment-respond, + .responsive-site-style-boxed .custom-home-widget-section .widget-wrapper, aside#secondary.responsive-sidebar-style-boxed .widget-wrapper, .responsive-site-style-boxed .site-content article.product, .woocommerce.responsive-site-style-content-boxed .related-product-wrapper, @@ -649,11 +697,11 @@ function responsive_customizer_styles() { .container, [class*='__inner-container'], .site-header-full-width-main-navigation.site-mobile-header-layout-vertical:not(.responsive-site-full-width) .main-navigation-wrapper { - max-width: {$container_max_width}px; + max-width: {$default_container_max_width}px; } .wp-block-group { - --wp--style--global--wide-size: {$container_max_width}px; + --wp--style--global--wide-size: {$default_container_max_width}px; } html body.page-template-gutenberg-fullwidth .wp-block-group.wp-block-group.wp-block-group-is-layout-constrained > :where(:not(.alignwide):not(.alignfull)) { @@ -697,6 +745,7 @@ function responsive_customizer_styles() { .responsive-site-style-boxed .comments-area, .responsive-site-style-boxed .comment-respond, .responsive-site-style-boxed .comment-respond, + .responsive-site-style-boxed .custom-home-widget-section .widget-wrapper, aside#secondary.responsive-sidebar-style-boxed .widget-wrapper, .responsive-site-style-boxed .site-content article.product { border-radius:{$box_tablet_top_left_radius}px {$box_tablet_top_right_radius}px {$box_tablet_bottom_right_radius}px {$box_tablet_bottom_left_radius}px; @@ -735,6 +784,7 @@ function responsive_customizer_styles() { .responsive-site-style-boxed .comments-area, .responsive-site-style-boxed .comment-respond, .responsive-site-style-boxed .comment-respond, + .responsive-site-style-boxed .custom-home-widget-section .widget-wrapper, aside#secondary.responsive-sidebar-style-boxed .widget-wrapper, .responsive-site-style-boxed .site-content article.product { border-radius:{$box_mobile_top_left_radius}px {$box_mobile_top_right_radius}px {$box_mobile_bottom_right_radius}px {$box_mobile_bottom_left_radius}px; @@ -774,13 +824,11 @@ function responsive_customizer_styles() { .responsive-site-style-content-boxed .navigation, .responsive-site-style-content-boxed .responsive-single-related-posts-container, .responsive-site-style-content-boxed .comments-area, - .responsive-site-style-content-boxed .comment-respond, .responsive-site-style-boxed .give-wrap .give_forms, .responsive-site-style-boxed .hentry, .responsive-site-style-boxed .navigation, .responsive-site-style-boxed .responsive-single-related-posts-container, .responsive-site-style-boxed .comments-area, - .responsive-site-style-boxed .comment-respond, .page.front-page.responsive-site-style-flat .widget-wrapper, .blog.front-page.responsive-site-style-flat .widget-wrapper, .responsive-site-style-boxed .widget-wrapper, @@ -800,7 +848,6 @@ function responsive_customizer_styles() { .responsive-site-style-boxed .navigation, .responsive-site-style-boxed .responsive-single-related-posts-container, .responsive-site-style-boxed .comments-area, - .responsive-site-style-boxed .comment-respond, .page.front-page.responsive-site-style-flat .widget-wrapper, .blog.front-page.responsive-site-style-flat .widget-wrapper, .responsive-site-style-boxed .widget-wrapper, @@ -971,6 +1018,7 @@ function responsive_customizer_styles() { .responsive-site-style-boxed .comments-area, .responsive-site-style-boxed .comment-respond, .responsive-site-style-boxed .comment-respond, + .responsive-site-style-boxed .custom-home-widget-section .widget-wrapper, aside#secondary.responsive-sidebar-style-boxed .widget-wrapper, .responsive-site-style-boxed .site-content article.product { background-color:{$box_background_color}; @@ -1114,14 +1162,16 @@ function responsive_customizer_styles() { }"; } else { if( 'gradient' === $box_background_color_type ) { - $custom_css .= "aside#secondary.responsive-sidebar-style-boxed .widget-wrapper { + $custom_css .= ".responsive-site-style-boxed .custom-home-widget-section .widget-wrapper, + aside#secondary.responsive-sidebar-style-boxed .widget-wrapper { background: $box_background_gradient_color; background-repeat: no-repeat; background-size: cover; background-attachment: scroll; }"; } else { - $custom_css .= "aside#secondary.responsive-sidebar-style-boxed .widget-wrapper { + $custom_css .= ".responsive-site-style-boxed .custom-home-widget-section .widget-wrapper, + aside#secondary.responsive-sidebar-style-boxed .widget-wrapper { background-color: $box_background_color; background-image: linear-gradient(to right, {$box_background_color}, {$box_background_color}), url({$box_background_image}); background-repeat: no-repeat; @@ -1368,20 +1418,20 @@ function responsive_customizer_styles() { $button_mobile_bottom_left_radius = esc_html( get_theme_mod( 'responsive_buttons_radius_mobile_bottom_left_radius', Responsive\Core\get_responsive_customizer_defaults( 'responsive_buttons_radius' ) ) ); // Border width new control. - $buttons_border_width_top = esc_html( get_theme_mod( 'responsive_buttons_border_width_top_border', 1 ) ); - $buttons_border_width_right = esc_html( get_theme_mod( 'responsive_buttons_border_width_right_border', 1 ) ); - $buttons_border_width_bottom = esc_html( get_theme_mod( 'responsive_buttons_border_width_bottom_border', 1 ) ); - $buttons_border_width_left = esc_html( get_theme_mod( 'responsive_buttons_border_width_left_border', 1 ) ); + $buttons_border_width_top = esc_html( get_theme_mod( 'responsive_buttons_border_width_top_border', 0 ) ); + $buttons_border_width_right = esc_html( get_theme_mod( 'responsive_buttons_border_width_right_border', 0 ) ); + $buttons_border_width_bottom = esc_html( get_theme_mod( 'responsive_buttons_border_width_bottom_border', 0 ) ); + $buttons_border_width_left = esc_html( get_theme_mod( 'responsive_buttons_border_width_left_border', 0 ) ); - $buttons_border_tablet_width_top = esc_html( get_theme_mod( 'responsive_buttons_border_width_tablet_top_border', 1 ) ); - $buttons_border_tablet_width_right = esc_html( get_theme_mod( 'responsive_buttons_border_width_tablet_right_border', 1 ) ); - $buttons_border_tablet_width_bottom = esc_html( get_theme_mod( 'responsive_buttons_border_width_tablet_bottom_border', 1 ) ); - $buttons_border_tablet_width_left = esc_html( get_theme_mod( 'responsive_buttons_border_width_tablet_left_border', 1 ) ); + $buttons_border_tablet_width_top = esc_html( get_theme_mod( 'responsive_buttons_border_width_tablet_top_border', 0 ) ); + $buttons_border_tablet_width_right = esc_html( get_theme_mod( 'responsive_buttons_border_width_tablet_right_border', 0 ) ); + $buttons_border_tablet_width_bottom = esc_html( get_theme_mod( 'responsive_buttons_border_width_tablet_bottom_border', 0 ) ); + $buttons_border_tablet_width_left = esc_html( get_theme_mod( 'responsive_buttons_border_width_tablet_left_border', 0 ) ); - $buttons_border_mobile_width_top = esc_html( get_theme_mod( 'responsive_buttons_border_width_mobile_top_border', 1 ) ); - $buttons_border_mobile_width_right = esc_html( get_theme_mod( 'responsive_buttons_border_width_mobile_right_border', 1 ) ); - $buttons_border_mobile_width_bottom = esc_html( get_theme_mod( 'responsive_buttons_border_width_mobile_bottom_border', 1 ) ); - $buttons_border_mobile_width_left = esc_html( get_theme_mod( 'responsive_buttons_border_width_mobile_left_border', 1 ) ); + $buttons_border_mobile_width_top = esc_html( get_theme_mod( 'responsive_buttons_border_width_mobile_top_border', 0 ) ); + $buttons_border_mobile_width_right = esc_html( get_theme_mod( 'responsive_buttons_border_width_mobile_right_border', 0 ) ); + $buttons_border_mobile_width_bottom = esc_html( get_theme_mod( 'responsive_buttons_border_width_mobile_bottom_border', 0 ) ); + $buttons_border_mobile_width_left = esc_html( get_theme_mod( 'responsive_buttons_border_width_mobile_left_border', 0 ) ); // Inputs Padding. $inputs_padding_right = esc_html( get_theme_mod( 'responsive_inputs_right_padding', 3 ) ); @@ -1466,24 +1516,28 @@ function responsive_customizer_styles() { } } + $meta_typography = get_theme_mod( 'meta_typography' ); + $meta_text_transform = ( $meta_typography && isset( $meta_typography['text-transform'] ) ) ? $meta_typography['text-transform'] : 'capitalize'; + $custom_css .= " body { color:{$body_text_color}; } - .post-data *, .hentry .post-data a, .hentry .post-data, - .post-meta *, .hentry .post-meta a { - color:{$meta_text_color}; - } + a { color:{$link_color}; } + :where(h1, h2, h3, h4, h5, h6) a { + color: inherit; + } .entry-content .woocommerce a.remove:hover { color:{$link_color} !important; border-color:{$link_color}; } - a:hover { - color:{$link_hover_color}; + a:hover:not(:where(h1, h2, h3, h4, h5, h6) a) { + color: {$link_hover_color}; } + label, div.wpforms-container-full .wpforms-form .wpforms-field-label, .wp-core-ui div.wpforms-container-full .wpforms-form .wpforms-field-label { @@ -4151,12 +4205,15 @@ function responsive_customizer_styles() { } // Entry Blog Meta Separator. - $blog_entry_meta_separator = esc_html( get_theme_mod( 'responsive_blog_entry_meta_separator_text', '-' ) ); + $blog_entry_meta_separator = esc_html( get_theme_mod( 'responsive_blog_entry_meta_separator_text', '•' ) ); + if ( 'none' === strtolower( $blog_entry_meta_separator ) ) { + $blog_entry_meta_separator = ''; + } $custom_css .= " - .search .hentry .post-meta > span::after, - .archive .hentry .post-meta > span::after, - .blog .hentry .post-meta > span::after { + .search .hentry .post-meta > span:not(:last-child)::after, + .archive .hentry .post-meta > span:not(:last-child)::after, + .blog .hentry .post-meta > span:not(:last-child)::after { content: '{$blog_entry_meta_separator}'; }"; @@ -4221,10 +4278,14 @@ function responsive_customizer_styles() { } // Entry Blog Meta Separator. - $single_blog_entry_meta_separator = esc_html( get_theme_mod( 'responsive_single_blog_meta_separator_text', '-' ) ); + $single_blog_entry_meta_separator = esc_html( get_theme_mod( 'responsive_single_blog_meta_separator_text', '•' ) ); + if ( 'none' === strtolower( $single_blog_entry_meta_separator ) ) { + $single_blog_entry_meta_separator = ''; + } $custom_css .= " - .single .hentry .post-meta > span::after { + .single .hentry .post-meta > span:not(:last-child)::after, + .single .responsive-blog-single-banner2 .post-meta > span:not(:last-child)::after { content: '{$single_blog_entry_meta_separator}'; }"; @@ -5552,7 +5613,7 @@ function responsive_customizer_styles() { $below_footer_top_border_size = get_theme_mod( 'responsive_footer_below_row_top_border_size', 1 ); $below_footer_top_border_size_tablet = get_theme_mod( 'responsive_footer_below_row_top_border_size_tablet', $below_footer_top_border_size ); $below_footer_top_border_size_mobile = get_theme_mod( 'responsive_footer_below_row_top_border_size_mobile', $below_footer_top_border_size ); - $below_footer_top_border_color = get_theme_mod( 'responsive_footer_below_row_border_color', '#0066CC' ); + $below_footer_top_border_color = get_theme_mod( 'responsive_footer_below_row_border_color', '#D4D4D4' ); $below_footer_top_border_color_tablet = get_theme_mod( 'responsive_footer_below_row_border_color_tablet', $below_footer_top_border_color ); $below_footer_top_border_color_mobile = get_theme_mod( 'responsive_footer_below_row_border_color_mobile', $below_footer_top_border_color ); @@ -5763,13 +5824,14 @@ function responsive_build_responsive_margin_spacing_css( $margin ) { } .footer-layouts.copyright a { color: {$copyright_links_color}; + text-decoration: underline; } .footer-layouts.copyright a:hover { color: {$copyright_links_hover_color}; } "; // copyright padding - desktop - $copyright_padding_values = get_responsive_spacing_values('responsive_footer_copyright', 30, 30, 30, 30); + $copyright_padding_values = get_responsive_spacing_values('responsive_footer_copyright', 15, 15, 15, 15); $custom_css .= ".footer-layouts.copyright {"; $custom_css .= responsive_build_responsive_padding_spacing_css($copyright_padding_values['desktop']); @@ -5816,7 +5878,7 @@ function responsive_build_responsive_margin_spacing_css( $margin ) { } "; // copyright padding - tablet and mobile - $copyright_padding_values = get_responsive_spacing_values('responsive_footer_copyright', 30, 30, 30, 30); + $copyright_padding_values = get_responsive_spacing_values('responsive_footer_copyright', 15, 15, 15, 15); $custom_css .= "@media screen and (max-width: 992px) {"; $custom_css .= ".footer-layouts.copyright {"; @@ -7510,74 +7572,78 @@ function responsive_build_responsive_margin_spacing_css( $margin ) { if ( ! class_exists( 'Responsive_Addons_Pro' ) ) { // Outside Container Spacing. - $outside_container_tablet_padding_right = esc_html( get_theme_mod( 'responsive_outside_container_tablet_right_padding', 15 ) ); - $outside_container_tablet_padding_left = esc_html( get_theme_mod( 'responsive_outside_container_tablet_left_padding', 15 ) ); + $outside_container_tablet_padding_right = esc_html( get_theme_mod( 'responsive_outside_container_tablet_right_padding', 12 ) ); + $outside_container_tablet_padding_left = esc_html( get_theme_mod( 'responsive_outside_container_tablet_left_padding', 12 ) ); $outside_container_tablet_padding_top = esc_html( get_theme_mod( 'responsive_outside_container_tablet_top_padding', 0 ) ); $outside_container_tablet_padding_bottom = esc_html( get_theme_mod( 'responsive_outside_container_tablet_bottom_padding', 0 ) ); - $outside_container_mobile_padding_right = esc_html( get_theme_mod( 'responsive_outside_container_mobile_right_padding', 15 ) ); - $outside_container_mobile_padding_left = esc_html( get_theme_mod( 'responsive_outside_container_mobile_left_padding', 15 ) ); + $outside_container_mobile_padding_right = esc_html( get_theme_mod( 'responsive_outside_container_mobile_right_padding', 12 ) ); + $outside_container_mobile_padding_left = esc_html( get_theme_mod( 'responsive_outside_container_mobile_left_padding', 12 ) ); $outside_container_mobile_padding_top = esc_html( get_theme_mod( 'responsive_outside_container_mobile_top_padding', 0 ) ); $outside_container_mobile_padding_bottom = esc_html( get_theme_mod( 'responsive_outside_container_mobile_bottom_padding', 0 ) ); // Outside Container Spacing. - $blog_outside_container_tablet_padding_right = esc_html( get_theme_mod( 'responsive_blog_outside_container_tablet_right_padding', 15 ) ); - $blog_outside_container_tablet_padding_left = esc_html( get_theme_mod( 'responsive_blog_outside_container_tablet_left_padding', 15 ) ); + $blog_outside_container_tablet_padding_right = esc_html( get_theme_mod( 'responsive_blog_outside_container_tablet_right_padding', 12 ) ); + $blog_outside_container_tablet_padding_left = esc_html( get_theme_mod( 'responsive_blog_outside_container_tablet_left_padding', 12 ) ); $blog_outside_container_tablet_padding_top = esc_html( get_theme_mod( 'responsive_blog_outside_container_tablet_top_padding', 0 ) ); $blog_outside_container_tablet_padding_bottom = esc_html( get_theme_mod( 'responsive_blog_outside_container_tablet_bottom_padding', 0 ) ); - $blog_outside_container_mobile_padding_right = esc_html( get_theme_mod( 'responsive_blog_outside_container_mobile_right_padding', 15 ) ); - $blog_outside_container_mobile_padding_left = esc_html( get_theme_mod( 'responsive_blog_outside_container_mobile_left_padding', 15 ) ); + $blog_outside_container_mobile_padding_right = esc_html( get_theme_mod( 'responsive_blog_outside_container_mobile_right_padding', 12 ) ); + $blog_outside_container_mobile_padding_left = esc_html( get_theme_mod( 'responsive_blog_outside_container_mobile_left_padding', 12 ) ); $blog_outside_container_mobile_padding_top = esc_html( get_theme_mod( 'responsive_blog_outside_container_mobile_top_padding', 0 ) ); $blog_outside_container_mobile_padding_bottom = esc_html( get_theme_mod( 'responsive_blog_outside_container_mobile_bottom_padding', 0 ) ); - // Outside Container Spacing. - $single_blog_outside_container_padding_right = esc_html( get_theme_mod( 'responsive_single_blog_outside_container_right_padding', 15 ) ); - $single_blog_outside_container_padding_left = esc_html( get_theme_mod( 'responsive_single_blog_outside_container_left_padding', 15 ) ); + $single_blog_outside_container_padding_right = esc_html( get_theme_mod( 'responsive_single_blog_outside_container_right_padding', 12 ) ); + $single_blog_outside_container_padding_left = esc_html( get_theme_mod( 'responsive_single_blog_outside_container_left_padding', 12 ) ); $single_blog_outside_container_padding_top = esc_html( get_theme_mod( 'responsive_single_blog_outside_container_top_padding', 0 ) ); $single_blog_outside_container_padding_bottom = esc_html( get_theme_mod( 'responsive_single_blog_outside_container_bottom_padding', 0 ) ); + $single_blog_outside_container_unit = esc_html( get_theme_mod( 'responsive_single_blog_outside_container_desktop_unit', 'px' ) ); - $single_blog_outside_container_tablet_padding_right = esc_html( get_theme_mod( 'responsive_single_blog_outside_container_tablet_right_padding', 15 ) ); - $single_blog_outside_container_tablet_padding_left = esc_html( get_theme_mod( 'responsive_single_blog_outside_container_tablet_left_padding', 15 ) ); + $single_blog_outside_container_tablet_padding_right = esc_html( get_theme_mod( 'responsive_single_blog_outside_container_tablet_right_padding', 12 ) ); + $single_blog_outside_container_tablet_padding_left = esc_html( get_theme_mod( 'responsive_single_blog_outside_container_tablet_left_padding', 12 ) ); $single_blog_outside_container_tablet_padding_top = esc_html( get_theme_mod( 'responsive_single_blog_outside_container_tablet_top_padding', 0 ) ); $single_blog_outside_container_tablet_padding_bottom = esc_html( get_theme_mod( 'responsive_single_blog_outside_container_tablet_bottom_padding', 0 ) ); + $single_blog_outside_container_tablet_unit = esc_html( get_theme_mod( 'responsive_single_blog_outside_container_tablet_unit', 'px' ) ); - $single_blog_outside_container_mobile_padding_right = esc_html( get_theme_mod( 'responsive_single_blog_outside_container_mobile_right_padding', 15 ) ); - $single_blog_outside_container_mobile_padding_left = esc_html( get_theme_mod( 'responsive_single_blog_outside_container_mobile_left_padding', 15 ) ); + $single_blog_outside_container_mobile_padding_right = esc_html( get_theme_mod( 'responsive_single_blog_outside_container_mobile_right_padding', 12 ) ); + $single_blog_outside_container_mobile_padding_left = esc_html( get_theme_mod( 'responsive_single_blog_outside_container_mobile_left_padding', 12 ) ); $single_blog_outside_container_mobile_padding_top = esc_html( get_theme_mod( 'responsive_single_blog_outside_container_mobile_top_padding', 0 ) ); $single_blog_outside_container_mobile_padding_bottom = esc_html( get_theme_mod( 'responsive_single_blog_outside_container_mobile_bottom_padding', 0 ) ); - + $single_blog_outside_container_mobile_unit = esc_html( get_theme_mod( 'responsive_single_blog_outside_container_mobile_unit', 'px' ) ); // Inside Container Spacing. $single_blog_inside_container_padding_right = esc_html( get_theme_mod( 'responsive_single_blog_inside_container_right_padding', 15 ) ); $single_blog_inside_container_padding_left = esc_html( get_theme_mod( 'responsive_single_blog_inside_container_left_padding', 15 ) ); $single_blog_inside_container_padding_top = esc_html( get_theme_mod( 'responsive_single_blog_inside_container_top_padding', 15 ) ); $single_blog_inside_container_padding_bottom = esc_html( get_theme_mod( 'responsive_single_blog_inside_container_bottom_padding', 15 ) ); + $single_blog_inside_container_unit = esc_html( get_theme_mod( 'responsive_single_blog_inside_container_desktop_unit', 'px' ) ); $single_blog_inside_container_tablet_padding_right = esc_html( get_theme_mod( 'responsive_single_blog_inside_container_tablet_right_padding', 15 ) ); $single_blog_inside_container_tablet_padding_left = esc_html( get_theme_mod( 'responsive_single_blog_inside_container_tablet_left_padding', 15 ) ); $single_blog_inside_container_tablet_padding_top = esc_html( get_theme_mod( 'responsive_single_blog_inside_container_tablet_top_padding', 15 ) ); $single_blog_inside_container_tablet_padding_bottom = esc_html( get_theme_mod( 'responsive_single_blog_inside_container_tablet_bottom_padding', 15 ) ); + $single_blog_inside_container_tablet_unit = esc_html( get_theme_mod( 'responsive_single_blog_inside_container_tablet_unit', 'px' ) ); $single_blog_inside_container_mobile_padding_right = esc_html( get_theme_mod( 'responsive_single_blog_inside_container_mobile_right_padding', 15 ) ); $single_blog_inside_container_mobile_padding_left = esc_html( get_theme_mod( 'responsive_single_blog_inside_container_mobile_left_padding', 15 ) ); $single_blog_inside_container_mobile_padding_top = esc_html( get_theme_mod( 'responsive_single_blog_inside_container_mobile_top_padding', 15 ) ); $single_blog_inside_container_mobile_padding_bottom = esc_html( get_theme_mod( 'responsive_single_blog_inside_container_mobile_bottom_padding', 15 ) ); + $single_blog_inside_container_mobile_unit = esc_html( get_theme_mod( 'responsive_single_blog_inside_container_mobile_unit', 'px' ) ); // Outside Container Spacing. - $sidebar_outside_container_padding_right = esc_html( get_theme_mod( 'responsive_sidebar_outside_container_right_padding', 15 ) ); - $sidebar_outside_container_padding_left = esc_html( get_theme_mod( 'responsive_sidebar_outside_container_left_padding', 15 ) ); + $sidebar_outside_container_padding_right = esc_html( get_theme_mod( 'responsive_sidebar_outside_container_right_padding', 12 ) ); + $sidebar_outside_container_padding_left = esc_html( get_theme_mod( 'responsive_sidebar_outside_container_left_padding', 12 ) ); $sidebar_outside_container_padding_top = esc_html( get_theme_mod( 'responsive_sidebar_outside_container_top_padding', 0 ) ); $sidebar_outside_container_padding_bottom = esc_html( get_theme_mod( 'responsive_sidebar_outside_container_bottom_padding', 0 ) ); - $sidebar_outside_container_tablet_padding_right = esc_html( get_theme_mod( 'responsive_sidebar_outside_container_tablet_right_padding', 15 ) ); - $sidebar_outside_container_tablet_padding_left = esc_html( get_theme_mod( 'responsive_sidebar_outside_container_tablet_left_padding', 15 ) ); + $sidebar_outside_container_tablet_padding_right = esc_html( get_theme_mod( 'responsive_sidebar_outside_container_tablet_right_padding', 12 ) ); + $sidebar_outside_container_tablet_padding_left = esc_html( get_theme_mod( 'responsive_sidebar_outside_container_tablet_left_padding', 12 ) ); $sidebar_outside_container_tablet_padding_top = esc_html( get_theme_mod( 'responsive_sidebar_outside_container_tablet_top_padding', 0 ) ); $sidebar_outside_container_tablet_padding_bottom = esc_html( get_theme_mod( 'responsive_sidebar_outside_container_tablet_bottom_padding', 0 ) ); - $sidebar_outside_container_mobile_padding_right = esc_html( get_theme_mod( 'responsive_sidebar_outside_container_mobile_right_padding', 15 ) ); - $sidebar_outside_container_mobile_padding_left = esc_html( get_theme_mod( 'responsive_sidebar_outside_container_mobile_left_padding', 15 ) ); + $sidebar_outside_container_mobile_padding_right = esc_html( get_theme_mod( 'responsive_sidebar_outside_container_mobile_right_padding', 12 ) ); + $sidebar_outside_container_mobile_padding_left = esc_html( get_theme_mod( 'responsive_sidebar_outside_container_mobile_left_padding', 12 ) ); $sidebar_outside_container_mobile_padding_top = esc_html( get_theme_mod( 'responsive_sidebar_outside_container_mobile_top_padding', 0 ) ); $sidebar_outside_container_mobile_padding_bottom = esc_html( get_theme_mod( 'responsive_sidebar_outside_container_mobile_bottom_padding', 0 ) ); @@ -7641,29 +7707,29 @@ function responsive_build_responsive_margin_spacing_css( $margin ) { } .single.single-post.responsive-site-style-content-boxed #primary.content-area, .single.single-post.responsive-site-style-boxed #primary.content-area{ - padding: ' . responsive_spacing_css( $single_blog_outside_container_padding_top, $single_blog_outside_container_padding_right, $single_blog_outside_container_padding_bottom, $single_blog_outside_container_padding_left ) . '; + padding: ' . $single_blog_outside_container_padding_top . $single_blog_outside_container_unit . ' ' . $single_blog_outside_container_padding_right . $single_blog_outside_container_unit . ' ' . $single_blog_outside_container_padding_bottom . $single_blog_outside_container_unit . ' ' . $single_blog_outside_container_padding_left . $single_blog_outside_container_unit . '; } @media screen and ( max-width: 992px ) { .single.single-post.responsive-site-style-content-boxed #primary.content-area, .single.single-post.responsive-site-style-boxed #primary.content-area{ - padding: ' . responsive_spacing_css( $single_blog_outside_container_tablet_padding_top, $single_blog_outside_container_tablet_padding_right, $single_blog_outside_container_tablet_padding_bottom, $single_blog_outside_container_tablet_padding_left ) . '; + padding: ' . $single_blog_outside_container_tablet_padding_top . $single_blog_outside_container_tablet_unit . ' ' . $single_blog_outside_container_tablet_padding_right . $single_blog_outside_container_tablet_unit . ' ' . $single_blog_outside_container_tablet_padding_bottom . $single_blog_outside_container_tablet_unit . ' ' . $single_blog_outside_container_tablet_padding_left . $single_blog_outside_container_tablet_unit . '; } } @media screen and ( max-width: 576px ) { .single.single-post.responsive-site-style-content-boxed #primary.content-area, .single.single-post.responsive-site-style-boxed #primary.content-area{ - padding: ' . responsive_spacing_css( $single_blog_outside_container_mobile_padding_top, $single_blog_outside_container_mobile_padding_right, $single_blog_outside_container_mobile_padding_bottom, $single_blog_outside_container_mobile_padding_left ) . '; + padding: ' . $single_blog_outside_container_mobile_padding_top . $single_blog_outside_container_mobile_unit . ' ' . $single_blog_outside_container_mobile_padding_right . $single_blog_outside_container_mobile_unit . ' ' . $single_blog_outside_container_mobile_padding_bottom . $single_blog_outside_container_mobile_unit . ' ' . $single_blog_outside_container_mobile_padding_left . $single_blog_outside_container_mobile_unit . '; } } .single.single-post.responsive-site-style-content-boxed .site-content .hentry, .single.single-post.responsive-site-style-boxed .site-content .hentry{ - padding: ' . responsive_spacing_css( $single_blog_inside_container_padding_top, $single_blog_inside_container_padding_right, $single_blog_inside_container_padding_bottom, $single_blog_inside_container_padding_left ) . '; + padding: ' . $single_blog_inside_container_padding_top . $single_blog_inside_container_unit . ' ' . $single_blog_inside_container_padding_right . $single_blog_inside_container_unit . ' ' . $single_blog_inside_container_padding_bottom . $single_blog_inside_container_unit . ' ' . $single_blog_inside_container_padding_left . $single_blog_inside_container_unit . '; } @media screen and ( max-width: 992px ) { .single.single-post.responsive-site-style-content-boxed .site-content .hentry, .single.single-post.responsive-site-style-boxed .site-content .hentry{ - padding: ' . responsive_spacing_css( $single_blog_inside_container_tablet_padding_top, $single_blog_inside_container_tablet_padding_right, $single_blog_inside_container_tablet_padding_bottom, $single_blog_inside_container_tablet_padding_left ) . '; + padding: ' . $single_blog_inside_container_tablet_padding_top . $single_blog_inside_container_tablet_unit . ' ' . $single_blog_inside_container_tablet_padding_right . $single_blog_inside_container_tablet_unit . ' ' . $single_blog_inside_container_tablet_padding_bottom . $single_blog_inside_container_tablet_unit . ' ' . $single_blog_inside_container_tablet_padding_left . $single_blog_inside_container_tablet_unit . '; } } @media screen and ( max-width: 576px ) { .single.single-post.responsive-site-style-content-boxed .site-content .hentry, .single.single-post.responsive-site-style-boxed .site-content .hentry{ - padding: ' . responsive_spacing_css( $single_blog_inside_container_mobile_padding_top, $single_blog_inside_container_mobile_padding_right, $single_blog_inside_container_mobile_padding_bottom, $single_blog_inside_container_mobile_padding_left ) . '; + padding: ' . $single_blog_inside_container_mobile_padding_top . $single_blog_inside_container_mobile_unit . ' ' . $single_blog_inside_container_mobile_padding_right . $single_blog_inside_container_mobile_unit . ' ' . $single_blog_inside_container_mobile_padding_bottom . $single_blog_inside_container_mobile_unit . ' ' . $single_blog_inside_container_mobile_padding_left . $single_blog_inside_container_mobile_unit . '; } } @@ -7694,7 +7760,6 @@ function responsive_build_responsive_margin_spacing_css( $margin ) { } } '; - // Mobile Menu Breakpoint. $disable_mobile_menu = get_theme_mod( 'responsive_disable_mobile_menu', 1 ); $mobile_menu_breakpoint = get_theme_mod( 'responsive_mobile_menu_breakpoint', 767 ); @@ -7815,11 +7880,546 @@ function responsive_build_responsive_margin_spacing_css( $margin ) { } "; + // Styling for Blog/Archive Border radius + $blog_border_radius_top_left = esc_html( get_theme_mod( 'responsive_blog_border_radius_top_left_radius', 8 ) ); + $blog_border_radius_top_right = esc_html( get_theme_mod( 'responsive_blog_border_radius_top_right_radius', 8 ) ); + $blog_border_radius_bottom_right = esc_html( get_theme_mod( 'responsive_blog_border_radius_bottom_right_radius', 8 ) ); + $blog_border_radius_bottom_left = esc_html( get_theme_mod( 'responsive_blog_border_radius_bottom_left_radius', 8 ) ); + + $blog_border_radius_tablet_top_left = esc_html( get_theme_mod( 'responsive_blog_border_radius_tablet_top_left_radius', 8 ) ); + $blog_border_radius_tablet_top_right = esc_html( get_theme_mod( 'responsive_blog_border_radius_tablet_top_right_radius', 8 ) ); + $blog_border_radius_tablet_bottom_right = esc_html( get_theme_mod( 'responsive_blog_border_radius_tablet_bottom_right_radius', 8 ) ); + $blog_border_radius_tablet_bottom_left = esc_html( get_theme_mod( 'responsive_blog_border_radius_tablet_bottom_left_radius', 8 ) ); + + $blog_border_radius_mobile_top_left = esc_html( get_theme_mod( 'responsive_blog_border_radius_mobile_top_left_radius', 8 ) ); + $blog_border_radius_mobile_top_right = esc_html( get_theme_mod( 'responsive_blog_border_radius_mobile_top_right_radius', 8 ) ); + $blog_border_radius_mobile_bottom_right = esc_html( get_theme_mod( 'responsive_blog_border_radius_mobile_bottom_right_radius', 8 ) ); + $blog_border_radius_mobile_bottom_left = esc_html( get_theme_mod( 'responsive_blog_border_radius_mobile_bottom_left_radius', 8 ) ); + + + $custom_css .= ".blog.responsive-site-style-content-boxed .site-content .hentry, .blog.responsive-site-style-boxed .site-content .hentry, .archive.responsive-site-style-content-boxed .site-content .hentry, .archive.responsive-site-style-boxed .site-content .hentry{ + + border-radius: {$blog_border_radius_top_left}px {$blog_border_radius_top_right}px {$blog_border_radius_bottom_right}px {$blog_border_radius_bottom_left}px; + } + @media screen and ( max-width: 992px ) { + .blog.responsive-site-style-content-boxed .site-content .hentry, .blog.responsive-site-style-boxed .site-content .hentry, .archive.responsive-site-style-content-boxed .site-content .hentry, .archive.responsive-site-style-boxed .site-content .hentry { + border-radius: {$blog_border_radius_tablet_top_left}px {$blog_border_radius_tablet_top_right}px {$blog_border_radius_tablet_bottom_right}px {$blog_border_radius_tablet_bottom_left}px; + } + } + @media screen and ( max-width: 576px ) { + .blog.responsive-site-style-content-boxed .site-content .hentry, .blog.responsive-site-style-boxed .site-content .hentry, .archive.responsive-site-style-content-boxed .site-content .hentry, .archive.responsive-site-style-boxed .site-content .hentry { + border-radius: {$blog_border_radius_mobile_top_left}px {$blog_border_radius_mobile_top_right}px {$blog_border_radius_mobile_bottom_right}px {$blog_border_radius_mobile_bottom_left}px; + } + }"; + + // Styling for Post Title Size, Meta font size and Taxonomy font size in Blog/Archive + $blog_post_title_size = esc_html( get_theme_mod( 'responsive_blog_post_title_size', 20 ) ); + $blog_meta_font_size = esc_html( get_theme_mod( 'responsive_blog_meta_font_size', 14 ) ); + $blog_taxonomy_font_size = esc_html( get_theme_mod( 'responsive_blog_taxonomy_font_size', 14 ) ); + + $custom_css .= " + .blog .hentry .entry-title, .archive .hentry .entry-title { + font-size: {$blog_post_title_size}px; + } + .blog .hentry .post-meta span, .blog .hentry .post-meta span.entry-date .posted time, .archive .hentry .post-meta span, .archive .hentry .post-meta span.entry-date .posted time { + font-size: {$blog_meta_font_size}px; + } + .blog .hentry .entry-category a, .archive .hentry .entry-category a { + font-size: {$blog_taxonomy_font_size}px; + }"; + + // Styling Blog Category Color. + $blog_category_color = esc_html( get_theme_mod( 'responsive_blog_category_color', Responsive\Core\get_responsive_customizer_defaults( 'responsive_blog_category_color' ) ) ); + $blog_category_hover_color = esc_html( get_theme_mod( 'responsive_blog_category_hover_color', Responsive\Core\get_responsive_customizer_defaults( 'blog_category_hover' ) ) ); + + $custom_css .= " + .search .entry-category a, + .archive .entry-category a, + .blog .entry-category a, + .responsive-blog-single-banner2 .entry-category a{ + color: {$blog_category_color}; + } + .search .entry-category a:hover, + .archive .entry-category a:hover, + .blog .entry-category a:hover, + .responsive-blog-single-banner2 .entry-category a:hover { + color: {$blog_category_hover_color}; + }"; + // Styling Blog Item Meta Color. + $blog_item_meta_color = esc_html( get_theme_mod( 'responsive_blog_item_meta_color', Responsive\Core\get_responsive_customizer_defaults( 'responsive_blog_item_meta_color' ) ) ); + $blog_item_meta_hover_color = esc_html( get_theme_mod( 'responsive_blog_item_meta_hover_color', Responsive\Core\get_responsive_customizer_defaults( 'blog_item_meta_hover' ) ) ); + + $custom_css .= " + .search .hentry .post-meta .entry-author a, + .archive .post-meta .entry-author a, + .blog .hentry .post-meta .entry-author a, + .search .hentry .post-meta .entry-date a, + .archive .post-meta .entry-date a, + .blog .hentry .post-meta .entry-date a, + .responsive-blog-single-banner2 .post-meta .entry-author a, + .responsive-blog-single-banner2 .post-meta .entry-date a{ + color: {$blog_item_meta_color}; + } + .search .hentry .post-meta .entry-author a:hover, + .archive .hentry .post-meta .entry-author a:hover, + .blog .hentry .post-meta .entry-author a:hover, + .search .hentry .post-meta .entry-date a:hover, + .archive .hentry .post-meta .entry-date a:hover, + .blog .hentry .post-meta .entry-date a:hover, + .responsive-blog-single-banner2 .post-meta .entry-author a, + .responsive-blog-single-banner2 .post-meta .entry-date a{ + color: {$blog_item_meta_hover_color}; + }"; + + // Styling Blog Site Background + + $blog_site_background_color = esc_html( + get_theme_mod( + 'responsive_blog_site_background_color', + Responsive\Core\get_responsive_customizer_defaults( 'responsive_blog_site_background_color' ) + ) + ); + + + if ( ! empty( $blog_site_background_color ) ) { + $custom_css .= " + body.blog, + body.archive, + body.search-results { + background-color: {$blog_site_background_color}; + }"; + } + // Styling Blog/Archive Content Background Color. + + $blog_content_background_color = esc_html( + get_theme_mod( + 'responsive_blog_content_background_color', + Responsive\Core\get_responsive_customizer_defaults( 'responsive_blog_content_background_color' ) + ) + ); + + if ( ! empty( $blog_content_background_color ) ) { + $custom_css .= " + .blog:not(.custom-home-page-active) .site-content .hentry, + .archive:not(.post-type-archive-product) .site-content .hentry , + .search-results .site-content article.hentry { + background-color: {$blog_content_background_color}; + }"; + } + // Styling for blog/archive date box. $responsive_date_box = esc_html( get_theme_mod( 'responsive_date_box_toggle' ) ); $date_box_background_color = esc_html( responsive_prepare_css_value( 'responsive_link_color' ) ); $date_box_calculated_color_value = required_font_color_value( $date_box_background_color ); + //Styling Page parity - Padding + $page_padding_top = esc_html( get_theme_mod( 'responsive_page_padding_top_padding', 30 ) ); + $page_padding_right = esc_html( get_theme_mod( 'responsive_page_padding_right_padding', 30 ) ); + $page_padding_bottom = esc_html( get_theme_mod( 'responsive_page_padding_bottom_padding', 30 ) ); + $page_padding_left = esc_html( get_theme_mod( 'responsive_page_padding_left_padding', 30 ) ); + $page_padding_unit = esc_html( get_theme_mod( 'responsive_page_padding_desktop_unit', 'px' ) ); + + $page_padding_tablet_top = esc_html( get_theme_mod( 'responsive_page_padding_tablet_top_padding', 30 ) ); + $page_padding_tablet_right = esc_html( get_theme_mod( 'responsive_page_padding_tablet_right_padding', 30 ) ); + $page_padding_tablet_bottom = esc_html( get_theme_mod( 'responsive_page_padding_tablet_bottom_padding', 30 ) ); + $page_padding_tablet_left = esc_html( get_theme_mod( 'responsive_page_padding_tablet_left_padding', 30 ) ); + $page_padding_tablet_unit = esc_html( get_theme_mod( 'responsive_page_padding_tablet_unit', 'px' ) ); + + $page_padding_mobile_top = esc_html( get_theme_mod( 'responsive_page_padding_mobile_top_padding', 30 ) ); + $page_padding_mobile_right = esc_html( get_theme_mod( 'responsive_page_padding_mobile_right_padding', 30 ) ); + $page_padding_mobile_bottom = esc_html( get_theme_mod( 'responsive_page_padding_mobile_bottom_padding', 30 ) ); + $page_padding_mobile_left = esc_html( get_theme_mod( 'responsive_page_padding_mobile_left_padding', 30 ) ); + $page_padding_mobile_unit = esc_html( get_theme_mod( 'responsive_page_padding_mobile_unit', 'px' ) ); + + $custom_css .= " + .page:not(.front-page):not(.woocommerce-cart):not(.woocommerce-checkout):not(.page-template-gutenberg-fullwidth) .site-content .hentry { + padding: {$page_padding_top}{$page_padding_unit} {$page_padding_right}{$page_padding_unit} {$page_padding_bottom}{$page_padding_unit} {$page_padding_left}{$page_padding_unit}; + } + @media screen and ( min-width: 577px ) and ( max-width: {$mobile_menu_breakpoint}px ) { + .page:not(.front-page):not(.woocommerce-cart):not(.woocommerce-checkout):not(.page-template-gutenberg-fullwidth) .site-content .hentry { + padding: {$page_padding_tablet_top}{$page_padding_tablet_unit} {$page_padding_tablet_right}{$page_padding_tablet_unit} {$page_padding_tablet_bottom}{$page_padding_tablet_unit} {$page_padding_tablet_left}{$page_padding_tablet_unit}; + } + } + @media screen and ( max-width: 576px ) { + .page:not(.front-page):not(.woocommerce-cart):not(.woocommerce-checkout):not(.page-template-gutenberg-fullwidth) .site-content .hentry { + padding: {$page_padding_mobile_top}{$page_padding_mobile_unit} {$page_padding_mobile_right}{$page_padding_mobile_unit} {$page_padding_mobile_bottom}{$page_padding_mobile_unit} {$page_padding_mobile_left}{$page_padding_mobile_unit}; + } + } + "; + + //Styling Page parity - Margin + $page_margin_top = esc_html( get_theme_mod( 'responsive_page_margin_top_padding', 0 ) ); + $page_margin_right = esc_html( get_theme_mod( 'responsive_page_margin_right_padding', 0 ) ); + $page_margin_bottom = esc_html( get_theme_mod( 'responsive_page_margin_bottom_padding', 0 ) ); + $page_margin_left = esc_html( get_theme_mod( 'responsive_page_margin_left_padding', 0 ) ); + $page_margin_unit = esc_html( get_theme_mod( 'responsive_page_margin_desktop_unit', 'px' ) ); + + $page_margin_tablet_top = esc_html( get_theme_mod( 'responsive_page_margin_tablet_top_padding', 0 ) ); + $page_margin_tablet_right = esc_html( get_theme_mod( 'responsive_page_margin_tablet_right_padding', 0 ) ); + $page_margin_tablet_bottom = esc_html( get_theme_mod( 'responsive_page_margin_tablet_bottom_padding', 0 ) ); + $page_margin_tablet_left = esc_html( get_theme_mod( 'responsive_page_margin_tablet_left_padding', 0 ) ); + $page_margin_tablet_unit = esc_html( get_theme_mod( 'responsive_page_margin_tablet_unit', 'px' ) ); + + $page_margin_mobile_top = esc_html( get_theme_mod( 'responsive_page_margin_mobile_top_padding', 0 ) ); + $page_margin_mobile_right = esc_html( get_theme_mod( 'responsive_page_margin_mobile_right_padding', 0 ) ); + $page_margin_mobile_bottom = esc_html( get_theme_mod( 'responsive_page_margin_mobile_bottom_padding', 0 ) ); + $page_margin_mobile_left = esc_html( get_theme_mod( 'responsive_page_margin_mobile_left_padding', 0 ) ); + $page_margin_mobile_unit = esc_html( get_theme_mod( 'responsive_page_margin_mobile_unit', 'px' ) ); + + $custom_css .= " + .page:not(.front-page):not(.woocommerce-cart):not(.woocommerce-checkout):not(.page-template-gutenberg-fullwidth) .site-content .hentry { + margin: {$page_margin_top}{$page_margin_unit} {$page_margin_right}{$page_margin_unit} {$page_margin_bottom}{$page_margin_unit} {$page_margin_left}{$page_margin_unit}; + } + @media screen and ( min-width: 577px ) and ( max-width: {$mobile_menu_breakpoint}px ) { + .page:not(.front-page):not(.woocommerce-cart):not(.woocommerce-checkout):not(.page-template-gutenberg-fullwidth) .site-content .hentry { + margin: {$page_margin_tablet_top}{$page_margin_tablet_unit} {$page_margin_tablet_right}{$page_margin_tablet_unit} {$page_margin_tablet_bottom}{$page_margin_tablet_unit} {$page_margin_tablet_left}{$page_margin_tablet_unit}; + } + } + @media screen and ( max-width: 576px ) { + .page:not(.front-page):not(.woocommerce-cart):not(.woocommerce-checkout):not(.page-template-gutenberg-fullwidth) .site-content .hentry { + margin: {$page_margin_mobile_top}{$page_margin_mobile_unit} {$page_margin_mobile_right}{$page_margin_mobile_unit} {$page_margin_mobile_bottom}{$page_margin_mobile_unit} {$page_margin_mobile_left}{$page_margin_mobile_unit}; + } + } + "; + + // Styling Vertical Content Spacing - Single Page + $page_content_top_bottom_spacing = esc_html( get_theme_mod( 'responsive_page_content_top_bottom_spacing', '10' ) ); + $page_content_vertical = esc_html( get_theme_mod( 'responsive_page_content_vertical', 'enable' ) ); + + $page_content_vertical_margin_top = '0'; + $page_content_vertical_margin_bottom = '0'; + + switch ( $page_content_vertical ) { + case 'enable': + $page_content_vertical_margin_top = $page_content_top_bottom_spacing . 'px'; + $page_content_vertical_margin_bottom = $page_content_top_bottom_spacing . 'px'; + break; + case 'top_only': + $page_content_vertical_margin_top = $page_content_top_bottom_spacing . 'px'; + $page_content_vertical_margin_bottom = '0'; + break; + case 'bottom_only': + $page_content_vertical_margin_top = '0'; + $page_content_vertical_margin_bottom = $page_content_top_bottom_spacing . 'px'; + break; + case 'disable': + default: + $page_content_vertical_margin_top = '0'; + $page_content_vertical_margin_bottom = '0'; + break; + } + + $custom_css .= " + .page:not(.front-page):not(.woocommerce-cart):not(.woocommerce-checkout):not(.page-template-gutenberg-fullwidth) #primary.content-area { + margin-top: {$page_content_vertical_margin_top}; + margin-bottom: {$page_content_vertical_margin_bottom}; + } + "; + // Styling Site background - Single Page + $page_site_background_color = esc_html( + get_theme_mod( + 'responsive_page_site_background_color', + Responsive\Core\get_responsive_customizer_defaults( 'responsive_page_site_background_color' ) + ) + ); + + if ( ! empty( $page_site_background_color ) ) { + $custom_css .= " + body.page { + background-color: {$page_site_background_color}; + }"; + } + // Styling Content Background Color - Single Page + + $page_content_background_color = esc_html( + get_theme_mod( + 'responsive_page_content_background_color', + Responsive\Core\get_responsive_customizer_defaults( 'responsive_page_content_background_color' ) + ) + ); + + if ( ! empty( $page_content_background_color ) ) { + $custom_css .= " + .page:not(.front-page):not(.woocommerce-cart):not(.woocommerce-checkout):not(.page-template-gutenberg-fullwidth) .site-content .hentry { + background-color: {$page_content_background_color}; + }"; + } + + + // Single Post - Author Box Style. + $post_author_box_style = get_theme_mod( 'responsive_post_author_box_style', 'normal' ); + + // Shared rules for both variants — hide the "About " prefix and bio text. + $custom_css .= " + #author-meta p { + display: none; + } + #author-meta .about-author { + font-size: 0; + } + #author-meta .about-author a { + font-size: 16px; + font-weight: 700; + text-decoration: none; + } + #author-meta img.avatar { + border-radius: 50%; + } + "; + + if ( 'center' === $post_author_box_style ) { + $custom_css .= " + #author-meta { + display: flex; + align-items: center; + justify-content: center; + flex-wrap: wrap; + } + #author-meta::before, + #author-meta::after { + content: ''; + height: 1px; + background: #d8dde3; + flex: 1 1 auto; + max-width: 220px; + } + #author-meta::before { + order: 1; + } + #author-meta img.avatar { + order: 2; + margin: 0 20px; + } + #author-meta::after { + order: 3; + } + #author-meta .about-author { + order: 4; + flex-basis: 100%; + text-align: center; + margin-top: 16px; + padding-bottom: 20px; + position: relative; + } + + "; + } else { + $custom_css .= " + #author-meta { + display: flex; + align-items: center; + gap: 12px; + } + "; + } + + // Single Post — Category Color. + $single_blog_category_color = esc_html( + get_theme_mod( + 'responsive_single_blog_category_color_color', + Responsive\Core\get_responsive_customizer_defaults( 'responsive_single_blog_category_color' ) + ) + ); + + $custom_css .= " + .single.single-post .entry-category a { + color: {$single_blog_category_color}; + }"; + + // Single Post — Category Font. + $single_blog_category_typography = get_theme_mod( 'single_blog_category_typography' ); + if ( $single_blog_category_typography && is_array( $single_blog_category_typography ) ) { + $custom_css .= ".single.single-post .entry-category a {"; + foreach ( $single_blog_category_typography as $prop => $val ) { + if ( $val ) { + $custom_css .= $prop . ': ' . $val . ';'; + } + } + $custom_css .= "}"; + } + + $single_blog_category_tablet_typography = get_theme_mod( 'single_blog_category_tablet_typography' ); + if ( $single_blog_category_tablet_typography && is_array( $single_blog_category_tablet_typography ) ) { + $custom_css .= "@media screen and ( max-width: 992px ) {"; + $custom_css .= ".single.single-post .entry-category a {"; + foreach ( $single_blog_category_tablet_typography as $prop => $val ) { + if ( $val ) { + $custom_css .= $prop . ': ' . $val . ';'; + } + } + $custom_css .= "}}"; + } + + $single_blog_category_mobile_typography = get_theme_mod( 'single_blog_category_mobile_typography' ); + if ( $single_blog_category_mobile_typography && is_array( $single_blog_category_mobile_typography ) ) { + $custom_css .= "@media screen and ( max-width: 576px ) {"; + $custom_css .= ".single.single-post .entry-category a {"; + foreach ( $single_blog_category_mobile_typography as $prop => $val ) { + if ( $val ) { + $custom_css .= $prop . ': ' . $val . ';'; + } + } + $custom_css .= "}}"; + } + + // Single Post — Meta Color. + $single_blog_item_meta_color = esc_html( + get_theme_mod( + 'responsive_single_blog_item_meta_color', + Responsive\Core\get_responsive_customizer_defaults( 'responsive_single_blog_item_meta_color' ) + ) + ); + $single_blog_item_meta_hover_color = esc_html( + get_theme_mod( + 'responsive_blog_item_meta_hover_color', + Responsive\Core\get_responsive_customizer_defaults( 'blog_item_meta_hover' ) + ) + ); + + $custom_css .= " + .single.single-post .post-meta .entry-author a, + .single.single-post .post-meta .entry-date a { + color: {$single_blog_item_meta_color}; + } + .single.single-post .post-meta .entry-author a:hover, + .single.single-post .post-meta .entry-date a:hover { + color: {$single_blog_item_meta_hover_color}; + }"; + + // Single Post — Breadcrumb Color. + $single_blog_breadcrumb_color = esc_html( + get_theme_mod( + 'responsive_single_blog_breadcrumb_color', + Responsive\Core\get_responsive_customizer_defaults( 'responsive_single_blog_breadcrumb_color' ) + ) + ); + + $custom_css .= " + .single.single-post .breadcrumbs, + .single.single-post .breadcrumbs a { + color: {$single_blog_breadcrumb_color}; + }"; + + // Single Post — Breadcrumb Font. + $single_blog_breadcrumb_typography = get_theme_mod( 'single_blog_breadcrumb_typography' ); + if ( $single_blog_breadcrumb_typography && is_array( $single_blog_breadcrumb_typography ) ) { + $custom_css .= ".single.single-post .breadcrumbs {"; + foreach ( $single_blog_breadcrumb_typography as $prop => $val ) { + if ( $val ) { + $custom_css .= $prop . ': ' . $val . ';'; + } + } + $custom_css .= "}"; + } + + $single_blog_breadcrumb_tablet_typography = get_theme_mod( 'single_blog_breadcrumb_tablet_typography' ); + if ( $single_blog_breadcrumb_tablet_typography && is_array( $single_blog_breadcrumb_tablet_typography ) ) { + $custom_css .= "@media screen and ( max-width: 992px ) {"; + $custom_css .= ".single.single-post .breadcrumbs {"; + foreach ( $single_blog_breadcrumb_tablet_typography as $prop => $val ) { + if ( $val ) { + $custom_css .= $prop . ': ' . $val . ';'; + } + } + $custom_css .= "}}"; + } + + $single_blog_breadcrumb_mobile_typography = get_theme_mod( 'single_blog_breadcrumb_mobile_typography' ); + if ( $single_blog_breadcrumb_mobile_typography && is_array( $single_blog_breadcrumb_mobile_typography ) ) { + $custom_css .= "@media screen and ( max-width: 576px ) {"; + $custom_css .= ".single.single-post .breadcrumbs {"; + foreach ( $single_blog_breadcrumb_mobile_typography as $prop => $val ) { + if ( $val ) { + $custom_css .= $prop . ': ' . $val . ';'; + } + } + $custom_css .= "}}"; + } + + // Single Post — Excerpt Color. + $single_blog_excerpt_color = esc_html( get_theme_mod( 'responsive_single_blog_excerpt_color_color', Responsive\Core\get_responsive_customizer_defaults( 'responsive_single_blog_excerpt_color' ) ) ); + $single_blog_excerpt_hover_color = esc_html( get_theme_mod( 'responsive_single_blog_excerpt_color_hover_color', Responsive\Core\get_responsive_customizer_defaults( 'single_blog_excerpt_color_hover' ) ) ); + + $custom_css .= " + .single:not(.single-product) .entry-content .entry-summary, + .single:not(.single-product) .entry-excerpt { + color: {$single_blog_excerpt_color}; + } + .single:not(.single-product) .entry-content .entry-summary a, + .single:not(.single-product) .entry-excerpt a { + color: {$single_blog_excerpt_color}; + } + .single:not(.single-product) .entry-content .entry-summary a:hover, + .single:not(.single-product) .entry-excerpt a:hover { + color: {$single_blog_excerpt_hover_color}; + }"; + + // Single Post — Excerpt Font. + $single_blog_excerpt_typography = get_theme_mod( 'single_blog_excerpt_typography' ); + if ( $single_blog_excerpt_typography && is_array( $single_blog_excerpt_typography ) ) { + $custom_css .= ".single.single-post .entry-content {"; + foreach ( $single_blog_excerpt_typography as $prop => $val ) { + if ( $val ) { + $custom_css .= $prop . ': ' . $val . ';'; + } + } + $custom_css .= "}"; + } + + $single_blog_excerpt_tablet_typography = get_theme_mod( 'single_blog_excerpt_tablet_typography' ); + if ( $single_blog_excerpt_tablet_typography && is_array( $single_blog_excerpt_tablet_typography ) ) { + $custom_css .= "@media screen and ( max-width: 992px ) {"; + $custom_css .= ".single.single-post .entry-content {"; + foreach ( $single_blog_excerpt_tablet_typography as $prop => $val ) { + if ( $val ) { + $custom_css .= $prop . ': ' . $val . ';'; + } + } + $custom_css .= "}}"; + } + + $single_blog_excerpt_mobile_typography = get_theme_mod( 'single_blog_excerpt_mobile_typography' ); + if ( $single_blog_excerpt_mobile_typography && is_array( $single_blog_excerpt_mobile_typography ) ) { + $custom_css .= "@media screen and ( max-width: 576px ) {"; + $custom_css .= ".single.single-post .entry-content {"; + foreach ( $single_blog_excerpt_mobile_typography as $prop => $val ) { + if ( $val ) { + $custom_css .= $prop . ': ' . $val . ';'; + } + } + $custom_css .= "}}"; + } + + // Single Post — Site Background Color. + $single_blog_site_background_color = esc_html( + get_theme_mod( + 'responsive_single_blog_site_background_color', + Responsive\Core\get_responsive_customizer_defaults( 'responsive_single_blog_site_background_color' ) + ) + ); + + if ( ! empty( $single_blog_site_background_color ) ) { + $custom_css .= " + body.single.single-post { + background-color: {$single_blog_site_background_color}; + }"; + } + + // Single Post — Content Background Color. + $single_blog_content_background_color = esc_html( + get_theme_mod( + 'responsive_single_blog_content_background_color', + Responsive\Core\get_responsive_customizer_defaults( 'responsive_single_blog_content_background_color' ) + ) + ); + + if ( ! empty( $single_blog_content_background_color ) ) { + $custom_css .= " + .single.single-post .site-content .hentry { + background-color: {$single_blog_content_background_color}; + }"; + } + /* Taking body font size value for all views */ $body_font_val_desktop = ( isset( get_theme_mod( 'body_typography' )['font-size'] ) && '' !== get_theme_mod( 'body_typography' )['font-size'] ) ? get_theme_mod( 'body_typography' )['font-size'] : '16px'; $body_font_val_desktop = typography_unit_conversion($body_font_val_desktop, 16); @@ -8855,7 +9455,564 @@ function responsive_build_responsive_margin_spacing_css( $margin ) { } }"; } + + $format_spacing = function( $val, $unit, $is_margin = false ) { + $t = isset( $val['top'] ) ? $val['top'] : ''; + $r = isset( $val['right'] ) ? $val['right'] : ''; + $b = isset( $val['bottom'] ) ? $val['bottom'] : ''; + $l = isset( $val['left'] ) ? $val['left'] : ''; + + if ( $is_margin && $t === '' && $r === '' && $b === '' && $l === '' ) { + return '0 auto'; + } + + $top = ( '' !== $t ) ? $t . $unit : '0' . $unit; + $right = ( '' !== $r ) ? $r . $unit : '0' . $unit; + $bottom = ( '' !== $b ) ? $b . $unit : '0' . $unit; + $left = ( '' !== $l ) ? $l . $unit : '0' . $unit; + return "{$top} {$right} {$bottom} {$left}"; + }; + + // Single Blog - Post Title + // check if enabled + $single_blog_post_title = get_theme_mod( 'responsive_single_blog_post_title', Responsive\Core\get_responsive_customizer_defaults( 'responsive_single_blog_post_title' ) ); + if( !$single_blog_post_title ) { + $custom_css .= " + .responsive-blog-single-banner2, .single-post .entry-header, .single .responsive-single-post-featured-section { + display: none; + } + "; + + + } + else if( $single_blog_post_title ) { + + // title color + $single_blog_post_title_color = responsive_prepare_css_value( 'responsive_single_blog_post_title_color', Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_title_color' ) ); + // text color + $single_blog_post_title_text_color = responsive_prepare_css_value( 'responsive_single_blog_post_text_color', Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_text_color' ) ); + // Link Color + $single_blog_post_title_link_color = responsive_prepare_css_value( 'responsive_single_blog_post_link_color', Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_link_color' ) ); + // Link Hover Color + $single_blog_post_title_link_hover_color = responsive_prepare_css_value( 'responsive_single_blog_post_link_hover_color', Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_link_hover_color' ) ); + + $custom_css .= " + .responsive-blog-single-banner2 .container *, .single-post .entry-header * { + color: {$single_blog_post_title_text_color}; + } + "; + $custom_css .= " + .single-post .entry-title { + color: {$single_blog_post_title_color}; + } + "; + $custom_css .= " + .single-post .entry-header a, .single-post .entry-header a *, .responsive-blog-single-banner2 .container a, .responsive-blog-single-banner2 .container a * { + color: {$single_blog_post_title_link_color}; + } + "; + $custom_css .= " + .single-post .entry-header a:hover, .single-post .entry-header a:hover *, .responsive-blog-single-banner2 .container a:hover, .responsive-blog-single-banner2 .container a:hover * { + color: {$single_blog_post_title_link_hover_color}; + } + "; + // inner elements spacing + $single_blog_post_title_inner_elements_spacing = get_theme_mod( 'responsive_single_blog_post_title_inner_elements_spacing', Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_title_inner_elements_spacing' )); + $custom_css .= " + .responsive-blog-single-banner2 .container > *:not(:last-child), .single-post .entry-header > *:not(:last-child) { + margin-bottom: {$single_blog_post_title_inner_elements_spacing}px; + } + "; + // check banner type + $single_blog_post_title_banner = get_theme_mod( 'responsive_single_blog_post_title_layout', Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_title_layout' ) ); + + if( $single_blog_post_title_banner === 'post_title_layout2' ) + { + $custom_css .= " + .responsive-blog-single-banner2 .container { + width: 100%; + } + "; + + // check banner min height + $single_blog_post_title_layout2_banner_height = get_theme_mod( 'responsive_single_blog_banner_min_height', 0 ); + $single_blog_post_title_layout2_banner_height_tablet = get_theme_mod( 'responsive_single_blog_banner_min_height_tablet', 0 ); + $single_blog_post_title_layout2_banner_height_mobile = get_theme_mod( 'responsive_single_blog_banner_min_height_mobile', 0 ); + + // check banner background color + $single_blog_banner_background_color = get_theme_mod( 'responsive_single_blog_banner_background_color', '#ffffff' ); + $single_blog_banner_tablet_background_color = get_theme_mod( 'responsive_single_blog_banner_background_color_tablet', '#ffffff' ); + $single_blog_banner_mobile_background_color = get_theme_mod( 'responsive_single_blog_banner_background_color_mobile', '#ffffff' ); + + // check vertical alignment + $single_blog_post_title_layout2_vertical_alignment = get_theme_mod( 'responsive_single_blog_post_title_vertical_alignment', 'flex-start'); + + // check banner padding and margin + $single_blog_banner_padding = get_responsive_spacing_values('responsive_single_blog_banner_padding', 0, 0, 0, 0); + $single_blog_banner_padding_desktop_unit = get_theme_mod('responsive_single_blog_banner_padding_desktop_unit', 'px'); + $single_blog_banner_padding_tablet_unit = get_theme_mod('responsive_single_blog_banner_padding_tablet_unit', 'px'); + $single_blog_banner_padding_mobile_unit = get_theme_mod('responsive_single_blog_banner_padding_mobile_unit', 'px'); + + $single_blog_banner_margin = [ + 'desktop' => [ + 'top' => get_theme_mod( 'responsive_single_blog_banner_margin_top_padding', '' ), + 'right' => get_theme_mod( 'responsive_single_blog_banner_margin_right_padding', '' ), + 'bottom' => get_theme_mod( 'responsive_single_blog_banner_margin_bottom_padding', '' ), + 'left' => get_theme_mod( 'responsive_single_blog_banner_margin_left_padding', '' ), + ], + 'tablet' => [ + 'top' => get_theme_mod( 'responsive_single_blog_banner_margin_tablet_top_padding', '' ), + 'right' => get_theme_mod( 'responsive_single_blog_banner_margin_tablet_right_padding', '' ), + 'bottom' => get_theme_mod( 'responsive_single_blog_banner_margin_tablet_bottom_padding', '' ), + 'left' => get_theme_mod( 'responsive_single_blog_banner_margin_tablet_left_padding', '' ), + ], + 'mobile' => [ + 'top' => get_theme_mod( 'responsive_single_blog_banner_margin_mobile_top_padding', '' ), + 'right' => get_theme_mod( 'responsive_single_blog_banner_margin_mobile_right_padding', '' ), + 'bottom' => get_theme_mod( 'responsive_single_blog_banner_margin_mobile_bottom_padding', '' ), + 'left' => get_theme_mod( 'responsive_single_blog_banner_margin_mobile_left_padding', '' ), + ], + ]; + + $single_blog_banner_margin_desktop_unit = get_theme_mod('responsive_single_blog_banner_margin_desktop_unit', 'px'); + $single_blog_banner_margin_tablet_unit = get_theme_mod('responsive_single_blog_banner_margin_tablet_unit', 'px'); + $single_blog_banner_margin_mobile_unit = get_theme_mod('responsive_single_blog_banner_margin_mobile_unit', 'px'); + + // check container width + $single_blog_post_title_container_width = get_theme_mod( 'responsive_single_blog_banner_container_width', 'full_width' ); + + if( $single_blog_post_title_container_width === 'custom' ) + { + // checking custom width + $single_blog_post_title_custom_container_width = get_theme_mod( 'responsive_single_blog_banner_custom_width', 1200 ); + $custom_css .= " + .responsive-blog-single-banner2 { + max-width: {$single_blog_post_title_custom_container_width}px; + width: 100%; + } + "; + } + + $custom_css .= " + .responsive-blog-single-banner2 { + display: flex; + flex-direction: column; + justify-content: {$single_blog_post_title_layout2_vertical_alignment}; + min-height: {$single_blog_post_title_layout2_banner_height}px; + background-color: {$single_blog_banner_background_color}; + padding: " . $format_spacing( $single_blog_banner_padding['desktop'], $single_blog_banner_padding_desktop_unit ) . "; + " . responsive_format_margin_css_with_container_width( $single_blog_banner_margin['desktop'], $single_blog_banner_margin_desktop_unit, $single_blog_post_title_container_width ) . " + } + .responsive-blog-single-banner2 .container .thumbnail { + text-align: " . get_theme_mod( 'responsive_single_blog_featured_image_alignment', 'left' ) . "; + } + @media screen and ( max-width: 992px ) { + .responsive-blog-single-banner2 { + min-height: {$single_blog_post_title_layout2_banner_height_tablet}px; + background-color: {$single_blog_banner_tablet_background_color}; + padding: " . $format_spacing( $single_blog_banner_padding['tablet'], $single_blog_banner_padding_tablet_unit ) . "; + " . responsive_format_margin_css_with_container_width( $single_blog_banner_margin['tablet'], $single_blog_banner_margin_tablet_unit, $single_blog_post_title_container_width ) . " + } + } + @media screen and ( max-width: 576px ) { + .responsive-blog-single-banner2 { + min-height: {$single_blog_post_title_layout2_banner_height_mobile}px; + background-color: {$single_blog_banner_mobile_background_color}; + padding: " . $format_spacing( $single_blog_banner_padding['mobile'], $single_blog_banner_padding_mobile_unit ) . "; + " . responsive_format_margin_css_with_container_width( $single_blog_banner_margin['mobile'], $single_blog_banner_margin_mobile_unit, $single_blog_post_title_container_width ) . " + } + } + "; + + + } + + } + + // Blog/Archive - Title + // check if enabled + $check_blog_title = get_theme_mod( 'responsive_blog_title_area', Responsive\Core\get_responsive_customizer_defaults( 'responsive_single_blog_post_title' )); + if( !$check_blog_title ) { + $custom_css .= " + .blog .responsive-archive-entry-banner, .archive .responsive-archive-entry-banner, .archive .site-content-header { + display: none; + } + "; + } + else if( $check_blog_title ) + { + // check banner type + $blog_title_banner = get_theme_mod( 'responsive_blog_title_layout', Responsive\Core\get_responsive_customizer_defaults( 'blog_title_layout' ) ); + + // title color + $blog_post_title_color = responsive_prepare_css_value( 'responsive_blog_post_title_color', Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_title_color' ) ); + // text color + $blog_post_title_text_color = responsive_prepare_css_value( 'responsive_blog_post_text_color', Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_text_color' ) ); + // Link Color + $blog_post_title_link_color = responsive_prepare_css_value( 'responsive_blog_post_link_color', Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_link_color' ) ); + // Link Hover Color + $blog_post_title_link_hover_color = responsive_prepare_css_value( 'responsive_blog_post_link_hover_color', Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_link_hover_color' ) ); + + $custom_css .= " + .responsive-archive-entry-banner .container *, .archive:not(.woocommerce) .site-content-header *{ + color: {$blog_post_title_text_color}; + } + .responsive-archive-entry-banner .page-title, .category .site-content-header .page-header, .author .site-content-header .page-header { + margin-top: 0; + } + "; + + $custom_css .= " + .responsive-archive-entry-banner .page-title, .responsive-archive-entry-banner .page-title *, .archive:not(.woocommerce) .site-content-header .page-title, .archive:not(.woocommerce) .site-content-header .page-title * { + color: {$blog_post_title_color}; + } + "; + + $custom_css .= " + .responsive-archive-entry-banner .container a, .responsive-archive-entry-banner .container a *, .archive:not(.woocommerce) .site-content-header a, .archive:not(.woocommerce) .site-content-header a *{ + color: {$blog_post_title_link_color}; + } + "; + $custom_css .= " + .responsive-archive-entry-banner .container a:hover *, .responsive-archive-entry-banner .container a:hover, .archive:not(.woocommerce) .site-content-header a:hover, .archive:not(.woocommerce) .site-content-header a:hover * { + color: {$blog_post_title_link_hover_color}; + } + "; + + // check banner padding and margin + $blog_banner_padding = get_responsive_spacing_values('responsive_blog_banner_padding', 30, 30, 30, 30); + $blog_banner_padding_desktop_unit = get_theme_mod('responsive_blog_banner_padding_desktop_unit', 'px'); + $blog_banner_padding_tablet_unit = get_theme_mod('responsive_blog_banner_padding_tablet_unit', 'px'); + $blog_banner_padding_mobile_unit = get_theme_mod('responsive_blog_banner_padding_mobile_unit', 'px'); + + $blog_banner_margin = get_responsive_spacing_values('responsive_blog_banner_margin', '', '', 24, ''); + $blog_banner_margin_desktop_unit = get_theme_mod('responsive_blog_banner_margin_desktop_unit', 'px'); + $blog_banner_margin_tablet_unit = get_theme_mod('responsive_blog_banner_margin_tablet_unit', 'px'); + $blog_banner_margin_mobile_unit = get_theme_mod('responsive_blog_banner_margin_mobile_unit', 'px'); + + $custom_css .= " + .responsive-archive-entry-banner, .archive:not(.woocommerce) .site-content-header { + padding: " . $format_spacing( $blog_banner_padding['desktop'], $blog_banner_padding_desktop_unit ) . "; + margin: " . $format_spacing( $blog_banner_margin['desktop'], $blog_banner_margin_desktop_unit, true ) . "; + } + @media screen and ( max-width: 992px ) { + .responsive-archive-entry-banner, .archive:not(.woocommerce) .site-content-header { + padding: " . $format_spacing( $blog_banner_padding['tablet'], $blog_banner_padding_tablet_unit ) . "; + margin: " . $format_spacing( $blog_banner_margin['tablet'], $blog_banner_margin_tablet_unit, true ) . "; + } + } + @media screen and ( max-width: 576px ) { + .responsive-archive-entry-banner, .archive:not(.woocommerce) .site-content-header { + padding: " . $format_spacing( $blog_banner_padding['mobile'], $blog_banner_padding_mobile_unit ) . "; + margin: " . $format_spacing( $blog_banner_margin['mobile'], $blog_banner_margin_mobile_unit, true ) . "; + } + } + "; + + // inner elements spacing + $blog_post_title_inner_elements_spacing = get_theme_mod( 'responsive_blog_post_title_inner_elements_spacing', Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_title_inner_elements_spacing' )); + $custom_css .= " + .responsive-archive-entry-banner .container > *:not(:last-child), .archive:not(.woocommerce) .site-content-header > *:not(:last-child){ + margin-bottom: {$blog_post_title_inner_elements_spacing}px; + } + "; + + // check banner background color + $blog_banner_background_color = get_theme_mod( 'responsive_blog_banner_background_color', '#ffffff' ); + $blog_banner_tablet_background_color = get_theme_mod( 'responsive_blog_banner_background_color_tablet', '#ffffff' ); + $blog_banner_mobile_background_color = get_theme_mod( 'responsive_blog_banner_background_color_mobile', '#ffffff' ); + + // check horizontal alignment + $blog_post_title_horizontal_alignment = get_theme_mod( 'responsive_blog_post_title_horizontal_alignment', 'center'); + $blog_post_title_horizontal_alignment_tablet = get_theme_mod( 'responsive_blog_post_title_horizontal_alignment_tablet', 'center'); + $blog_post_title_horizontal_alignment_mobile = get_theme_mod( 'responsive_blog_post_title_horizontal_alignment_mobile', 'center'); + + $map_text_align = array( + 'flex-start' => 'left', + 'center' => 'center', + 'flex-end' => 'right', + ); + $text_align_desktop = isset( $map_text_align[ $blog_post_title_horizontal_alignment ] ) ? $map_text_align[ $blog_post_title_horizontal_alignment ] : 'center'; + $text_align_tablet = isset( $map_text_align[ $blog_post_title_horizontal_alignment_tablet ] ) ? $map_text_align[ $blog_post_title_horizontal_alignment_tablet ] : 'center'; + $text_align_mobile = isset( $map_text_align[ $blog_post_title_horizontal_alignment_mobile ] ) ? $map_text_align[ $blog_post_title_horizontal_alignment_mobile ] : 'center'; + + $custom_css .= " + .responsive-archive-entry-banner, .archive:not(.woocommerce) .site-content-header { + display: flex; + flex-direction: column; + align-items: {$blog_post_title_horizontal_alignment}; + text-align: {$text_align_desktop}; + background-color: {$blog_banner_background_color}; + } + @media screen and ( max-width: 992px ) { + .responsive-archive-entry-banner, .archive:not(.woocommerce) .site-content-header { + background-color: {$blog_banner_tablet_background_color}; + align-items: {$blog_post_title_horizontal_alignment_tablet}; + text-align: {$text_align_tablet}; + } + } + @media screen and ( max-width: 576px ) { + .responsive-archive-entry-banner, .archive:not(.woocommerce) .site-content-header { + background-color: {$blog_banner_mobile_background_color}; + align-items: {$blog_post_title_horizontal_alignment_mobile}; + text-align: {$text_align_mobile}; + } + } + "; + + if( $blog_title_banner === 'post_title_layout2' ) + { + $custom_css .= " + .responsive-archive-entry-banner .container { + width: 100%; + }"; + + // checking post title is enabled on blog page + $blog_page_title_toggle = get_theme_mod( 'responsive_blog_post_title_toggle', 0 ); + if( $blog_page_title_toggle === 0 ) + { + $custom_css .= " + .blog .responsive-archive-entry-banner { + display: none; + } + "; + } + + // check banner min height + $blog_title_layout2_banner_height = get_theme_mod( 'responsive_blog_banner_min_height', 0 ); + $blog_title_layout2_banner_height_tablet = get_theme_mod( 'responsive_blog_banner_min_height_tablet', 0 ); + $blog_title_layout2_banner_height_mobile = get_theme_mod( 'responsive_blog_banner_min_height_mobile', 0 ); + + + // check vertical alignment + $blog_post_title_layout2_vertical_alignment = get_theme_mod( 'responsive_blog_post_title_vertical_alignment', 'flex-start'); + + // check container width + $blog_post_title_container_width = get_theme_mod( 'responsive_blog_banner_container_width', 'full_width' ); + + if( $blog_post_title_container_width === 'custom' ) + { + // checking custom width + $blog_post_title_custom_container_width = get_theme_mod( 'responsive_blog_banner_custom_width', 1200 ); + $custom_css .= " + .responsive-archive-entry-banner { + max-width: {$blog_post_title_custom_container_width}px; + } + "; + } + + $custom_css .= " + .responsive-archive-entry-banner, .archive:not(.woocommerce) .site-content-header { + min-height: {$blog_title_layout2_banner_height}px; + justify-content: {$blog_post_title_layout2_vertical_alignment}; + padding: " . $format_spacing( $blog_banner_padding['desktop'], $blog_banner_padding_desktop_unit ) . "; + " . responsive_format_margin_css_with_container_width( $blog_banner_margin['desktop'], $blog_banner_margin_desktop_unit, $blog_post_title_container_width ) . " + } + @media screen and ( max-width: 992px ) { + .responsive-archive-entry-banner, .archive:not(.woocommerce) .site-content-header { + min-height: {$blog_title_layout2_banner_height_tablet}px; + padding: " . $format_spacing( $blog_banner_padding['tablet'], $blog_banner_padding_tablet_unit ) . "; + " . responsive_format_margin_css_with_container_width( $blog_banner_margin['tablet'], $blog_banner_margin_tablet_unit, $blog_post_title_container_width ) . " + } + } + @media screen and ( max-width: 576px ) { + .responsive-archive-entry-banner, .archive:not(.woocommerce) .site-content-header { + min-height: {$blog_title_layout2_banner_height_mobile}px; + padding: " . $format_spacing( $blog_banner_padding['mobile'], $blog_banner_padding_mobile_unit ) . "; + " . responsive_format_margin_css_with_container_width( $blog_banner_margin['mobile'], $blog_banner_margin_mobile_unit, $blog_post_title_container_width ) . " + } + } + "; + } + } + // Single Page - Title Area + // check if enabled + $check_page_title = get_theme_mod( 'responsive_page_title_area', Responsive\Core\get_responsive_customizer_defaults( 'responsive_single_blog_post_title' ) ); + if( !$check_page_title ) + { + $custom_css .= " + .responsive-single-entry-banner, .page .entry-header, .page .responsive-single-post-featured-section { + display: none; + } + "; + } + if( $check_page_title ) { + + // title color + $page_title_color = responsive_prepare_css_value( 'responsive_page_title_area_title_color', Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_title_color' ) ); + // text color + $page_title_text_color = responsive_prepare_css_value( 'responsive_page_title_area_text_color', Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_text_color' ) ); + // Link Color + $page_title_link_color = responsive_prepare_css_value( 'responsive_page_title_area_link_color', Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_link_color' ) ); + // Link Hover Color + $page_title_link_hover_color = responsive_prepare_css_value( 'responsive_page_title_area_link_hover_color', Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_link_hover_color' ) ); + $custom_css .= " + .responsive-single-entry-banner .container .entry-title, .page .entry-header .entry-title { + color: {$page_title_color}; + } + "; + $custom_css .= " + .responsive-single-entry-banner .container *:not(.entry-title, .entry-title *):not(a, a *), .page #page .entry-header *:not(.entry-title, .entry-title *):not(a, a *) { + color: {$page_title_text_color}; + } + "; + $custom_css .= " + .page .entry-header a, .page .entry-header a *, .responsive-single-entry-banner .container a, .responsive-single-entry-banner .container a * { + color: {$page_title_link_color}; + } + "; + $custom_css .= " + .page .entry-header a:hover, .page .entry-header a:hover *, .responsive-single-entry-banner .container a:hover, .responsive-single-entry-banner .container a:hover * { + color: {$page_title_link_hover_color}; + } + "; + // inner elements spacing + $page_title_inner_elements_spacing = get_theme_mod( 'responsive_page_title_inner_elements_spacing', Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_title_inner_elements_spacing' )); + $custom_css .= " + .responsive-single-entry-banner .container > *:not(:last-child), .page .entry-header > *:not(:last-child) { + margin-bottom: {$page_title_inner_elements_spacing}px; + } + "; + + // check horizontal alignment + $page_title_horizontal_alignment = get_theme_mod( 'responsive_page_title_horizontal_alignment', 'left'); + $page_title_horizontal_alignment_tablet = get_theme_mod( 'responsive_page_title_horizontal_alignment_tablet', 'left'); + $page_title_horizontal_alignment_mobile = get_theme_mod( 'responsive_page_title_horizontal_alignment_mobile', 'left'); + + $map_text_align = array( + 'left' => 'flex-start', + 'center' => 'center', + 'right' => 'flex-end', + ); + $text_align_desktop = isset( $map_text_align[ $page_title_horizontal_alignment ] ) ? $map_text_align[ $page_title_horizontal_alignment ] : 'center'; + $text_align_tablet = isset( $map_text_align[ $page_title_horizontal_alignment_tablet ] ) ? $map_text_align[ $page_title_horizontal_alignment_tablet ] : 'center'; + $text_align_mobile = isset( $map_text_align[ $page_title_horizontal_alignment_mobile ] ) ? $map_text_align[ $page_title_horizontal_alignment_mobile ] : 'center'; + + $custom_css .= " + .responsive-single-entry-banner, .page .entry-header { + display: flex; + flex-direction: column; + align-items: {$text_align_desktop}; + text-align: {$page_title_horizontal_alignment}; + } + @media screen and ( max-width: 992px ) { + .responsive-single-entry-banner, .page .entry-header { + align-items: {$text_align_tablet}; + text-align: {$page_title_horizontal_alignment_tablet}; + } + } + @media screen and ( max-width: 576px ) { + .responsive-single-entry-banner, .page .entry-header { + align-items: {$text_align_mobile}; + text-align: {$page_title_horizontal_alignment_mobile}; + } + } + "; + + // check banner type + $page_title_banner = get_theme_mod( 'responsive_page_title_layout', Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_title_layout' ) ); + + if( $page_title_banner === 'post_title_layout2' ) + { + $custom_css .= " + .responsive-single-entry-banner .container { + width: 100%; + } + "; + + // check banner min height + $page_title_layout2_banner_height = get_theme_mod( 'responsive_page_title_banner_min_height', 0 ); + $page_title_layout2_banner_height_tablet = get_theme_mod( 'responsive_page_title_banner_min_height_tablet', 0 ); + $page_title_layout2_banner_height_mobile = get_theme_mod( 'responsive_page_title_banner_min_height_mobile', 0 ); + + // check banner background color + $page_banner_background_color = get_theme_mod( 'responsive_page_title_banner_background_color', '#ffffff' ); + $page_banner_tablet_background_color = get_theme_mod( 'responsive_page_title_banner_background_color_tablet', '#ffffff' ); + $page_banner_mobile_background_color = get_theme_mod( 'responsive_page_title_banner_background_color_mobile', '#ffffff' ); + + // check vertical alignment + $page_title_layout2_vertical_alignment = get_theme_mod( 'responsive_page_title_vertical_alignment', 'flex-start'); + + // check banner padding and margin + $page_banner_padding = get_responsive_spacing_values('responsive_page_title_banner_padding', 0, 0, 0, 0); + $page_banner_padding_desktop_unit = get_theme_mod('responsive_page_title_banner_padding_desktop_unit', 'px'); + $page_banner_padding_tablet_unit = get_theme_mod('responsive_page_title_banner_padding_tablet_unit', 'px'); + $page_banner_padding_mobile_unit = get_theme_mod('responsive_page_title_banner_padding_mobile_unit', 'px'); + + $page_banner_margin = [ + 'desktop' => [ + 'top' => get_theme_mod( 'responsive_page_title_banner_margin_top_padding', '' ), + 'right' => get_theme_mod( 'responsive_page_title_banner_margin_right_padding', '' ), + 'bottom' => get_theme_mod( 'responsive_page_title_banner_margin_bottom_padding', '' ), + 'left' => get_theme_mod( 'responsive_page_title_banner_margin_left_padding', '' ), + ], + 'tablet' => [ + 'top' => get_theme_mod( 'responsive_page_title_banner_margin_tablet_top_padding', '' ), + 'right' => get_theme_mod( 'responsive_page_title_banner_margin_tablet_right_padding', '' ), + 'bottom' => get_theme_mod( 'responsive_page_title_banner_margin_tablet_bottom_padding', '' ), + 'left' => get_theme_mod( 'responsive_page_title_banner_margin_tablet_left_padding', '' ), + ], + 'mobile' => [ + 'top' => get_theme_mod( 'responsive_page_title_banner_margin_mobile_top_padding', '' ), + 'right' => get_theme_mod( 'responsive_page_title_banner_margin_mobile_right_padding', '' ), + 'bottom' => get_theme_mod( 'responsive_page_title_banner_margin_mobile_bottom_padding', '' ), + 'left' => get_theme_mod( 'responsive_page_title_banner_margin_mobile_left_padding', '' ), + ], + ]; + + $page_banner_margin_desktop_unit = get_theme_mod('responsive_page_title_banner_margin_desktop_unit', 'px'); + $page_banner_margin_tablet_unit = get_theme_mod('responsive_page_title_banner_margin_tablet_unit', 'px'); + $page_banner_margin_mobile_unit = get_theme_mod('responsive_page_title_banner_margin_mobile_unit', 'px'); + + // check container width + $page_title_container_width = get_theme_mod( 'responsive_page_title_container_width', 'full_width' ); + + if( $page_title_container_width === 'custom' ) + { + // checking custom width + $page_title_custom_container_width = get_theme_mod( 'responsive_page_title_custom_width', 1200 ); + $custom_css .= " + .responsive-single-entry-banner { + max-width: {$page_title_custom_container_width}px; + width: 100%; + } + "; + } + + $custom_css .= " + .responsive-single-entry-banner { + display: flex; + flex-direction: column; + justify-content: {$page_title_layout2_vertical_alignment}; + min-height: {$page_title_layout2_banner_height}px; + background-color: {$page_banner_background_color}; + padding: " . $format_spacing( $page_banner_padding['desktop'], $page_banner_padding_desktop_unit ) . "; + " . responsive_format_margin_css_with_container_width( $page_banner_margin['desktop'], $page_banner_margin_desktop_unit, $page_title_container_width ) . " + } + @media screen and ( max-width: 992px ) { + .responsive-single-entry-banner { + min-height: {$page_title_layout2_banner_height_tablet}px; + background-color: {$page_banner_tablet_background_color}; + padding: " . $format_spacing( $page_banner_padding['tablet'], $page_banner_padding_tablet_unit ) . "; + " . responsive_format_margin_css_with_container_width( $page_banner_margin['tablet'], $page_banner_margin_tablet_unit, $page_title_container_width ) . " + } + } + @media screen and ( max-width: 576px ) { + .responsive-single-entry-banner{ + min-height: {$page_title_layout2_banner_height_mobile}px; + background-color: {$page_banner_mobile_background_color}; + padding: " . $format_spacing( $page_banner_padding['mobile'], $page_banner_padding_mobile_unit ) . "; + " . responsive_format_margin_css_with_container_width( $page_banner_margin['mobile'], $page_banner_margin_mobile_unit, $page_title_container_width ) . " + } + } + "; + + + } + + } + wp_add_inline_style( 'responsive-style', apply_filters( 'responsive_head_css', responsive_minimize_css( $custom_css ) ) ); wp_add_inline_style('responsive-style', responsive_minimize_css( $font_preset_css)); @@ -8941,7 +10098,11 @@ function responsive_build_responsive_margin_spacing_css( $margin ) { $mobile_breakpoint = 544; $shop_sidebar_setting_for_width = get_theme_mod( 'responsive_shop_sidebar_position', 'global' ); - if( $shop_sidebar_position === 'no' ) + if ( Responsive\Core\responsive_is_narrow_container_layout() ) { + $shop_sidebar_width = 0; + $shop_sidebar_position = 'no'; + } + else if( $shop_sidebar_position === 'no' ) { $shop_sidebar_width = 0; } @@ -9059,7 +10220,11 @@ function responsive_build_responsive_margin_spacing_css( $margin ) { $single_product_setting = get_theme_mod( 'responsive_single_product_sidebar_position', 'global' ); $single_product_sidebar_position = esc_html( ( $single_product_setting === 'global' || $single_product_setting === 'default' ) ? $global_sidebar : $single_product_setting ); - if( $single_product_setting === 'global' || $single_product_setting === 'default' ) + if ( Responsive\Core\responsive_is_narrow_container_layout() ) { + $single_product_sidebar_width = 0; + $single_product_sidebar_position = 'no'; + } + else if( $single_product_setting === 'global' || $single_product_setting === 'default' ) { $single_product_sidebar_width = esc_html( get_theme_mod('responsive_default_sidebar_width', 30) ); } @@ -9334,7 +10499,11 @@ function responsive_build_responsive_margin_spacing_css( $margin ) { $floatingb_addtocart_font_color = esc_html( get_theme_mod( 'responsive_floatingb_addtocart_font_color', '#ffffff' ) ); $floatingb_addtocart_fonthover_color = esc_html( get_theme_mod( 'responsive_floatingb_addtocart_fonthover_color', '#f1f1f1' ) ); $floatingb_width = esc_html( get_theme_mod( 'responsive_width', 'contained' ) ); - $floatingb_container_width = esc_html( get_theme_mod( 'responsive_container_width', 1140 ) ); + if ( 'narrow' === $floatingb_width ) { + $floatingb_container_width = esc_html( get_theme_mod( 'responsive_narrow_container_width', Responsive\Core\get_responsive_customizer_defaults( 'responsive_narrow_container_width' ) ) ); + } else { + $floatingb_container_width = esc_html( get_theme_mod( 'responsive_container_width', Responsive\Core\get_responsive_customizer_defaults( 'responsive_container_width' ) ) ); + } if ( is_admin_bar_showing() ) { $woocommerce_custom_css .= ' @@ -9346,7 +10515,7 @@ function responsive_build_responsive_margin_spacing_css( $margin ) { '; } - if ( 'contained' === $floatingb_width && $floatingb_container_width ) { + if ( ( 'contained' === $floatingb_width || 'narrow' === $floatingb_width ) && $floatingb_container_width ) { $woocommerce_custom_css .= " .floatingb-container { width: {$floatingb_container_width}px; diff --git a/core/includes/customizer/customizer.php b/core/includes/customizer/customizer.php index ec54f0563..5db35ca74 100644 --- a/core/includes/customizer/customizer.php +++ b/core/includes/customizer/customizer.php @@ -300,6 +300,7 @@ function responsive_custom_controls( $wp_customize ) { require_once $dir . 'tinymce/class-responsive-customizer-tinymce-control.php'; require_once $dir . 'html/class-responsive-customizer-html-control.php'; require_once $dir . 'dimensions/class-responsive-customizer-dimensions-control.php'; + require_once $dir . 'unit-dimensions/class-responsive-customizer-unit-dimensions-control.php'; require_once $dir . 'heading/class-responsive-customizer-heading-control.php'; require_once $dir . 'select/class-responsive-customizer-responsive-select-control.php'; require_once $dir . 'checkbox/class-responsive-customizer-responsive-checkbox-control.php'; diff --git a/core/includes/customizer/extend-controls/src/author-box-toggle.js b/core/includes/customizer/extend-controls/src/author-box-toggle.js new file mode 100644 index 000000000..5865fa6bf --- /dev/null +++ b/core/includes/customizer/extend-controls/src/author-box-toggle.js @@ -0,0 +1,22 @@ +/** + * Author Box Style — show/hide based on "Disable Author Profile Box" toggle. + */ +wp.customize.bind( 'ready', function () { + if ( ! wp.customize( 'responsive_disable_author_meta' ) ) { + return; + } + + const authorBoxEl = document.getElementById( 'customize-control-responsive_post_author_box_style' ); + if ( authorBoxEl ) { + authorBoxEl.style.display = wp.customize( 'responsive_disable_author_meta' ).get() ? 'none' : 'block'; + } + + wp.customize( 'responsive_disable_author_meta', function ( value ) { + value.bind( function ( newval ) { + const el = document.getElementById( 'customize-control-responsive_post_author_box_style' ); + if ( el ) { + el.style.display = newval ? 'none' : 'block'; + } + } ); + } ); +} ); \ No newline at end of file diff --git a/core/includes/customizer/extend-controls/src/index.js b/core/includes/customizer/extend-controls/src/index.js index 4e8942696..d20684675 100644 --- a/core/includes/customizer/extend-controls/src/index.js +++ b/core/includes/customizer/extend-controls/src/index.js @@ -9,6 +9,7 @@ import { responsiveCheckbox } from './checkbox/control'; import { responsivePalette } from './palette/control'; import { responsiveTypography } from './typography/control'; import { responsiveDimensions } from './dimensions/control'; +import { responsiveUnitDimensions } from './unit-dimensions/control'; import { responsiveColor } from './color/control'; import { responsiveColorStates } from './color-states/control'; import { responsiveRedirect} from './redirect/control'; @@ -27,6 +28,7 @@ import { responsiveTypographyGroup } from './typography_group/control'; import { responsiveFontPreset } from './fontpresets/control'; import { responsiveButtonPreset } from './buttonpresets/control'; import './breadcrumb-toggle'; +import './author-box-toggle'; import { responsiveBuilderControl } from './builder-layout/control'; import { responsiveMultiSelectControl } from './multi-select/control'; import { responsiveRangeWithSwitcher } from './range-with-switchers/control'; @@ -53,6 +55,7 @@ wp.customize.controlConstructor['responsive-checkbox'] = responsiveCheckbox; wp.customize.controlConstructor['responsive-palette'] = responsivePalette; wp.customize.controlConstructor['responsive-typography'] = responsiveTypography; wp.customize.controlConstructor['responsive-dimensions'] = responsiveDimensions; +wp.customize.controlConstructor['responsive-unit-dimensions'] = responsiveUnitDimensions; wp.customize.controlConstructor['alpha-color'] = responsiveColor; wp.customize.controlConstructor['alpha-color-states'] = responsiveColorStates; wp.customize.controlConstructor['responsive-redirect'] = responsiveRedirect; diff --git a/core/includes/customizer/extend-controls/src/palette/palette-component.js b/core/includes/customizer/extend-controls/src/palette/palette-component.js index 83d888b60..d3db2a120 100644 --- a/core/includes/customizer/extend-controls/src/palette/palette-component.js +++ b/core/includes/customizer/extend-controls/src/palette/palette-component.js @@ -206,15 +206,15 @@ const PaletteComponent = props => { function getDefaultColor(settingId) { if(settingId === "responsive_global_color_palette_text_color") { - return "#364151"; + return "#404040"; } else if(settingId === "responsive_global_color_palette_headings_color") { - return "#fcba03"; + return "#404040"; } else if(settingId === "responsive_global_color_palette_accent_color") { - return "#0066CC"; + return "#3B82F6"; } else if(settingId === "responsive_global_color_palette_link_hover_color") { @@ -224,10 +224,10 @@ const PaletteComponent = props => { return "#ffffff"; } else if(settingId === "responsive_global_color_palette_site_background_color"){ - return "#f0f5fa"; + return "#f8fafc"; } else if(settingId === "responsive_global_color_palette_alt_background_color"){ - return "#eaeaea"; + return "#ffffff"; } else if(settingId === "responsive_global_color_palette_subtle_background_color"){ return "#007fff"; diff --git a/core/includes/customizer/extend-controls/src/sortable/control.js b/core/includes/customizer/extend-controls/src/sortable/control.js index 5ea53d880..f5ca4f76e 100644 --- a/core/includes/customizer/extend-controls/src/sortable/control.js +++ b/core/includes/customizer/extend-controls/src/sortable/control.js @@ -41,6 +41,17 @@ export const responsiveSortable = wp.customize.responsiveControl.extend( { // Update value on click. control.updateValue(); }); + + // Sub-controls logic handled in React now + let subControls = control.params.sub_controls || {}; + console.log('Sortable Control Init:', control.id, 'Sub-controls mapping:', subControls); + + // Handle chevron click for dropdown + control.sortableContainer.find('.responsive-sortable-chevron').click(function(e) { + e.stopPropagation(); // prevent drag or visibility toggle from capturing this + jQuery(this).toggleClass('expanded'); + jQuery(this).closest('li').find('.responsive-sortable-dropdown').slideToggle(); + }); }, /** diff --git a/core/includes/customizer/extend-controls/src/sortable/sortable-component.js b/core/includes/customizer/extend-controls/src/sortable/sortable-component.js index ca689df59..e16930007 100644 --- a/core/includes/customizer/extend-controls/src/sortable/sortable-component.js +++ b/core/includes/customizer/extend-controls/src/sortable/sortable-component.js @@ -1,4 +1,225 @@ import PropTypes from 'prop-types'; +import ResponsiveSliderComponent from '../slider/slider-component.js'; + +const SubControls = ({ choiceID, subControlIds }) => { + if (choiceID === 'author' && subControlIds && subControlIds.length >= 3) { + const prefixSettingId = subControlIds[0]; + const avatarSettingId = subControlIds[1]; + const sizeSettingId = subControlIds[2]; + + const [prefixLabel, setPrefixLabel] = React.useState((wp.customize(prefixSettingId) && wp.customize(prefixSettingId).get()) || 'By'); + const [authorAvatar, setAuthorAvatar] = React.useState((wp.customize(avatarSettingId) && wp.customize(avatarSettingId).get()) || false); + + // Mock control for ResponsiveSliderComponent + const mockSliderControl = { + id: sizeSettingId, + setting: { + get: () => { + const val = wp.customize(sizeSettingId) ? wp.customize(sizeSettingId).get() : null; + return val || 30; + }, + set: (val) => { + if (wp.customize(sizeSettingId)) { + wp.customize(sizeSettingId).set(val); + } + } + }, + params: { + label: 'Image Size', + default: 30, + inputAttrs: 'min="10" max="100" step="1"' + } + }; + + React.useEffect(() => { + const prefixSetting = wp.customize(prefixSettingId); + if (prefixSetting) prefixSetting.bind(setPrefixLabel); + + const avatarSetting = wp.customize(avatarSettingId); + if (avatarSetting) avatarSetting.bind(setAuthorAvatar); + + return () => { + if (prefixSetting) prefixSetting.unbind(setPrefixLabel); + if (avatarSetting) avatarSetting.unbind(setAuthorAvatar); + }; + }, [prefixSettingId, avatarSettingId]); + + const handlePrefixChange = (e) => { + const val = e.target.value; + setPrefixLabel(val); + if (wp.customize(prefixSettingId)) { + wp.customize(prefixSettingId).set(val); + } + }; + + const handleAvatarChange = (e) => { + const val = e.target.checked; + setAuthorAvatar(val); + if (wp.customize(avatarSettingId)) { + wp.customize(avatarSettingId).set(val); + } + }; + + return ( +
    +
    + +
    +
    + +
    + {authorAvatar && ( +
    + +
    + )} +
    + ); + } + + if ((choiceID === 'date' || choiceID === 'updated') && subControlIds && subControlIds.length >= 1) { + const formatSettingId = subControlIds[0]; + const [dateFormat, setDateFormat] = React.useState((wp.customize(formatSettingId) && wp.customize(formatSettingId).get()) || 'default'); + + React.useEffect(() => { + const formatSetting = wp.customize(formatSettingId); + if (formatSetting) formatSetting.bind(setDateFormat); + return () => { + if (formatSetting) formatSetting.unbind(setDateFormat); + }; + }, [formatSettingId]); + + const handleFormatChange = (e) => { + const val = e.target.value; + setDateFormat(val); + if (wp.customize(formatSettingId)) { + wp.customize(formatSettingId).set(val); + } + }; + + const labelText = choiceID === 'updated' ? 'Last Updated Format' : 'Date Format'; + + return ( +
    +
    + +
    +
    + ); + } + + + if ((choiceID === 'categories' || choiceID === 'tag') && subControlIds && subControlIds.length >= 1) { + const styleSettingId = subControlIds[0]; + const [style, setStyle] = React.useState((wp.customize(styleSettingId) && wp.customize(styleSettingId).get()) || 'default'); + + React.useEffect(() => { + const styleSetting = wp.customize(styleSettingId); + if (styleSetting) styleSetting.bind(setStyle); + return () => { + if (styleSetting) styleSetting.unbind(setStyle); + }; + }, [styleSettingId]); + + const handleStyleChange = (val) => { + setStyle(val); + if (wp.customize(styleSettingId)) { + wp.customize(styleSettingId).set(val); + } + }; + + return ( +
    +
    + Style +
    + {['default', 'badge', 'underline'].map((opt) => ( + + ))} +
    +
    +
    + ); + } + if (choiceID === 'meta' && subControlIds && subControlIds.length >= 1) { + const dividerSettingId = subControlIds[0]; + const [divider, setDivider] = React.useState((wp.customize(dividerSettingId) && wp.customize(dividerSettingId).get()) || '•'); + + React.useEffect(() => { + const dividerSetting = wp.customize(dividerSettingId); + if (dividerSetting) dividerSetting.bind(setDivider); + return () => { + if (dividerSetting) dividerSetting.unbind(setDivider); + }; + }, [dividerSettingId]); + + const handleDividerChange = (val) => { + setDivider(val); + if (wp.customize(dividerSettingId)) { + wp.customize(dividerSettingId).set(val); + } + }; + + return ( +
    +
    + Divider Type +
    + {['/', '-', '|', '•', 'None'].map((opt) => ( + + ))} +
    +
    +
    + ); + } + + return
    ; +}; const SortableComponent = props => { @@ -10,7 +231,8 @@ const SortableComponent = props => { description, value, choices, - inputAttrs + inputAttrs, + sub_controls } = props.control.params; if (label) { @@ -24,17 +246,42 @@ const SortableComponent = props => { let visibleMetaHtml = Object.values(value).map(choiceID => { let html = ''; if (choices[choiceID]) { - html =
  • -
    - - - - {choices[choiceID]} + let hasSubControls = sub_controls && sub_controls[choiceID] && sub_controls[choiceID].length > 0; + html =
  • +
    +
    + + + + {choices[choiceID]} +
    +
    + {hasSubControls && ( + { + e.stopPropagation(); + const target = e.currentTarget; + target.classList.toggle('expanded'); + const dropdown = target.closest('li').querySelector('.responsive-sortable-dropdown'); + if (dropdown) { + if (dropdown.style.display === 'none') { + dropdown.style.display = 'block'; + } else { + dropdown.style.display = 'none'; + } + } + }}> + + + )} + + + + +
    - - - - + {hasSubControls && ( + + )}
  • ; } return html; @@ -43,17 +290,30 @@ const SortableComponent = props => { let invisibleMetaHtml = Object.keys(choices).map(choiceID => { let html = ''; if (Array.isArray(value) && -1 === value.indexOf(choiceID)) { - html =
  • -
    - - - - {choices[choiceID]} + let hasSubControls = sub_controls && sub_controls[choiceID] && sub_controls[choiceID].length > 0; + html =
  • +
    +
    + + + + {choices[choiceID]} +
    +
    + {hasSubControls && ( + + + + )} + + + + +
    - - - - + {hasSubControls && ( + + )}
  • ; } return html; diff --git a/core/includes/customizer/extend-controls/src/tabs/tabs-component.js b/core/includes/customizer/extend-controls/src/tabs/tabs-component.js index a50663bbe..242bd74be 100644 --- a/core/includes/customizer/extend-controls/src/tabs/tabs-component.js +++ b/core/includes/customizer/extend-controls/src/tabs/tabs-component.js @@ -28,12 +28,36 @@ const TabsComponent = props => { general: design_tab_ids, }; + const isSidebarControlInactive = (elementId) => { + let posControlKey = null; + if (elementId.indexOf('responsive_page_sidebar') !== -1) { + posControlKey = 'responsive_page_sidebar_position'; + } else if (elementId.indexOf('responsive_blog_sidebar') !== -1) { + posControlKey = 'responsive_blog_sidebar_position'; + } else if (elementId.indexOf('responsive_shop_sidebar') !== -1) { + posControlKey = 'responsive_shop_sidebar_position'; + } else if (elementId.indexOf('responsive_single_product_sidebar') !== -1) { + posControlKey = 'responsive_single_product_sidebar_position'; + } + if (posControlKey) { + const posCtrl = api.control(posControlKey); + if (posCtrl && posCtrl.active && !posCtrl.active.get()) { + return true; + } + } + return false; + }; + useEffect(() => { const showElements = tab === 'general' ? 'design' : 'general'; elementsToHide[showElements].forEach(elementId => { const element = document.getElementById(elementId); if (element) { - element.style.display = 'block'; + if (isSidebarControlInactive(elementId)) { + element.style.display = 'none'; + } else { + element.style.display = 'block'; + } } }); elementsToHide[tab].forEach(elementId => { @@ -493,15 +517,7 @@ const TabsComponent = props => { } } - if( ! api('responsive_blog_post_title_toggle').get() ) { - document.getElementById('customize-control-responsive_blog_post_title_toggle_separator').style.display = 'none'; - document.getElementById('customize-control-res_blog_post_title_text').style.display = 'none'; - } else { - if( 'general' === tab ) { - document.getElementById('customize-control-responsive_blog_post_title_toggle_separator').style.display = 'block'; - document.getElementById('customize-control-res_blog_post_title_text').style.display = 'block'; - } - } + if( 'list' === api('responsive_blog_layout').get() ) { document.getElementById('customize-control-responsive_blog_layout_options_separator').style.display = 'none'; @@ -717,6 +733,94 @@ const TabsComponent = props => { } }); }); + + toggleBannerLayoutControls(); + if (api('responsive_single_blog_post_title_layout')) { + api('responsive_single_blog_post_title_layout', function(value) { + value.bind(function() { + toggleBannerLayoutControls(); + }); + }); + } + if (api('responsive_single_blog_banner_container_width')) { + api('responsive_single_blog_banner_container_width', function(value) { + value.bind(function() { + toggleBannerLayoutControls(); + }); + }); + } + + toggleBlogTitleLayoutControls(); + if (api('responsive_blog_title_layout')) { + api('responsive_blog_title_layout', function(value) { + value.bind(function() { + toggleBlogTitleLayoutControls(); + }); + }); + } + if (api('responsive_blog_banner_container_width')) { + api('responsive_blog_banner_container_width', function(value) { + value.bind(function() { + toggleBlogTitleLayoutControls(); + }); + }); + } + if (api('responsive_blog_post_title_toggle')) { + api('responsive_blog_post_title_toggle', function(value) { + value.bind(function() { + toggleBlogTitleLayoutControls(); + }); + }); + } + + togglePageTitleLayoutControls(); + if (api('responsive_page_title_layout')) { + api('responsive_page_title_layout', function(value) { + value.bind(function() { + togglePageTitleLayoutControls(); + }); + }); + } + if (api('responsive_page_title_container_width')) { + api('responsive_page_title_container_width', function(value) { + value.bind(function() { + togglePageTitleLayoutControls(); + }); + }); + } + + togglePageFeaturedImageControls(); + if (api('responsive_page_featured_image_ratio')) { + api('responsive_page_featured_image_ratio', function(value) { + value.bind(function() { + togglePageFeaturedImageControls(); + }); + }); + } + if (api('responsive_page_featured_image_position')) { + api('responsive_page_featured_image_position', function(value) { + value.bind(function() { + togglePageFeaturedImageControls(); + }); + }); + } + + toggleSingleBlogFeaturedImageControls(); + if (api('responsive_single_blog_featured_image_ratio')) { + api('responsive_single_blog_featured_image_ratio', function(value) { + value.bind(function() { + toggleSingleBlogFeaturedImageControls(); + }); + }); + } + if (api('responsive_single_blog_featured_image_position')) { + api('responsive_single_blog_featured_image_position', function(value) { + value.bind(function() { + toggleSingleBlogFeaturedImageControls(); + }); + }); + } + }, [tab]); const hideSidebarWidthControl = (value, control) => { @@ -741,7 +845,7 @@ const TabsComponent = props => { } } - if (isVisible) { + if (isVisible && !isSidebarControlInactive(controlId)) { controlElement.style.display = 'block'; } }; @@ -770,7 +874,7 @@ const TabsComponent = props => { } } - if (isVisible) { + if (isVisible && !isSidebarControlInactive(controlId)) { controlElement.style.display = 'block'; } }; @@ -810,7 +914,7 @@ const TabsComponent = props => { isVisible = value !== 'no' && tab === 'general'; } - if (isVisible) { + if (isVisible && !isSidebarControlInactive(controlId)) { controlElement.style.display = 'block'; } }; @@ -829,7 +933,7 @@ const TabsComponent = props => { isVisible = value !== 'no' && tab === 'general'; } - if (isVisible) { + if (isVisible && !isSidebarControlInactive(controlId)) { controlElement.style.display = 'block'; } }; @@ -1014,6 +1118,177 @@ const TabsComponent = props => { } }; + const toggleBannerLayoutControls = () => { + const layout = api('responsive_single_blog_post_title_layout') ? api('responsive_single_blog_post_title_layout').get() : 'post_title_layout1'; + const containerWidth = api('responsive_single_blog_banner_container_width') ? api('responsive_single_blog_banner_container_width').get() : 'full_width'; + + const containerWidthElement = document.getElementById('customize-control-responsive_single_blog_banner_container_width'); + const metaAlignmentSeparator = document.getElementById('customize-control-responsive_single_blog_meta_alignment_separator'); + const verticalAlignment = document.getElementById('customize-control-responsive_single_blog_post_title_vertical_alignment'); + const customWidthElement = document.getElementById('customize-control-responsive_single_blog_banner_custom_width'); + const minHeightElement = document.getElementById('customize-control-responsive_single_blog_banner_min_height'); + const bgColorElement = document.getElementById('customize-control-responsive_single_blog_banner_background_color'); + const paddingElement = document.getElementById('customize-control-responsive_single_blog_banner_padding_padding'); + const marginElement = document.getElementById('customize-control-responsive_single_blog_banner_margin_padding'); + const separatorElement = document.getElementById('customize-control-responsive_single_blog_post_meta_typography_group_separator'); + + if (containerWidthElement) { + containerWidthElement.style.display = (layout === 'post_title_layout2' && tab === 'general') ? 'block' : 'none'; + } + if(metaAlignmentSeparator) { + metaAlignmentSeparator.style.display = (layout === 'post_title_layout2' && tab=== 'general') ? 'block' : 'none'; + } + if (verticalAlignment) { + verticalAlignment.style.display = (layout === 'post_title_layout2' && tab === 'general') ? 'block' : 'none'; + } + if (customWidthElement) { + customWidthElement.style.display = (layout === 'post_title_layout2' && containerWidth === 'custom' && tab === 'general') ? 'block' : 'none'; + } + if (minHeightElement) { + minHeightElement.style.display = (layout === 'post_title_layout2' && tab === 'design') ? 'block' : 'none'; + } + if(separatorElement) { + separatorElement.style.display = (layout === 'post_title_layout2' && tab === 'design') ? 'block' : 'none'; + } + if (bgColorElement) { + bgColorElement.style.display = (layout === 'post_title_layout2' && tab === 'design') ? 'block' : 'none'; + } + if (paddingElement) { + paddingElement.style.display = (layout === 'post_title_layout2' && tab === 'design') ? 'block' : 'none'; + } + if (marginElement) { + marginElement.style.display = (layout === 'post_title_layout2' && tab === 'design') ? 'block' : 'none'; + } + }; + + const toggleBlogTitleLayoutControls = () => { + const layout = api('responsive_blog_title_layout') ? api('responsive_blog_title_layout').get() : 'post_title_layout1'; + const isToggleActive = api('responsive_blog_post_title_toggle') ? api('responsive_blog_post_title_toggle').get() : false; + + const descElement = document.getElementById('customize-control-responsive_blog_title_description'); + const titleToggleElement = document.getElementById('customize-control-responsive_blog_post_title_toggle'); + const titleTextElement = document.getElementById('customize-control-res_blog_post_title_text'); + const titleToggleSeparator = document.getElementById('customize-control-responsive_blog_post_title_toggle_separator'); + const containerWidth = api('responsive_blog_banner_container_width') ? api('responsive_blog_banner_container_width').get() : 'full_width'; + + const containerWidthElement = document.getElementById('customize-control-responsive_blog_banner_container_width'); + const customWidthElement = document.getElementById('customize-control-responsive_blog_banner_custom_width'); + const minHeightElement = document.getElementById('customize-control-responsive_blog_banner_min_height'); + const verticalAlignment = document.getElementById('customize-control-responsive_blog_post_title_vertical_alignment'); + if (verticalAlignment) { + verticalAlignment.style.display = (layout === 'post_title_layout2' && tab === 'general') ? 'block' : 'none'; + } + + if (containerWidthElement) { + containerWidthElement.style.display = (layout === 'post_title_layout2' && tab === 'general') ? 'block' : 'none'; + } + + if (descElement) { + descElement.style.display = (layout === 'post_title_layout2' && tab === 'general') ? 'block' : 'none'; + } + if (titleToggleElement) { + titleToggleElement.style.display = (layout === 'post_title_layout2' && tab === 'general') ? 'block' : 'none'; + } + if (titleTextElement) { + titleTextElement.style.display = (layout === 'post_title_layout2' && isToggleActive && tab === 'general') ? 'block' : 'none'; + } + if (titleToggleSeparator) { + titleToggleSeparator.style.display = (layout === 'post_title_layout2' && isToggleActive && tab === 'general') ? 'block' : 'none'; + } + if (customWidthElement) { + customWidthElement.style.display = (layout === 'post_title_layout2' && containerWidth === 'custom' && tab === 'general') ? 'block' : 'none'; + } + if (minHeightElement) { + minHeightElement.style.display = (layout === 'post_title_layout2' && tab === 'design') ? 'block' : 'none'; + } + + }; + + const togglePageTitleLayoutControls = () => { + const layout = api('responsive_page_title_layout') ? api('responsive_page_title_layout').get() : 'post_title_layout1'; + const containerWidth = api('responsive_page_title_container_width') ? api('responsive_page_title_container_width').get() : 'full_width'; + + const containerWidthElement = document.getElementById('customize-control-responsive_page_title_container_width'); + const verticalAlignment = document.getElementById('customize-control-responsive_page_title_vertical_alignment'); + const customWidthElement = document.getElementById('customize-control-responsive_page_title_custom_width'); + const minHeightElement = document.getElementById('customize-control-responsive_page_title_banner_min_height'); + const bgColorElement = document.getElementById('customize-control-responsive_page_title_banner_background_color'); + const paddingElement = document.getElementById('customize-control-responsive_page_title_banner_padding_padding'); + const marginElement = document.getElementById('customize-control-responsive_page_title_banner_margin_padding'); + const separator = document.getElementById('customize-control-responsive_page_title_area_meta_typography_group_separator'); + + if (containerWidthElement) { + containerWidthElement.style.display = (layout === 'post_title_layout2' && tab === 'general') ? 'block' : 'none'; + } + if (verticalAlignment) { + verticalAlignment.style.display = (layout === 'post_title_layout2' && tab === 'general') ? 'block' : 'none'; + } + if (customWidthElement) { + customWidthElement.style.display = (layout === 'post_title_layout2' && containerWidth === 'custom' && tab === 'general') ? 'block' : 'none'; + } + if (minHeightElement) { + minHeightElement.style.display = (layout === 'post_title_layout2' && tab === 'design') ? 'block' : 'none'; + } + if (bgColorElement) { + bgColorElement.style.display = (layout === 'post_title_layout2' && tab === 'design') ? 'block' : 'none'; + } + if (paddingElement) { + paddingElement.style.display = (layout === 'post_title_layout2' && tab === 'design') ? 'block' : 'none'; + } + if (marginElement) { + marginElement.style.display = (layout === 'post_title_layout2' && tab === 'design') ? 'block' : 'none'; + } + if(separator) { + separator.style.display = (layout === 'post_title_layout2' && tab === 'design') ? 'block' : 'none'; + } + }; + + const togglePageFeaturedImageControls = () => { + const ratio = api('responsive_page_featured_image_ratio') ? api('responsive_page_featured_image_ratio').get() : 'original'; + const position = api('responsive_page_featured_image_position') ? api('responsive_page_featured_image_position').get() : 'none'; + + const predefinedRatioElement = document.getElementById('customize-control-responsive_page_featured_image_predefined_ratio'); + const customWidthElement = document.getElementById('customize-control-responsive_page_featured_image_custom_width'); + const customHeightElement = document.getElementById('customize-control-responsive_page_featured_image_custom_height'); + const overlayColorElement = document.getElementById('customize-control-responsive_page_featured_image_overlay_color'); + + if (predefinedRatioElement) { + predefinedRatioElement.style.display = (ratio === 'predefined' && tab === 'general') ? 'block' : 'none'; + } + if (customWidthElement) { + customWidthElement.style.display = (ratio === 'custom' && tab === 'general') ? 'block' : 'none'; + } + if (customHeightElement) { + customHeightElement.style.display = (ratio === 'custom' && tab === 'general') ? 'block' : 'none'; + } + if (overlayColorElement) { + overlayColorElement.style.display = (position === 'background' && tab === 'design') ? 'block' : 'none'; + } + }; + + const toggleSingleBlogFeaturedImageControls = () => { + const ratio = api('responsive_single_blog_featured_image_ratio') ? api('responsive_single_blog_featured_image_ratio').get() : 'original'; + const position = api('responsive_single_blog_featured_image_position') ? api('responsive_single_blog_featured_image_position').get() : 'none'; + + const predefinedRatioElement = document.getElementById('customize-control-responsive_single_blog_featured_image_predefined_ratio'); + const customWidthElement = document.getElementById('customize-control-responsive_single_blog_featured_image_custom_width'); + const customHeightElement = document.getElementById('customize-control-responsive_single_blog_featured_image_custom_height'); + const overlayColorElement = document.getElementById('customize-control-responsive_single_blog_featured_image_overlay_color'); + + if (predefinedRatioElement) { + predefinedRatioElement.style.display = (ratio === 'predefined' && tab === 'general') ? 'block' : 'none'; + } + if (customWidthElement) { + customWidthElement.style.display = (ratio === 'custom' && tab === 'general') ? 'block' : 'none'; + } + if (customHeightElement) { + customHeightElement.style.display = (ratio === 'custom' && tab === 'general') ? 'block' : 'none'; + } + if (overlayColorElement) { + overlayColorElement.style.display = (position === 'background' && tab === 'design') ? 'block' : 'none'; + } + }; + return <>
    { if (id === 'responsive_font_family') { let familyDescriptionHtml = null; - let defaultValue = __( 'Arial, Helvetica, sans-serif', 'responsive' ); + let defaultValue = resp_inherit || __( 'Default', 'responsive' ); let stdFonts = standard_fonts; let googleFonts = google_fonts; let customFonts = custom_fonts; let optgrpOfStandardFonts = null; let optgrpOfCustomFonts = null; let optgrpOfGoogleFonts = null; - let optgrpOfStandardFontsLabel = __( 'Standard Fonts', 'responsive' ); + let optgrpOfStandardFontsLabel = __( 'System Fonts', 'responsive' ); let optgrpOfGoogleFontsLabel = __( 'Google Fonts', 'responsive' ); let optgrpOfCustomFontsLabel = __( 'Custom Fonts', 'responsive' ); let standardFontsOptionsHtml = null; @@ -60,7 +60,8 @@ const TypographyComponent = props => { } if (stdFonts) { standardFontsOptionsHtml = Object.entries(stdFonts).map(font => { - let html = ; + let fontValue = font[0] === 'System Font' ? font[0] : `\'${font[0]}\', ${font[1][1]}`; + let html = ; return html; }); } diff --git a/core/includes/customizer/extend-controls/src/typography_group/typography-group-component.js b/core/includes/customizer/extend-controls/src/typography_group/typography-group-component.js index 845492568..ceb63c843 100644 --- a/core/includes/customizer/extend-controls/src/typography_group/typography-group-component.js +++ b/core/includes/customizer/extend-controls/src/typography_group/typography-group-component.js @@ -217,8 +217,8 @@ const TypographyGroupControlComponent = (props) => {
    {label} - - + +
    ); diff --git a/core/includes/customizer/extend-controls/src/unit-dimensions/control.js b/core/includes/customizer/extend-controls/src/unit-dimensions/control.js new file mode 100644 index 000000000..94b04966b --- /dev/null +++ b/core/includes/customizer/extend-controls/src/unit-dimensions/control.js @@ -0,0 +1,72 @@ +import UnitDimensionsComponent from './unit-dimensions-component.js'; + + +export const responsiveUnitDimensions = wp.customize.responsiveControl.extend({ + renderContent: function renderContent() { + let control = this; + ReactDOM.render(, control.container[0]); + }, + ready: function () { + + 'use strict'; + let control = this; + jQuery(document).mouseup(function (e) { + var container = jQuery(control.container); + var colorWrap = container.find('.wp-picker-container'); + jQuery('.components-color-picker').on('click', function (event) { + event.preventDefault(); + }); + // If the target of the click isn't the container nor a descendant of the container. + if (!colorWrap.is(e.target) && colorWrap.has(e.target).length === 0) { + container.find('button.wp-color-result.wp-picker-open').click(); + } + }); + + control.container.on( + 'click', + '.responsive-switchers button', + function (event) { + event.stopPropagation(); + + let $this = jQuery(this), + $control = $this.closest('.customize-control'), + $devices = $control.find('.responsive-switchers'), + $device = $this.data('device'), + $body = jQuery('.wp-full-overlay'), + $footer_devices = jQuery('.wp-full-overlay-footer .devices'); + + // Button class + $devices.find('button').removeClass('active'); + $devices.find('button.preview-' + $device).addClass('active'); + + // Control class (ONLY inside this control) + $control.find('.control-wrap').removeClass('active'); + $control.find('.control-wrap.' + $device).addClass('active'); + + $control + .removeClass('control-device-desktop control-device-tablet control-device-mobile') + .addClass('control-device-' + $device); + + // Wrapper class + $body + .removeClass('preview-desktop preview-tablet preview-mobile') + .addClass('preview-' + $device); + + // Panel footer buttons + $footer_devices.find('button') + .removeClass('active') + .attr('aria-pressed', false); + + $footer_devices.find('button.preview-' + $device) + .addClass('active') + .attr('aria-pressed', true); + + // Toggle switchers + if ($this.hasClass('preview-desktop')) { + $control.toggleClass('responsive-switchers-open'); + } + } + ); + + }, +}); diff --git a/core/includes/customizer/extend-controls/src/unit-dimensions/unit-dimensions-component.js b/core/includes/customizer/extend-controls/src/unit-dimensions/unit-dimensions-component.js new file mode 100644 index 000000000..dfa9b38d9 --- /dev/null +++ b/core/includes/customizer/extend-controls/src/unit-dimensions/unit-dimensions-component.js @@ -0,0 +1,248 @@ +import PropTypes from 'prop-types'; +import {__} from '@wordpress/i18n'; +import {useState, useEffect} from 'react'; + +const UnitDimensionsComponent = props => { + let value = props.control.params; + const [props_value, setPropsValue] = useState(value); + const [activeDevice, setActiveDevice] = useState('desktop'); + + useEffect(() => { + if (window.wp && window.wp.customize && window.wp.customize.previewedDevice) { + const currentDevice = window.wp.customize.previewedDevice.get(); + setActiveDevice(currentDevice); + + // Sync control container class + props.control.container.removeClass( 'control-device-desktop control-device-tablet control-device-mobile' ).addClass( 'control-device-' + currentDevice ); + + const handleDeviceChange = () => { + const device = window.wp.customize.previewedDevice.get(); + setActiveDevice(device); + props.control.container.removeClass( 'control-device-desktop control-device-tablet control-device-mobile' ).addClass( 'control-device-' + device ); + }; + window.wp.customize.previewedDevice.bind(handleDeviceChange); + return () => { + window.wp.customize.previewedDevice.unbind(handleDeviceChange); + }; + } + }, []); + + const onConnectedClick = (e) => { + let parent = e.target.parentElement.parentElement.parentElement; + let inputs = parent.querySelectorAll('.responsive-dimensions-input'); + + for (let i = 0; i < inputs.length; i++) { + inputs[i].classList.remove('linked'); + inputs[i].setAttribute('data-element-connect', ''); + } + + e.target.parentElement.classList.remove('unlinked'); + e.target.parentElement.style.backgroundColor = ''; + e.target.parentElement.style.color = ''; + }; + + const onDisconnectedClick = (e) => { + let elements = e.target.dataset.elementConnect; + let parent = e.target.parentElement.parentElement.parentElement; + let inputs = parent.querySelectorAll('.responsive-dimensions-input'); + + for (let i = 0; i < inputs.length; i++) { + inputs[i].classList.add('linked'); + inputs[i].setAttribute('data-element-connect', elements); + } + + e.target.parentElement.classList.add('unlinked'); + e.target.parentElement.style.backgroundColor = '#13aff0'; + e.target.parentElement.style.color = '#fff'; + }; + + const onSpacingChange = (e, device, choiceID) => { + let updateState = { + ...props_value + }; + let deviceUpdateState = { + ...updateState[device] + }; + + if (!e.target.classList.contains('linked')) { + deviceUpdateState[choiceID].value = e.target.value; + props.control.settings[choiceID].set(e.target.value); + } else { + for (let cID in deviceUpdateState) { + let value = e.target.value; + deviceUpdateState[cID].value = value; + props.control.settings[cID].set(value); + } + } + updateState[device] = deviceUpdateState; + setPropsValue(updateState); + }; + + const onUnitChange = (device, unitValue) => { + let updateState = { + ...props_value + }; + let unitsUpdateState = { + ...updateState.units + }; + + let unitKey = device + '_unit'; + + if (unitsUpdateState[unitKey]) { + unitsUpdateState[unitKey].value = unitValue; + props.control.settings[unitKey].set(unitValue); + + updateState.units = unitsUpdateState; + setPropsValue(updateState); + } + }; + + const renderInputHtml = (device, active = '') => { + const { + id, + inputAttrs, + l10n + } = props.control.params; + + let itemLinkDesc = __('Link Values Together', 'responsive'); + + let linkHtml = null; + let htmlChoices = null; + let dataElement = id; + if ('tablet'===device) { + dataElement = dataElement + '_tablet'; + } + if ('mobile'===device) { + dataElement = dataElement + '_mobile'; + } + + linkHtml =
  • +
    + { + onConnectedClick(e); + }} + data-element-connect={id} title={itemLinkDesc} + data-element={dataElement} + > + + { + onDisconnectedClick(e); + }} data-element-connect={id} title={itemLinkDesc} + data-element={dataElement} + > + +
    +
  • ; + + if( props_value[device] ) { + htmlChoices = Object.keys(props_value[device]).map(choiceID => { + let link = props_value[device][choiceID].id; + if (undefined !== link) { + let splited_values = link.split("="); + if (undefined !== splited_values[1]) { + link = splited_values[1].replace(/"/g, ""); + } + } + let attr= []; + if (undefined !== inputAttrs) { + let splited_values = inputAttrs.split(" "); + splited_values.map((item) => { + let item_values = item.split("="); + + if (undefined !== item_values[1]) { + attr[item_values[0]] = item_values[1].replace(/"/g, ""); + } + }); + } + let html =
  • + onSpacingChange(e, device, choiceID)} + data-element={dataElement} + data-customize-setting-link = {link} + /> + {l10n[choiceID]} +
  • ; + return html; + }); + } + + return
      + {htmlChoices} + {linkHtml} +
    ; + }; + + const { + label, + description + } = props.control.params; + let htmlDescription = null; + let inputHtml = null; + let responsiveHtml = null; + + if (description) { + htmlDescription = ; + } + + inputHtml = <> + {renderInputHtml('desktop', activeDevice === 'desktop' ? 'active' : '')} + {renderInputHtml('tablet', activeDevice === 'tablet' ? 'active' : '')} + {renderInputHtml('mobile', activeDevice === 'mobile' ? 'active' : '')} + ; + + const availableUnits = ['px', 'em', '%']; + const currentUnitKey = activeDevice + '_unit'; + const currentUnitValue = (props_value.units && props_value.units[currentUnitKey]) ? props_value.units[currentUnitKey].value : 'px'; + + let unitsHtml =
    + +
    ; + + responsiveHtml = <> + +
    + {label} +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    + {unitsHtml} +
    + {inputHtml} + ; + + return <> + {responsiveHtml} + {htmlDescription} + ; + +}; + +UnitDimensionsComponent.propTypes = { + control: PropTypes.object.isRequired +}; + +export default React.memo( UnitDimensionsComponent ); diff --git a/core/includes/customizer/helper.php b/core/includes/customizer/helper.php index ae6d00a84..27fab38d7 100644 --- a/core/includes/customizer/helper.php +++ b/core/includes/customizer/helper.php @@ -32,6 +32,7 @@ function responsive_blog_entry_elements() { $elements = apply_filters( 'responsive_blog_entry_elements', array( + 'categories' => esc_html__( 'Categories', 'responsive' ), 'title' => esc_html__( 'Title', 'responsive' ), 'featured_image' => esc_html__( 'Featured Image', 'responsive' ), 'meta' => esc_html__( 'Meta', 'responsive' ), @@ -55,7 +56,7 @@ function responsive_blog_entry_elements() { function responsive_blog_entry_elements_positioning() { // Default sections. - $sections = array( 'title', 'meta', 'featured_image', 'content' ); + $sections = array( 'featured_image', 'categories', 'title', 'meta', 'content' ); // Get sections from Customizer. $sections = get_theme_mod( 'responsive_blog_entry_elements_positioning', $sections ); @@ -83,7 +84,7 @@ function responsive_blog_entry_elements_positioning() { function responsive_blog_entry_meta() { // Default sections. - $sections = array( 'author', 'date', 'categories', 'tag' ); + $sections = array( 'author', 'date', 'tag' ); // Get sections from Customizer. $sections = get_theme_mod( 'responsive_blog_entry_meta', $sections ); @@ -114,10 +115,12 @@ function responsive_blog_single_elements() { $elements = apply_filters( 'responsive_blog_single_elements', array( + 'categories' => esc_html__( 'Categories', 'responsive' ), 'title' => esc_html__( 'Title', 'responsive' ), 'featured_image' => esc_html__( 'Featured Image', 'responsive' ), 'meta' => esc_html__( 'Meta', 'responsive' ), 'content' => esc_html__( 'Content', 'responsive' ), + 'excerpt' => esc_html__( 'Excerpt', 'responsive' ), ) ); @@ -137,7 +140,7 @@ function responsive_blog_single_elements() { function responsive_blog_single_elements_positioning() { // Default sections. - $sections = array( 'title', 'meta', 'featured_image', 'content' ); + $sections = array( 'categories', 'title', 'meta', 'featured_image' ); // Get sections from Customizer. $sections = get_theme_mod( 'responsive_blog_single_elements_positioning', $sections ); @@ -147,6 +150,9 @@ function responsive_blog_single_elements_positioning() { $sections = explode( ',', $sections ); } + // Ensure content is not in the array if an old setting has it. + $sections = array_diff( $sections, array( 'content' ) ); + // Apply filters for easy modification. $sections = apply_filters( 'responsive_blog_single_elements_positioning', $sections ); @@ -210,7 +216,7 @@ function responsive_hamburger_font_size_value() { function responsive_blog_single_meta() { /** Default sections */ - $sections = array( 'author', 'date', 'categories', 'comments', 'tag' ); + $sections = array( 'author', 'date', 'comments', 'tag' ); /** Get sections from Customizer */ $sections = get_theme_mod( 'responsive_blog_single_meta', $sections ); @@ -293,7 +299,9 @@ function responsive_page_elements() { array( 'title' => esc_html__( 'Title', 'responsive' ), 'featured_image' => esc_html__( 'Featured Image', 'responsive' ), - 'content' => esc_html__( 'Content', 'responsive' ), + 'breadcrumbs' => esc_html__( 'Breadcrumbs', 'responsive' ), + 'excerpt' => esc_html__( 'Excerpt', 'responsive' ), + 'meta' => esc_html__( 'Meta', 'responsive' ), ) ); @@ -833,7 +841,7 @@ function responsive_schema_markup( $location ) { */ function responsive_read_more_text( $text ) { - $read_more = get_theme_mod( 'responsive_blog_read_more_text', __( 'Read more »', 'responsive' ) ); + $read_more = get_theme_mod( 'responsive_blog_read_more_text', __( 'Read more →', 'responsive' ) ); if ( '' !== $read_more ) { $text = $read_more; } @@ -861,7 +869,7 @@ function responsive_custom_excerpt_length( $length ) { * * @since 3.17.2 * - * @return html + * @return string */ if ( ! function_exists( 'responsive_post_link' ) ) { @@ -869,11 +877,11 @@ function responsive_custom_excerpt_length( $length ) { * Function to get Read More Link of Post * * @param string $output_filter Filter string. - * @return html Markup. + * @return string Markup. */ function responsive_post_link( $output_filter = '' ) { - $read_more_text = apply_filters( 'responsive_post_read_more', __( 'Read More »', 'responsive' ) ); + $read_more_text = apply_filters( 'responsive_post_read_more', __( 'Read more →', 'responsive' ) ); $post_link = sprintf( esc_html( '%s' ), @@ -891,11 +899,11 @@ function responsive_post_link( $output_filter = '' ) { * Function to get Read More Link of Post * * @since 3.17.2 - * @return html + * @return string */ function responsive_modify_read_more_link() { - $read_more_text = apply_filters( 'responsive_post_read_more', __( 'Read More »', 'responsive' ) ); - return '
    ' . $read_more_text . ''; + $read_more_text = apply_filters( 'responsive_post_read_more', __( 'Read more →', 'responsive' ) ); + return '

    ' . $read_more_text . '

    '; } } @@ -929,6 +937,52 @@ function responsive_spacing_css( $top, $right, $bottom, $left ) { } } +if ( ! function_exists( 'responsive_format_margin_css_with_container_width' ) ) { + /** + * Return individual margin CSS rules handling custom width behavior. + * + * @param array $val Spacing values array with top, right, bottom, left. + * @param string $unit CSS unit (e.g., px, em). + * @param string $container_width Container width type ('custom' or 'full_width'). + * @return string CSS rules string. + */ + function responsive_format_margin_css_with_container_width( $val, $unit, $container_width = 'full_width' ) { + $t = isset( $val['top'] ) ? (string) $val['top'] : ''; + $r = isset( $val['right'] ) ? (string) $val['right'] : ''; + $b = isset( $val['bottom'] ) ? (string) $val['bottom'] : ''; + $l = isset( $val['left'] ) ? (string) $val['left'] : ''; + + if ( $t === '' && $r === '' && $b === '' && $l === '' ) { + if ( $container_width === 'custom' ) { + return 'margin: 0 0;'; + } + return ''; + } + $css = ''; + if ( $t !== '' ) { + $css .= "margin-top: {$t}{$unit}; "; + } + + if ( $r !== '' ) { + $css .= "margin-right: {$r}{$unit}; "; + } else if ( $container_width === 'custom' ) { + $css .= "margin-right: 0; "; + } + + if ( $b !== '' ) { + $css .= "margin-bottom: {$b}{$unit}; "; + } + + if ( $l !== '' ) { + $css .= "margin-left: {$l}{$unit}; "; + } else if ( $container_width === 'custom' ) { + $css .= "margin-left: 0; "; + } + + return trim( $css ); + } +} + /** * Responsive_padding_control. * @@ -1077,6 +1131,171 @@ function responsive_padding_control( $wp_customize, $element, $section, $priorit ); } +function responsive_unit_padding_control( $wp_customize, $element, $section, $priority, $default_values_y = '', $default_values_x = '', $active_call = null, $label = 'Padding', $transport = 'postMessage', $default_tablet_values_y = null, $default_tablet_values_x = null, $default_mobile_values_y = null, $default_mobile_values_x = null, $default_unit = 'px' ) { + /** + * Padding control. + */ + $wp_customize->add_setting( + 'responsive_' . $element . '_top_padding', + array( + 'transport' => $transport, + 'sanitize_callback' => 'responsive_sanitize_number', + 'default' => $default_values_y, + ) + ); + $wp_customize->add_setting( + 'responsive_' . $element . '_left_padding', + array( + 'transport' => $transport, + 'sanitize_callback' => 'responsive_sanitize_number', + 'default' => $default_values_x, + ) + ); + + $wp_customize->add_setting( + 'responsive_' . $element . '_bottom_padding', + array( + 'transport' => $transport, + 'sanitize_callback' => 'responsive_sanitize_number', + 'default' => $default_values_y, + ) + ); + $wp_customize->add_setting( + 'responsive_' . $element . '_right_padding', + array( + 'transport' => $transport, + 'sanitize_callback' => 'responsive_sanitize_number', + 'default' => $default_values_x, + ) + ); + $wp_customize->add_setting( + 'responsive_' . $element . '_tablet_top_padding', + array( + 'transport' => $transport, + 'sanitize_callback' => 'responsive_sanitize_number', + 'default' => isset( $default_tablet_values_y ) ? $default_tablet_values_y : $default_values_y, + ) + ); + $wp_customize->add_setting( + 'responsive_' . $element . '_tablet_right_padding', + array( + 'transport' => $transport, + 'sanitize_callback' => 'responsive_sanitize_number', + 'default' => isset( $default_tablet_values_x ) ? $default_tablet_values_x : $default_values_x, + ) + ); + $wp_customize->add_setting( + 'responsive_' . $element . '_tablet_bottom_padding', + array( + 'transport' => $transport, + 'sanitize_callback' => 'responsive_sanitize_number', + 'default' => isset( $default_tablet_values_y ) ? $default_tablet_values_y : $default_values_y, + ) + ); + $wp_customize->add_setting( + 'responsive_' . $element . '_tablet_left_padding', + array( + 'transport' => $transport, + 'sanitize_callback' => 'responsive_sanitize_number', + 'default' => isset( $default_tablet_values_x ) ? $default_tablet_values_x : $default_values_x, + ) + ); + + $wp_customize->add_setting( + 'responsive_' . $element . '_mobile_top_padding', + array( + 'transport' => $transport, + 'sanitize_callback' => 'responsive_sanitize_number', + 'default' => isset( $default_mobile_values_y ) ? $default_mobile_values_y : $default_values_y, + ) + ); + $wp_customize->add_setting( + 'responsive_' . $element . '_mobile_right_padding', + array( + 'transport' => $transport, + 'sanitize_callback' => 'responsive_sanitize_number', + 'default' => isset( $default_mobile_values_x ) ? $default_mobile_values_x : $default_values_x, + ) + ); + $wp_customize->add_setting( + 'responsive_' . $element . '_mobile_bottom_padding', + array( + 'transport' => $transport, + 'sanitize_callback' => 'responsive_sanitize_number', + 'default' => isset( $default_mobile_values_y ) ? $default_mobile_values_y : $default_values_y, + ) + ); + $wp_customize->add_setting( + 'responsive_' . $element . '_mobile_left_padding', + array( + 'transport' => $transport, + 'sanitize_callback' => 'responsive_sanitize_number', + 'default' => isset( $default_mobile_values_x ) ? $default_mobile_values_x : $default_values_x, + ) + ); + + // Unit settings + $wp_customize->add_setting( + 'responsive_' . $element . '_desktop_unit', + array( + 'transport' => $transport, + 'sanitize_callback' => 'sanitize_text_field', + 'default' => $default_unit, + ) + ); + $wp_customize->add_setting( + 'responsive_' . $element . '_tablet_unit', + array( + 'transport' => $transport, + 'sanitize_callback' => 'sanitize_text_field', + 'default' => $default_unit, + ) + ); + $wp_customize->add_setting( + 'responsive_' . $element . '_mobile_unit', + array( + 'transport' => $transport, + 'sanitize_callback' => 'sanitize_text_field', + 'default' => $default_unit, + ) + ); + + $wp_customize->add_control( + new Responsive_Customizer_Unit_Dimensions_Control( + $wp_customize, + 'responsive_' . $element . '_padding', + array( + 'label' => $label, + 'section' => $section, + 'settings' => array( + 'desktop_top' => 'responsive_' . $element . '_top_padding', + 'desktop_right' => 'responsive_' . $element . '_right_padding', + 'desktop_bottom' => 'responsive_' . $element . '_bottom_padding', + 'desktop_left' => 'responsive_' . $element . '_left_padding', + 'tablet_top' => 'responsive_' . $element . '_tablet_top_padding', + 'tablet_right' => 'responsive_' . $element . '_tablet_right_padding', + 'tablet_bottom' => 'responsive_' . $element . '_tablet_bottom_padding', + 'tablet_left' => 'responsive_' . $element . '_tablet_left_padding', + 'mobile_top' => 'responsive_' . $element . '_mobile_top_padding', + 'mobile_right' => 'responsive_' . $element . '_mobile_right_padding', + 'mobile_bottom' => 'responsive_' . $element . '_mobile_bottom_padding', + 'mobile_left' => 'responsive_' . $element . '_mobile_left_padding', + 'desktop_unit' => 'responsive_' . $element . '_desktop_unit', + 'tablet_unit' => 'responsive_' . $element . '_tablet_unit', + 'mobile_unit' => 'responsive_' . $element . '_mobile_unit', + ), + 'priority' => $priority, + 'active_callback' => $active_call, + 'input_attrs' => array( + 'min' => 0, + 'max' => 500, + 'step' => 1, + ), + ) + ) + ); +} + /** * Responsive_Borderwidth_Control. * @@ -1756,6 +1975,18 @@ function responsive_active_site_layout_contained() { return ( 'contained' === $header_layout ) ? true : false; } +/** + * responsive_active_site_layout_narrow. + * + * @return bool + */ +function responsive_active_site_layout_narrow() { + + $header_layout = get_theme_mod( 'responsive_width', 'contained' ); + + return ( 'narrow' === $header_layout ) ? true : false; +} + /** * [responsive_not_active_site_style_flat description] * @@ -1774,6 +2005,9 @@ function responsive_not_active_site_style_flat() { * @return [type] [description] */ function responsive_active_single_blog_sidebar_position() { + if ( ! responsive_active_single_blog_sidebar_section() ) { + return false; + } $position = get_theme_mod( 'responsive_single_blog_sidebar_position', 'global' ); if ( 'global' === $position ) { $global_position = get_theme_mod( 'responsive_default_sidebar_position', 'no' ); @@ -1788,6 +2022,9 @@ function responsive_active_single_blog_sidebar_position() { * @return [type] [description] */ function responsive_active_blog_sidebar_position() { + if ( ! responsive_active_blog_sidebar_section() ) { + return false; + } $position = get_theme_mod( 'responsive_blog_sidebar_position', 'global' ); if ( 'global' === $position ) { $global_position = get_theme_mod( 'responsive_default_sidebar_position', 'no' ); @@ -1801,6 +2038,43 @@ function responsive_active_default_sidebar_position() { return ( 'no' !== $position && 'global' !== $position ) ? true : false; } +/** + * Check if the layout resolves to narrow container. + * + * @param string $container_layout The container layout setting value. + * @return bool + */ +function responsive_is_layout_narrow( $container_layout ) { + $global_container = get_theme_mod( 'responsive_width', 'contained' ); + $global_resolved = ( 'full-width' === $global_container ) ? 'full-width' : ( ( 'narrow' === $global_container ) ? 'narrow' : 'normal' ); + $resolved = ( 'default' === $container_layout || 'default_container' === $container_layout ) ? $global_resolved : $container_layout; + return 'narrow' === $resolved; +} + +/** + * Active callbacks for sidebar sections when container layout is narrow. + */ +function responsive_active_page_sidebar_section() { + return ! responsive_is_layout_narrow( get_theme_mod( 'responsive_page_container_layout', 'default_container' ) ); +} + +function responsive_active_blog_sidebar_section() { + return ! responsive_is_layout_narrow( get_theme_mod( 'responsive_blog_container_layout', 'default_container' ) ); +} + +function responsive_active_single_blog_sidebar_section() { + return ! responsive_is_layout_narrow( get_theme_mod( 'responsive_single_blog_container_layout', 'default_container' ) ); +} + +function responsive_active_shop_sidebar_section() { + return ! responsive_is_layout_narrow( get_theme_mod( 'responsive_product_catalog_container_layout', 'default_container' ) ); +} + +function responsive_active_single_product_sidebar_section() { + return ! responsive_is_layout_narrow( get_theme_mod( 'responsive_single_product_container_layout', 'default_container' ) ); +} + + /** * [responsive_not_active_page_sidebar description] * @@ -1855,6 +2129,9 @@ function responsive_not_active_single_post_sidebar() { * @return [type] [description] */ function responsive_active_page_sidebar_position() { + if ( ! responsive_active_page_sidebar_section() ) { + return false; + } $position = get_theme_mod( 'responsive_page_sidebar_position', 'global' ); if ( 'global' === $position ) { $global_position = get_theme_mod( 'responsive_default_sidebar_position', 'no' ); @@ -1869,6 +2146,9 @@ function responsive_active_page_sidebar_position() { * @return [type] [description] */ function responsive_active_shop_sidebar_position() { + if ( ! responsive_active_shop_sidebar_section() ) { + return false; + } $position = get_theme_mod( 'responsive_shop_sidebar_position', 'global' ); if ( 'global' === $position ) { $global_position = get_theme_mod( 'responsive_default_sidebar_position', 'no' ); @@ -1883,6 +2163,9 @@ function responsive_active_shop_sidebar_position() { * @return [type] [description] */ function responsive_active_single_product_sidebar_position() { + if ( ! responsive_active_single_product_sidebar_section() ) { + return false; + } $position = get_theme_mod( 'responsive_single_product_sidebar_position', 'global' ); if ( 'global' === $position ) { $global_position = get_theme_mod( 'responsive_default_sidebar_position', 'no' ); @@ -2010,13 +2293,13 @@ function responsive_get_available_design_styles() { 'color_schemes' => array( 'default' => array( 'label' => _x( 'Default', 'color palette name', 'responsive' ), - 'accent' => '#0066CC', + 'accent' => '#3B82F6', 'link_hover' => '#10659C', - 'text' => '#333333', - 'header_text' => '#333333', + 'text' => '#404040', + 'header_text' => '#404040', 'content_background' => '#ffffff', 'site_background' => '#f0f5fa', - 'alt_background' => '#eaeaea', + 'alt_background' => '#ffffff', 'subtle_background' => '#10659C' ), @@ -4212,3 +4495,14 @@ function responsive_section_toggle_control( $wp_customize, $element, $label, $se ) ); } + +if ( ! function_exists( 'responsive_show_post_author_box' ) ) { + /** + * Determines whether the Author Box Style control should show. + * + * @return bool true if author box is NOT disabled, false otherwise. + */ + function responsive_show_post_author_box() { + return ! (bool) get_theme_mod( 'responsive_disable_author_meta', 0 ); + } +} diff --git a/core/includes/customizer/sanitization-callbacks.php b/core/includes/customizer/sanitization-callbacks.php index 0e6d0e70c..248b368c1 100644 --- a/core/includes/customizer/sanitization-callbacks.php +++ b/core/includes/customizer/sanitization-callbacks.php @@ -139,8 +139,8 @@ function responsive_sanitize_number_blank( $val ) { * @since 1.2.1 */ function responsive_sanitize_select( $input, $setting ) { - // Ensure input is a slug. - $input = sanitize_key( $input ); + // Ensure input is sanitized. + $input = sanitize_text_field( $input ); // Get list of choices from the control associated with the setting. $choices = $setting->manager->get_control( $setting->id )->choices; @@ -340,8 +340,8 @@ function responsive_sanitize_row_layout_select( $input ) { * @since 6.2.6 */ function responsive_sanitize_select_with_switchers( $input, $setting ) { - // Ensure input is a valid slug. - $input = sanitize_key( $input ); + // Ensure input is sanitized. + $input = sanitize_text_field( $input ); // Get the control ID (desktop/tablet/mobile share the same base control). $base_control_id = str_replace( array( '_tablet', '_mobile' ), '', $setting->id ); diff --git a/core/includes/customizer/settings/class-responsive-blog-customizer.php b/core/includes/customizer/settings/class-responsive-blog-customizer.php index 5e32edef8..0e60b1ea0 100644 --- a/core/includes/customizer/settings/class-responsive-blog-customizer.php +++ b/core/includes/customizer/settings/class-responsive-blog-customizer.php @@ -66,7 +66,101 @@ public function customizer_options( $wp_customize ) { responsive_horizontal_separator_control($wp_customize, 'blog_image_positions_layout_separator', 1, 'responsive_blog_layout', 47, 1, 'responsive_active_blog_layout_list' ); /* End of blog layout setting */ + /* Border radius setting */ + $wp_customize->add_setting( + 'blog_border_radius', + array( + 'default' => 'default', + 'transport' => 'refresh', + 'sanitize_callback' => 'responsive_sanitize_select', + ) + ); + $blog_border_radius_label = esc_html__( 'Border Radius (px)', 'responsive' ); + responsive_radius_control($wp_customize, 'blog_border_radius', 'responsive_blog_layout', 30, 6, 6, null, $blog_border_radius_label, 'postMessage',); + /* End of Border radius setting */ + responsive_horizontal_separator_control($wp_customize, 'blog_border_radius_separator', 1, 'responsive_blog_layout', 32, 1, null ); + + // Post Title Size. + $blog_post_title_size_label = esc_html__( 'Post Title Size', 'responsive' ); + responsive_drag_number_control( $wp_customize, 'blog_post_title_size', $blog_post_title_size_label, 'responsive_blog_layout', 79, 20, null, 100, 8, 'postMessage', 1 ); + + // Meta Font Size. + $blog_meta_font_size_label = esc_html__( 'Meta Font Size', 'responsive' ); + responsive_drag_number_control( $wp_customize, 'blog_meta_font_size', $blog_meta_font_size_label, 'responsive_blog_layout', 91, 14, null, 60, 8, 'postMessage', 1 ); + + // Taxonomy Font Size. + $blog_taxonomy_font_size_label = esc_html__( 'Taxonomy Font Size', 'responsive' ); + responsive_drag_number_control( $wp_customize, 'blog_taxonomy_font_size', $blog_taxonomy_font_size_label, 'responsive_blog_layout', 93, 14, null, 60, 8, 'postMessage', 1 ); + + responsive_horizontal_separator_control($wp_customize, 'blog_taxonomy_font_separator', 1, 'responsive_blog_layout', 94, 1, null ); + + $blog_category_color_label = __( 'Item Category Color', 'responsive' ); + responsive_color_control( + $wp_customize, + 'blog_category', + $blog_category_color_label, + 'responsive_blog_layout', + 94, + Responsive\Core\get_responsive_customizer_defaults( 'responsive_blog_category_color' ), + null, + '', + true, + Responsive\Core\get_responsive_customizer_defaults( 'blog_category_hover' ), + 'blog_category_hover', + 'refresh', + ); + + $item_category_typography_label = esc_html__( 'Item Category Font', 'responsive' ); + + responsive_typography_group_control( + $wp_customize, + 'item_category_typography_group', + $item_category_typography_label, + 'responsive_blog_layout', + 95, + 'item_category_typography' + ); + + $blog_meta_color_label = __( 'Item Meta Color', 'responsive' ); + responsive_color_control( + $wp_customize, + 'blog_item_meta', + $blog_meta_color_label, + 'responsive_blog_layout', + 96, + Responsive\Core\get_responsive_customizer_defaults( 'responsive_blog_item_meta_color' ), + null, + '', + true, + Responsive\Core\get_responsive_customizer_defaults( 'blog_item_meta_hover' ), + 'blog_item_meta_hover', + 'refresh', + ); + + $item_meta_typography_label = esc_html__( 'Item Meta Font', 'responsive' ); + + responsive_typography_group_control( + $wp_customize, + 'item_meta_typography_group', + $item_meta_typography_label, + 'responsive_blog_layout', + 97, + 'item_meta_typography' + ); + + responsive_horizontal_separator_control($wp_customize, 'blog_item_meta_font_separator', 1, 'responsive_blog_layout', 98, 1, null ); + + // Blog/Archive Site Background Color. + $blog_site_background_color_label = __( 'Site Background', 'responsive' ); + responsive_color_control( $wp_customize, 'blog_site_background', $blog_site_background_color_label, 'responsive_blog_layout', 99, Responsive\Core\get_responsive_customizer_defaults('responsive_blog_site_background_color') ); + + // Blog/Archive Content Background Color. + $blog_content_background_color_label = __( 'Content Background', 'responsive' ); + responsive_color_control( $wp_customize, 'blog_content_background', $blog_content_background_color_label, 'responsive_blog_layout', 100, Responsive\Core\get_responsive_customizer_defaults('responsive_blog_content_background_color') ); + + responsive_horizontal_separator_control($wp_customize, 'blog_content_background_separator', 1, 'responsive_blog_layout', 101, 1, null ); + /* Date box setting */ $date_box_label = esc_html__( 'Enable Date Box', 'responsive' ); responsive_toggle_control( $wp_customize, 'date_box_toggle', $date_box_label, 'responsive_blog_layout', 280, 0, '' ); /* End of date box setting */ @@ -155,7 +249,7 @@ public function customizer_options( $wp_customize ) { 'responsive_disable_author_meta', array( 'label' => __( ' Disable Author Profile Box ?', 'responsive' ), - 'section' => 'responsive_single_blog_layout', + 'section' => 'responsive_single_blog_post_title_layout', 'settings' => 'responsive_disable_author_meta', 'priority' => 105, ) diff --git a/core/includes/customizer/settings/class-responsive-blog-layout-customizer.php b/core/includes/customizer/settings/class-responsive-blog-layout-customizer.php index d06a1cb2e..4e9e3b140 100644 --- a/core/includes/customizer/settings/class-responsive-blog-layout-customizer.php +++ b/core/includes/customizer/settings/class-responsive-blog-layout-customizer.php @@ -65,13 +65,24 @@ public function customizer_options( $wp_customize ) { $tabs_label = esc_html__( 'Tabs', 'responsive' ); $design_tab_ids_prefix = 'customize-control-'; $design_tab_ids = array( + $design_tab_ids_prefix . 'responsive_border_blog_border_radius', $design_tab_ids_prefix . 'responsive_date_box_toggle', $design_tab_ids_prefix . 'responsive_date_box_toggle_separator', $design_tab_ids_prefix . 'responsive_date_box_style', + $design_tab_ids_prefix . 'responsive_blog_post_title_size', + $design_tab_ids_prefix . 'responsive_blog_meta_font_size', + $design_tab_ids_prefix . 'responsive_blog_taxonomy_font_size', + $design_tab_ids_prefix . 'responsive_blog_category_color', + $design_tab_ids_prefix . 'responsive_item_category_typography_group', + $design_tab_ids_prefix . 'responsive_item_meta_typography_group', + $design_tab_ids_prefix . 'responsive_blog_item_meta_color', + $design_tab_ids_prefix . 'responsive_blog_site_background_color', + $design_tab_ids_prefix . 'responsive_blog_content_background_color', ); $general_tab_ids_prefix = 'customize-control-'; $general_tab_ids = array( + $general_tab_ids_prefix . 'responsive_blog_title_area', $general_tab_ids_prefix . 'responsive_blog_post_title_toggle', $general_tab_ids_prefix . 'res_blog_post_title_text', $general_tab_ids_prefix . 'responsive_blog_post_title_toggle_separator', @@ -127,10 +138,121 @@ public function customizer_options( $wp_customize ) { $general_tab_ids_prefix . 'responsive_blog_container_style', $general_tab_ids_prefix . 'responsive_blog_container_style_separator', $general_tab_ids_prefix . 'responsive_blog_container_layout_separator', + $general_tab_ids_prefix . 'responsive_blog_post_per_page', ); responsive_tabs_button_control( $wp_customize, 'blog_archive_tabs', $tabs_label, 'responsive_blog_layout', 1, '', 'responsive_blog_layout_general_tab', 'responsive_blog_layout_design_tab', $general_tab_ids, $design_tab_ids, null ); + // Blog Title Tabs + $blog_title_area_general_tab_ids = [ + 'customize-control-responsive_blog_title_layout', + 'customize-control-responsive_blog_title_elements_positioning', + 'customize-control-responsive_blog_title_description', + 'customize-control-responsive_blog_post_title_toggle', + 'customize-control-res_blog_post_title_text', + 'customize-control-responsive_blog_post_title_horizontal_alignment', + 'customize-control-responsive_blog_single_meta', + 'customize-control-responsive_responsive_blog_single_meta_separator', + 'customize-control-responsive_blog_single_elements_positioning', + 'customize-control-responsive_blog_post_title_vertical_alignment' + + ]; + + $blog_title_area_design_tab_ids = [ + 'customize-control-responsive_blog_banner_min_height', + 'customize-control-responsive_blog_banner_background_color', + 'customize-control-responsive_blog_post_title_inner_elements_spacing', + 'customize-control-responsive_blog_post_title_inner_elements_spacing_separator', + 'customize-control-responsive_blog_banner_padding_padding', + 'customize-control-responsive_blog_banner_margin_padding', + 'customize-control-responsive_blog_post_title_color', + 'customize-control-responsive_blog_post_text_color', + 'customize-control-responsive_blog_post_link_color', + 'customize-control-responsive_blog_post_link_hover_color', + 'customize-control-responsive_blog_post_link_hover_separator', + 'customize-control-responsive_blog_post_title_typography_group', + 'customize-control-responsive_blog_post_text_typography_group', + 'customize-control-responsive_blog_post_text_typography_group_separator' + ]; + + // Blog Title Area Toggle + responsive_section_toggle_control( $wp_customize, 'blog_title_area', __( 'Blog Title Area', 'responsive' ), 'responsive_blog_layout', 5, 'section', 'responsive_blog_title_layout', true, null, 'refresh', 'Enable the toggle to customize blog title area settings.'); + + // Blog Title Area Tabs + $tabs_label = esc_html__( 'Tabs', 'responsive' ); + + responsive_tabs_button_control( $wp_customize, 'blog_title_area_tabs', $tabs_label, 'responsive_blog_title_layout', 1, '', 'responsive_blog_title_general_tab', 'responsive_blog_title_design_tab', $blog_title_area_general_tab_ids, $blog_title_area_design_tab_ids, null ); + + $blog_title_layout_choices = array( + 'post_title_layout1' => esc_html__( 'Layout 1', 'responsive' ), + 'post_title_layout2' => esc_html__( 'Layout 2', 'responsive' ), + ); + + $blog_title_layout_label = esc_html__( 'Banner Layout', 'responsive' ); + + responsive_imageradio_button_control( $wp_customize, 'blog_title_layout', $blog_title_layout_label, 'responsive_blog_title_layout', 1, $blog_title_layout_choices, 'post_title_layout1', null, 'svg', 'refresh' ); + + // Container Width. + $blog_banner_container_width_label = esc_html__( 'Container Width', 'responsive' ); + $blog_banner_container_width_choices = array( + 'full_width' => esc_html__( 'Full Width', 'responsive' ), + 'custom' => esc_html__( 'Custom', 'responsive' ), + ); + responsive_select_button_control( $wp_customize, 'blog_banner_container_width', $blog_banner_container_width_label, 'responsive_blog_title_layout', 2, $blog_banner_container_width_choices, 'full_width', null, 'refresh' ); + + // Custom Width. + $blog_banner_custom_width_label = esc_html__( 'Custom Width', 'responsive' ); + responsive_drag_number_control( $wp_customize, 'blog_banner_custom_width', $blog_banner_custom_width_label, 'responsive_blog_title_layout', 3, 1200, null, 1920, 768, 'postMessage' ); + + $wp_customize->add_setting( + 'responsive_blog_title_elements_positioning', + array( + 'default' => array( 'title', 'description', 'breadcrumb' ), + 'sanitize_callback' => 'responsive_sanitize_multi_choices', + 'transport' => 'refresh', + ) + ); + + $wp_customize->add_control( + new Responsive_Customizer_Sortable_Control( + $wp_customize, + 'responsive_blog_title_elements_positioning', + array( + 'label' => esc_html__( 'Blog Title Elements', 'responsive' ), + 'description' => esc_html__( 'Note: Title and description only appear when Layout 2 is selected.', 'responsive' ), + 'section' => 'responsive_blog_title_layout', + 'settings' => 'responsive_blog_title_elements_positioning', + 'priority' => 5, + 'choices' => array( + 'title' => esc_html__( 'Title', 'responsive' ), + 'description' => esc_html__( 'Description', 'responsive' ), + 'breadcrumb' => esc_html__( 'Breadcrumb', 'responsive' ), + ), + ) + ) + ); + + $wp_customize->add_setting( + 'responsive_blog_title_description', + array( + 'default' => '', + 'sanitize_callback' => 'wp_kses_post', + 'transport' => 'refresh', + ) + ); + + $wp_customize->add_control( + 'responsive_blog_title_description', + array( + 'label' => esc_html__( 'Blog Description', 'responsive' ), + 'description' => esc_html__( 'Note: Title and description only appear when Layout 2 is selected.', 'responsive' ), + 'section' => 'responsive_blog_title_layout', + 'settings' => 'responsive_blog_title_description', + 'type' => 'textarea', + 'priority' => 8, + ) + ); + $wp_customize->add_setting( 'responsive_blog_post_title_toggle', array( @@ -144,14 +266,85 @@ public function customizer_options( $wp_customize ) { $wp_customize, 'responsive_blog_post_title_toggle', array( - 'label' => __( 'Enable Blog Page Title', 'responsive' ), - 'section' => 'responsive_blog_layout', + 'label' => __( 'Enable on Blog / Posts Page?', 'responsive' ), + 'section' => 'responsive_blog_title_layout', 'settings' => 'responsive_blog_post_title_toggle', - 'priority' => 10, + 'priority' => 6, ) ) ); + // Vertical Alignment. + $blog_post_title_vertical_alignment_label = esc_html__( 'Vertical Alignment', 'responsive' ); + $blog_post_title_vertical_alignment_choices = array( + 'flex-start' => esc_html__( 'Top', 'responsive' ), + 'center' => esc_html__( 'Middle', 'responsive' ), + 'flex-end' => esc_html__( 'Bottom', 'responsive' ), + ); + + // Blog Post Title Vertical Alignment + responsive_select_button_control( $wp_customize, 'blog_post_title_vertical_alignment', $blog_post_title_vertical_alignment_label, 'responsive_blog_title_layout', 8, $blog_post_title_vertical_alignment_choices, 'flex-start', null ); + + // Horizontal Alignment. + $blog_post_title_horizontal_alignment_label = esc_html__( 'Horizontal Alignment', 'responsive' ); + $blog_post_title_horizontal_alignment_choices = array( + 'flex-start' => esc_html__( 'Left', 'responsive' ), + 'center' => esc_html__( 'Center', 'responsive' ), + 'flex-end' => esc_html__( 'Right', 'responsive' ), + ); + + // Blog Post Title Horizontal Alignment + responsive_select_button_with_switchers_control( $wp_customize, 'blog_post_title_horizontal_alignment', $blog_post_title_horizontal_alignment_label, 'responsive_blog_title_layout', 9, $blog_post_title_horizontal_alignment_choices, 'center', null, 'refresh', '', 'center', 'center' ); + + + // Banner Min Height + $blog_banner_min_height_label = esc_html__( 'Banner Min Height', 'responsive' ); + responsive_drag_number_control_with_switchers( $wp_customize, 'blog_banner_min_height', $blog_banner_min_height_label, 'responsive_blog_title_layout', 21, 0, null, 1000, 0, 'postMessage' ); + + // Banner Background Color + $blog_banner_background_color_label = __( 'Banner Background Color', 'responsive' ); + responsive_color_control_with_device_switchers( $wp_customize, 'blog_banner_background', $blog_banner_background_color_label, 'responsive_blog_title_layout', 22, '#ffffff' ); + + // Inner Elements Spacing + $blog_post_title_inner_elements_spacing_label = esc_html__( 'Inner Elements Spacing', 'responsive' ); + responsive_drag_number_control( $wp_customize, 'blog_post_title_inner_elements_spacing', $blog_post_title_inner_elements_spacing_label, 'responsive_blog_title_layout', 23, Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_title_inner_elements_spacing' ), null, 100, 1, 'postMessage' ); + + responsive_horizontal_separator_control( $wp_customize, 'blog_post_title_inner_elements_spacing_separator', 1, 'responsive_blog_title_layout',24, 1 ); + + // Padding + responsive_unit_padding_control( $wp_customize, 'blog_banner_padding', 'responsive_blog_title_layout', 51, 30, 30, null, __( 'Padding', 'responsive' ), 'postMessage', 30, 30, 30, 30, 'px' ); + + // Margin + responsive_unit_padding_control( $wp_customize, 'blog_banner_margin', 'responsive_blog_title_layout', 56, 0, 0, null, __( 'Margin', 'responsive' ), 'postMessage', 0, 0, 0, 0, 'px', 24, null, 24, null, 24, null ); + + // Blog Post Title Color + $blog_post_title_color_label = __( 'Title Color', 'responsive' ); + responsive_color_control( $wp_customize, 'blog_post_title', $blog_post_title_color_label, 'responsive_blog_title_layout', 27, Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_title_color' ) ); + + // Blog Post Text Color + $blog_post_text_color_label = __( 'Text Color', 'responsive' ); + responsive_color_control( $wp_customize, 'blog_post_text', $blog_post_text_color_label, 'responsive_blog_title_layout', 28, Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_text_color' ) ); + + // Blog Post Link Color + $blog_post_link_color_label = __( 'Link Color', 'responsive' ); + responsive_color_control( $wp_customize, 'blog_post_link', $blog_post_link_color_label, 'responsive_blog_title_layout', 29, Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_link_color' ) ); + + // Blog Post Link Hover Color + $blog_post_link_hover_color_label = __( 'Link Hover Color', 'responsive' ); + responsive_color_control( $wp_customize, 'blog_post_link_hover', $blog_post_link_hover_color_label, 'responsive_blog_title_layout', 30, Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_link_hover_color' ) ); + + responsive_horizontal_separator_control( $wp_customize, 'blog_post_link_hover_separator', 1, 'responsive_blog_title_layout',30, 1 ); + + // Blog Post Title Font + $blog_post_title_typography_label = __( 'Title Font', 'responsive' ); + responsive_typography_group_control( $wp_customize, 'blog_post_title_typography_group', $blog_post_title_typography_label, 'responsive_blog_title_layout', 35, 'blog_post_title_typography', true ); + + // Blog Post Text Font + $blog_post_text_typography_label = __( 'Text Font', 'responsive' ); + responsive_typography_group_control( $wp_customize, 'blog_post_text_typography_group', $blog_post_text_typography_label, 'responsive_blog_title_layout', 40, 'blog_post_text_typography', true ); + + responsive_horizontal_separator_control( $wp_customize, 'blog_post_text_typography_group_separator', 1, 'responsive_blog_title_layout',41, 1 ); + $wp_customize->add_setting( 'responsive_theme_options[blog_post_title_text]', array( @@ -164,10 +357,10 @@ public function customizer_options( $wp_customize ) { 'res_blog_post_title_text', array( 'label' => __( 'Blog Page Title', 'responsive' ), - 'section' => 'responsive_blog_layout', + 'section' => 'responsive_blog_title_layout', 'settings' => 'responsive_theme_options[blog_post_title_text]', 'type' => 'text', - 'priority' => 20, + 'priority' => 7, 'active_callback' => 'responsive_blog_post_title_toggle_callback', ) ); @@ -207,6 +400,11 @@ public function customizer_options( $wp_customize ) { $blog_content_width_label = esc_html__( 'Main Content Width (%)', 'responsive' ); responsive_drag_number_control( $wp_customize, 'blog_content_width', $blog_content_width_label, 'responsive_blog_layout', 60, Responsive\Core\get_responsive_customizer_defaults( 'blog_content_width' ), null, 100, 1, 'postMessage' ); + + responsive_horizontal_separator_control($wp_customize, 'blog_content_width_separator', 1, 'responsive_blog_layout', 61, 1 ); + + $blog_post_per_page_label = esc_html__( 'Post Per Page', 'responsive' ); + responsive_drag_number_control_with_switchers( $wp_customize, 'blog_post_per_page', $blog_post_per_page_label, 'responsive_blog_layout', 62, 10, null, 100, 0, 'refresh', 1 ); $blog_post_elements_heading_label = esc_html__( 'Post Structure', 'responsive' ); responsive_separator_control( $wp_customize, 'blog_post_elements_head', $blog_post_elements_heading_label, 'responsive_blog_layout', 65 ); @@ -233,10 +431,32 @@ public function customizer_options( $wp_customize ) { 'settings' => 'responsive_blog_entry_elements_positioning', 'priority' => 70, 'choices' => responsive_blog_entry_elements(), + 'sub_controls' => array( + 'meta' => array( + 'responsive_blog_entry_meta_divider' + ) + ), ) ) ); + $wp_customize->add_setting( + 'responsive_blog_entry_meta_divider', + array( + 'default' => '/', + 'sanitize_callback' => 'sanitize_text_field', + 'transport' => 'refresh', + ) + ); + $wp_customize->add_control( + 'responsive_blog_entry_meta_divider', + array( + 'section' => 'responsive_blog_layout', + 'settings' => 'responsive_blog_entry_meta_divider', + 'type' => 'hidden', + ) + ); + /** * Entry Elements. */ @@ -255,7 +475,7 @@ public function customizer_options( $wp_customize ) { 'default' => esc_html__( 'Default', 'responsive' ), 'stretched' => esc_html__( 'Stretched', 'responsive' ), ); - responsive_select_button_control( $wp_customize, 'blog_entry_featured_image_style', $featured_image_style_label, 'responsive_blog_layout', 100, $featured_image_style_choices, 'default', null, 'postMessage' ); + responsive_select_button_control( $wp_customize, 'blog_entry_featured_image_style', $featured_image_style_label, 'responsive_blog_layout', 100, $featured_image_style_choices, 'stretched', null, 'postMessage' ); responsive_horizontal_separator_control($wp_customize, 'blog_entry_featured_image_style_separator', 1, 'responsive_blog_layout', 102, 1, ); // Featured Image Alignment. $featured_image_alignment_label = esc_html__( 'Image Alignment', 'responsive' ); @@ -333,17 +553,104 @@ public function customizer_options( $wp_customize ) { 'tag' => esc_html__( 'Tag', 'responsive' ), ) ), + 'sub_controls' => array( + 'author' => array( + 'responsive_blog_author_prefix_label', + 'responsive_blog_author_avatar', + 'responsive_blog_author_avatar_size' + ), + 'date' => array( + 'responsive_blog_date_format' + ), + 'updated' => array( + 'responsive_blog_updated_format' + ), + 'categories' => array( + 'responsive_blog_categories_style' + ), + 'tag' => array( + 'responsive_blog_tag_style' + ) + ), ) ) ); + // Author Meta Sub-Controls + $wp_customize->add_setting( + 'responsive_blog_author_prefix_label', + array( + 'default' => 'By', + 'sanitize_callback' => 'sanitize_text_field', + 'transport' => 'refresh', + ) + ); + + $wp_customize->add_setting( + 'responsive_blog_author_avatar', + array( + 'default' => 0, + 'sanitize_callback' => 'responsive_sanitize_toggle', + 'transport' => 'refresh', + ) + ); + + $wp_customize->add_setting( + 'responsive_blog_author_avatar_size', + array( + 'default' => 30, + 'sanitize_callback' => 'responsive_sanitize_number', + 'transport' => 'postMessage', + ) + ); + + // Date Meta Sub-Controls + $wp_customize->add_setting( + 'responsive_blog_date_format', + array( + 'default' => 'default', + 'sanitize_callback' => 'sanitize_text_field', + 'transport' => 'refresh', + ) + ); + + // Updated Meta Sub-Controls + $wp_customize->add_setting( + 'responsive_blog_updated_format', + array( + 'default' => 'default', + 'sanitize_callback' => 'sanitize_text_field', + 'transport' => 'refresh', + ) + ); + + // Categories Meta Sub-Controls + $wp_customize->add_setting( + 'responsive_blog_categories_style', + array( + 'default' => 'default', + 'sanitize_callback' => 'sanitize_text_field', + 'transport' => 'refresh', + ) + ); + + // Tag Meta Sub-Controls + $wp_customize->add_setting( + 'responsive_blog_tag_style', + array( + 'default' => 'default', + 'sanitize_callback' => 'sanitize_text_field', + 'transport' => 'refresh', + ) + ); + responsive_horizontal_separator_control($wp_customize, 'blog_entry_meta_separator_text_separator', 1, 'responsive_blog_layout', 82, 1, ); // Meta Separator Text. $wp_customize->add_setting( 'responsive_blog_entry_meta_separator_text', array( - 'default' => '-', + 'default' => '•', 'sanitize_callback' => 'wp_check_invalid_utf8', 'type' => 'theme_mod', 'transport' => 'postMessage', @@ -403,7 +710,7 @@ public function customizer_options( $wp_customize ) { 'right' => esc_html__( 'dashicons-editor-alignright', 'responsive' ), ); if ( is_rtl() ) { - $single_blog_content_alignment_choices = array( + $blog_entry_content_alignment_choices = array( 'justify' => esc_html__( 'dashicons-editor-justify', 'responsive' ), 'left' => esc_html__( 'dashicons-editor-alignright', 'responsive' ), 'center' => esc_html__( 'dashicons-editor-aligncenter', 'responsive' ), diff --git a/core/includes/customizer/settings/class-responsive-container-layout-customizer.php b/core/includes/customizer/settings/class-responsive-container-layout-customizer.php index 835949ab3..c17fb5137 100644 --- a/core/includes/customizer/settings/class-responsive-container-layout-customizer.php +++ b/core/includes/customizer/settings/class-responsive-container-layout-customizer.php @@ -36,9 +36,40 @@ public function __construct() { */ public function customizer_options( $wp_customize ) { + // Adding Single Blog Post Title Layout Setting + $wp_customize->add_section( + 'responsive_single_blog_post_title_layout', + array( + 'title' => esc_html__( 'Post Title Area', 'responsive' ), + 'panel' => 'responsive_post_types', + 'priority' => 30, + ) + ); + + // Adding Single Page - Page Title Layout Setting + $wp_customize->add_section( + 'responsive_page_title_area_layout', + array( + 'title' => esc_html__( 'Page Title Area', 'responsive' ), + 'panel' => 'responsive_post_types', + 'priority' => 35, + ) + ); + + // Adding Blog/Archive - Blog Title Layout Setting + $wp_customize->add_section( + 'responsive_blog_title_layout', + array( + 'title' => esc_html( 'Blog Title Area', 'resposnive' ), + 'panel' => 'responsive_post_types', + 'priority' => 40 + ) + ); + $container_layout_choices = array( 'default_container' => esc_html__( 'Default', 'responsive' ), 'normal' => esc_html__( 'Normal', 'responsive' ), + 'narrow' => esc_html__( 'Narrow', 'responsive' ), 'full-width' => esc_html__( 'Full Width', 'responsive' ), ); diff --git a/core/includes/customizer/settings/class-responsive-container-spacing-customizer.php b/core/includes/customizer/settings/class-responsive-container-spacing-customizer.php index 91e9746c7..b09503cc4 100644 --- a/core/includes/customizer/settings/class-responsive-container-spacing-customizer.php +++ b/core/includes/customizer/settings/class-responsive-container-spacing-customizer.php @@ -35,36 +35,34 @@ public function customizer_options( $wp_customize ) { // Outside Container. $outside_container_label = __( 'Outside Container (px)', 'responsive' ); - responsive_padding_control( $wp_customize, 'outside_container', 'responsive_layout', 70, 0, 15, 'responsive_not_active_site_style_flat', $outside_container_label ); + responsive_padding_control( $wp_customize, 'outside_container', 'responsive_layout', 70, 0, 12, 'responsive_not_active_site_style_flat', $outside_container_label ); $container_spacing_label = esc_html__( 'Spacing', 'responsive' ); responsive_separator_control( $wp_customize, 'blog_container_spacing', $container_spacing_label, 'responsive_blog_layout', 250 ); // Outside Container. $outside_container_label = __( 'Outside Container (px)', 'responsive' ); - responsive_padding_control( $wp_customize, 'blog_outside_container', 'responsive_blog_layout', 260, 0, 15, 'responsive_not_active_site_style_flat', $outside_container_label ); + responsive_padding_control( $wp_customize, 'blog_outside_container', 'responsive_blog_layout', 260, 0, 12, 'responsive_not_active_site_style_flat', $outside_container_label ); // Inside Container. $outside_container_label = __( 'Inside Container (px)', 'responsive' ); - responsive_padding_control( $wp_customize, 'blog_inside_container', 'responsive_blog_layout', 270, 15, 15, 'responsive_not_active_site_style_flat', $outside_container_label ); + responsive_padding_control( $wp_customize, 'blog_inside_container', 'responsive_blog_layout', 270, 30, 30, 'responsive_not_active_site_style_flat', $outside_container_label, 'postMessage', 30, 30, 30, 30 ); $container_spacing_label = esc_html__( 'Spacing', 'responsive' ); responsive_separator_control( $wp_customize, 'single_blog_container_spacing', $container_spacing_label, 'responsive_single_blog_layout', 250 ); - // Outside Container. - $outside_container_label = __( 'Outside Container (px)', 'responsive' ); - responsive_padding_control( $wp_customize, 'single_blog_outside_container', 'responsive_single_blog_layout', 260, 0, 15, 'responsive_not_active_site_style_flat', $outside_container_label ); + // Single Post Outside Container. + responsive_unit_padding_control( $wp_customize, 'single_blog_outside_container', 'responsive_single_blog_layout', 260, 15, 15, 'responsive_not_active_site_style_flat', __( 'Outside Container', 'responsive' ), 'postMessage', 3, 3, 3, 3, 'px' ); - // Inside Container. - $outside_container_label = __( 'Inside Container (px)', 'responsive' ); - responsive_padding_control( $wp_customize, 'single_blog_inside_container', 'responsive_single_blog_layout', 270, 15, 15, 'responsive_not_active_site_style_flat', $outside_container_label ); + // Single Post Inside Container. + responsive_unit_padding_control( $wp_customize, 'single_blog_inside_container', 'responsive_single_blog_layout', 270, 15, 15, 'responsive_not_active_site_style_flat', __( 'Inside Container', 'responsive' ), 'postMessage', 3, 3, 3, 3, 'px' ); $sidebar_spacing_label = esc_html__( 'Spacing', 'responsive' ); responsive_separator_control( $wp_customize, 'sidebar_spacing', $sidebar_spacing_label, 'responsive_sidebar', 70 ); // Outside Container. $outside_container_label = __( 'Outside Container (px)', 'responsive' ); - responsive_padding_control( $wp_customize, 'sidebar_outside_container', 'responsive_sidebar', 80, 0, 15, '', $outside_container_label ); + responsive_padding_control( $wp_customize, 'sidebar_outside_container', 'responsive_sidebar', 80, 0, 12, '', $outside_container_label ); // Inside Container. $outside_container_label = __( 'Inside Container (px)', 'responsive' ); diff --git a/core/includes/customizer/settings/class-responsive-page-content-customizer.php b/core/includes/customizer/settings/class-responsive-page-content-customizer.php index d119f00da..26e70d36f 100644 --- a/core/includes/customizer/settings/class-responsive-page-content-customizer.php +++ b/core/includes/customizer/settings/class-responsive-page-content-customizer.php @@ -55,13 +55,21 @@ public function customizer_options( $wp_customize ) { $design_tab_ids = array( $design_tab_ids_prefix . 'responsive_page_typography_title_separator', $design_tab_ids_prefix . 'responsive_page_title_typography_group', + $design_tab_ids_prefix . 'responsive_page_padding_padding', + $design_tab_ids_prefix . 'responsive_page_margin_padding', + $design_tab_ids_prefix . 'responsive_page_content_vertical', + $design_tab_ids_prefix . 'responsive_page_title_typography_group_separator', + $design_tab_ids_prefix . 'responsive_page_margin_separator', + $design_tab_ids_prefix . 'responsive_page_site_background_color', + $design_tab_ids_prefix . 'responsive_page_content_background_color', + $design_tab_ids_prefix . 'responsive_page_content_background_separator', + $design_tab_ids_prefix . 'responsive_page_content_before_background_separator', ); $general_tab_ids_prefix = 'customize-control-responsive_page_'; $general_tab_ids = array( $general_tab_ids_prefix . 'content_width', $general_tab_ids_prefix . 'elements_separator', - $general_tab_ids_prefix . 'single_elements_positioning', $general_tab_ids_prefix . 'featured_image_separator', $general_tab_ids_prefix . 'featured_image_width', $general_tab_ids_prefix . 'featured_image_style', @@ -84,15 +92,239 @@ public function customizer_options( $wp_customize ) { $general_tab_ids_prefix . 'container_style', $general_tab_ids_prefix . 'container_layout_separator', $general_tab_ids_prefix . 'container_style_separator', + $general_tab_ids_prefix . 'content_top_bottom_spacing', + $general_tab_ids_prefix . 'content_alignment_separator', + $general_tab_ids_prefix . 'show_comments', + $general_tab_ids_prefix . 'content_vertical_separator', ); - responsive_tabs_button_control( $wp_customize, 'page_tabs', $tabs_label, 'responsive_page', 10, '', 'responsive_page_content_general_tab', 'responsive_page_content_design_tab', $general_tab_ids, $design_tab_ids, null ); + responsive_tabs_button_control( $wp_customize, 'page_tabs', $tabs_label, 'responsive_page', 5, '', 'responsive_page_content_general_tab', 'responsive_page_content_design_tab', $general_tab_ids, $design_tab_ids, null ); + + // Page Title Area + responsive_section_toggle_control( $wp_customize, 'page_title_area', __( 'Page Title Area', 'responsive' ), 'responsive_page', 8, 'section', 'responsive_page_title_area_layout', true, null, 'refresh', 'Enable the toggle to customize page title title settings.'); + + // Page Title Tabs + $page_title_general_tab_ids = [ + 'customize-control-responsive_page_title_layout', + 'customize-control-responsive_page_title_horizontal_alignment', + 'customize-control-responsive_page_title_container_width', + 'customize-control-responsive_page_title_custom_width', + 'customize-control-responsive_page_title_vertical_alignment', + 'customize-control-responsive_page_meta_control_separator', + 'customize-control-responsive_page_single_meta', + 'customize-control-responsive_page_single_meta_separator_text', + 'customize-control-responsive_page_single_meta_separator_text_separator', + 'customize-control-responsive_page_single_elements_positioning', + 'customize-control-responsive_page_featured_image_separator', + 'customize-control-responsive_page_featured_image_width', + 'customize-control-responsive_page_featured_image_width_separator', + 'customize-control-responsive_page_featured_image_style', + 'customize-control-responsive_page_featured_image_style_separator', + 'customize-control-responsive_page_featured_image_alignment', + 'customize-control-responsive_page_featured_image_alignment_separator', + 'customize-control-responsive_page_featured_image_position', + 'customize-control-responsive_page_featured_image_ratio', + 'customize-control-responsive_page_featured_image_predefined_ratio', + 'customize-control-responsive_page_featured_image_custom_width', + 'customize-control-responsive_page_featured_image_custom_height', + 'customize-control-responsive_page_featured_image_size', + ]; + + $page_title_design_tab_ids = [ + 'customize-control-responsive_page_title_banner_min_height', + 'customize-control-responsive_page_title_banner_background_color', + 'customize-control-responsive_page_title_inner_elements_spacing', + 'customize-control-responsive_page_title_inner_elements_spacing_separator', + 'customize-control-responsive_page_title_area_title_color', + 'customize-control-responsive_page_title_area_text_color', + 'customize-control-responsive_page_title_area_link_color', + 'customize-control-responsive_page_title_area_link_hover_color', + 'customize-control-responsive_page_title_area_link_hover_separator', + 'customize-control-responsive_page_title_area_title_typography_group', + 'customize-control-responsive_page_title_area_text_typography_group', + 'customize-control-responsive_page_title_area_meta_typography_group', + 'customize-control-responsive_page_title_banner_padding_padding', + 'customize-control-responsive_page_title_banner_margin_padding', + 'customize-control-responsive_page_featured_image_overlay_color', + 'customize-control-responsive_page_title_area_meta_typography_group_separator' + ]; + + // Single Blog Post Title Tabs + $tabs_label = esc_html__( 'Tabs', 'responsive' ); + + responsive_tabs_button_control( $wp_customize, 'page_title_tabs', $tabs_label, 'responsive_page_title_area_layout', 1, '', 'responsive_page_title_general_tab', 'responsive_page_title_design_tab', $page_title_general_tab_ids, $page_title_design_tab_ids, null ); + + $page_title_layout_choices = array( + 'post_title_layout1' => esc_html__( 'Layout 1', 'responsive' ), + 'post_title_layout2' => esc_html__( 'Layout 2', 'responsive' ), + ); + + $page_title_layout_label = esc_html__( 'Banner Layout', 'responsive' ); + + responsive_imageradio_button_control( $wp_customize, 'page_title_layout', $page_title_layout_label, 'responsive_page_title_area_layout', 1, $page_title_layout_choices, 'post_title_layout1', null, 'svg', 'refresh' ); + + // Horizontal Alignment. + $page_title_horizontal_alignment_label = esc_html__( 'Horizontal Alignment', 'responsive' ); + $page_title_horizontal_alignment_choices = array( + 'left' => esc_html__( 'dashicons-editor-alignleft', 'responsive' ), + 'center' => esc_html__( 'dashicons-editor-aligncenter', 'responsive' ), + 'right' => esc_html__( 'dashicons-editor-alignright', 'responsive' ), + ); + if ( is_rtl() ) { + $page_title_horizontal_alignment_choices = array( + 'left' => esc_html__( 'dashicons-editor-alignright', 'responsive' ), + 'center' => esc_html__( 'dashicons-editor-aligncenter', 'responsive' ), + 'right' => esc_html__( 'dashicons-editor-alignleft', 'responsive' ), + ); + } + + // Page Title Horizontal Alignment + responsive_select_button_with_switchers_control( $wp_customize, 'page_title_horizontal_alignment', $page_title_horizontal_alignment_label, 'responsive_page_title_area_layout', 135, $page_title_horizontal_alignment_choices, 'left', null ); + + // Container Width. + $page_title_container_width_label = esc_html__( 'Container Width', 'responsive' ); + $page_title_container_width_choices = array( + 'full_width' => esc_html__( 'Full Width', 'responsive' ), + 'custom' => esc_html__( 'Custom', 'responsive' ), + ); + responsive_select_button_control( $wp_customize, 'page_title_container_width', $page_title_container_width_label, 'responsive_page_title_area_layout', 2, $page_title_container_width_choices, 'full_width', null, 'refresh' ); + + // Custom Width. + $page_title_custom_width_label = esc_html__( 'Custom Width', 'responsive' ); + responsive_drag_number_control( $wp_customize, 'page_title_custom_width', $page_title_custom_width_label, 'responsive_page_title_area_layout', 3, 1200, null, 1920, 768, 'postMessage' ); + + // Vertical Alignment. + $page_title_vertical_alignment_label = esc_html__( 'Vertical Alignment', 'responsive' ); + $page_title_vertical_alignment_choices = array( + 'flex-start' => esc_html__( 'Top', 'responsive' ), + 'center' => esc_html__( 'Middle', 'responsive' ), + 'flex-end' => esc_html__( 'Bottom', 'responsive' ), + ); + + // Banner Min Height + $page_title_banner_min_height_label = esc_html__( 'Banner Min Height', 'responsive' ); + responsive_drag_number_control_with_switchers( $wp_customize, 'page_title_banner_min_height', $page_title_banner_min_height_label, 'responsive_page_title_area_layout', 4, 0, null, 1000, 0, 'postMessage' ); + + // Banner Background Color + $page_title_banner_background_color_label = __( 'Banner Background Color', 'responsive' ); + responsive_color_control_with_device_switchers( $wp_customize, 'page_title_banner_background', $page_title_banner_background_color_label, 'responsive_page_title_area_layout', 4, '#ffffff' ); + + + // Page Title Vertical Alignment + responsive_select_button_control( $wp_customize, 'page_title_vertical_alignment', $page_title_vertical_alignment_label, 'responsive_page_title_area_layout', 135, $page_title_vertical_alignment_choices, 'flex-start', null ); + + /** + * Entry meta. + */ + $page_meta_label = esc_html__( 'Meta', 'responsive' ); + responsive_separator_control( $wp_customize, 'page_meta_control_separator', $page_meta_label, 'responsive_page_title_area_layout', 136 ); + + /** + * Page Single Meta + */ + $wp_customize->add_setting( + 'responsive_page_single_meta', + array( + 'default' => array( 'author', 'date', 'categories', 'comments', 'tag' ), + 'sanitize_callback' => 'responsive_sanitize_multi_choices', + 'transport' => 'refresh', + ) + ); + + $wp_customize->add_control( + new Responsive_Customizer_Sortable_Control( + $wp_customize, + 'responsive_page_single_meta', + array( + 'label' => esc_html__( 'Meta Elements', 'responsive' ), + 'section' => 'responsive_page_title_area_layout', + 'settings' => 'responsive_page_single_meta', + 'priority' => 137, + 'choices' => apply_filters( + 'responsive_page_meta_choices', + array( + 'author' => esc_html__( 'Author', 'responsive' ), + 'date' => esc_html__( 'Date Published', 'responsive' ), + 'updated' => esc_html__( 'Last Updated', 'responsive' ), + 'comments' => esc_html__( 'Comments', 'responsive' ), + ) + ), + ) + ) + ); + + // Meta Separator Text. + $wp_customize->add_setting( + 'responsive_page_single_meta_separator_text', + array( + 'default' => '•', + 'sanitize_callback' => 'wp_check_invalid_utf8', + 'type' => 'theme_mod', + 'transport' => 'postMessage', + ) + ); + $wp_customize->add_control( + 'responsive_page_single_meta_separator_text', + array( + 'section' => 'responsive_page_title_area_layout', + 'settings' => 'responsive_page_single_meta_separator_text', + 'priority' => 138, + 'type' => 'hidden', + ) + ); + + responsive_horizontal_separator_control( $wp_customize, 'page_single_meta_separator_text_separator', 1, 'responsive_page_title_area_layout', 139, 1 ); + + // Inner Elements Spacing + $page_title_inner_elements_spacing_label = esc_html__( 'Inner Elements Spacing', 'responsive' ); + responsive_drag_number_control( $wp_customize, 'page_title_inner_elements_spacing', $page_title_inner_elements_spacing_label, 'responsive_page_title_area_layout', 5, Responsive\Core\get_responsive_customizer_defaults( 'page_title_inner_elements_spacing' ), null, 100, 1, 'postMessage' ); + + responsive_horizontal_separator_control( $wp_customize, 'page_title_inner_elements_spacing_separator', 1, 'responsive_page_title_area_layout',6, 1 ); + + // Page Title Color + $page_title_color_label = __( 'Title Color', 'responsive' ); + responsive_color_control( $wp_customize, 'page_title_area_title', $page_title_color_label, 'responsive_page_title_area_layout', 10, Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_title_color' ) ); + + // Page Text Color + $page_text_color_label = __( 'Text Color', 'responsive' ); + responsive_color_control( $wp_customize, 'page_title_area_text', $page_text_color_label, 'responsive_page_title_area_layout', 15, Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_text_color' ) ); + + // Page Post Link Color + $page_link_color_label = __( 'Link Color', 'responsive' ); + responsive_color_control( $wp_customize, 'page_title_area_link', $page_link_color_label, 'responsive_page_title_area_layout', 20, Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_link_color' ) ); + + // Page Post Link Hover Color + $page_link_hover_color_label = __( 'Link Hover Color', 'responsive' ); + responsive_color_control( $wp_customize, 'page_title_area_link_hover', $page_link_hover_color_label, 'responsive_page_title_area_layout', 25, Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_link_hover_color' ) ); + + responsive_horizontal_separator_control( $wp_customize, 'page_title_area_link_hover_separator', 1, 'responsive_page_title_area_layout',30, 1 ); + + // Page Title Font + $page_title_typography_label = __( 'Title Font', 'responsive' ); + responsive_typography_group_control( $wp_customize, 'page_title_area_title_typography_group', $page_title_typography_label, 'responsive_page_title_area_layout', 35, 'page_title_area_title_typography', true ); + + // Page Text Font + $page_text_typography_label = __( 'Text Font', 'responsive' ); + responsive_typography_group_control( $wp_customize, 'page_title_area_text_typography_group', $page_text_typography_label, 'responsive_page_title_area_layout', 40, 'page_title_area_text_typography', true ); + + // Page Meta Font + $page_meta_typography_label = __( 'Meta Font', 'responsive' ); + responsive_typography_group_control( $wp_customize, 'page_title_area_meta_typography_group', $page_meta_typography_label, 'responsive_page_title_area_layout', 45, 'page_title_area_meta_typography', true ); + + responsive_horizontal_separator_control( $wp_customize, 'page_title_area_meta_typography_group_separator', 1, 'responsive_page_title_area_layout',46, 1 ); + + // Padding + responsive_unit_padding_control( $wp_customize, 'page_title_banner_padding', 'responsive_page_title_area_layout', 50, 0, 0, null, __( 'Padding', 'responsive' ), 'postMessage','', '', '', '', 'px' ); + + // Margin + responsive_unit_padding_control( $wp_customize, 'page_title_banner_margin', 'responsive_page_title_area_layout', 55, 0, 0, null, __( 'Margin', 'responsive' ), 'postMessage', '', '', '', '', 'px' ); + // Main Content Width. $page_content_width_label = esc_html__( 'Main Content Width (%)', 'responsive' ); responsive_drag_number_control( $wp_customize, 'page_content_width', $page_content_width_label, 'responsive_page', 10, Responsive\Core\get_responsive_customizer_defaults( 'page_content_width' ), null, 100, 1, 'postMessage' ); - responsive_horizontal_separator_control($wp_customize, 'page_content_width_separator', 1, 'responsive_page', 12, 1, ); + responsive_horizontal_separator_control($wp_customize, 'page_content_width_separator', 1, 'responsive_page', 9, 1, ); /** * Page Elements Positioning @@ -100,7 +332,7 @@ public function customizer_options( $wp_customize ) { $wp_customize->add_setting( 'responsive_page_single_elements_positioning', array( - 'default' => array( 'title', 'featured_image', 'content' ), + 'default' => array( 'title', 'featured_image' ), 'sanitize_callback' => 'responsive_sanitize_multi_choices', 'transport' => 'refresh', ) @@ -112,9 +344,9 @@ public function customizer_options( $wp_customize ) { 'responsive_page_single_elements_positioning', array( 'label' => esc_html__( 'Page Elements', 'responsive' ), - 'section' => 'responsive_page', + 'section' => 'responsive_page_title_area_layout', 'settings' => 'responsive_page_single_elements_positioning', - 'priority' => 14, + 'priority' => 140, 'choices' => responsive_page_elements(), ) ) @@ -124,24 +356,8 @@ public function customizer_options( $wp_customize ) { * Entry Elements. */ $page_featured_image_label = esc_html__( 'Page Featured Image', 'responsive' ); - responsive_separator_control( $wp_customize, 'page_featured_image_separator', $page_featured_image_label, 'responsive_page', 30 ); - - // Featured Image Width. - $page_featured_image_width_label = esc_html__( 'Image Width Size (px)', 'responsive' ); - responsive_drag_number_control( $wp_customize, 'page_featured_image_width', $page_featured_image_width_label, 'responsive_page', 35, '', null, 4800 ); - - responsive_horizontal_separator_control($wp_customize, 'page_featured_image_width_separator', 1, 'responsive_page', 37, 1, ); + responsive_separator_control( $wp_customize, 'page_featured_image_separator', $page_featured_image_label, 'responsive_page_title_area_layout', 145 ); - // Style. - $featured_image_style_label = esc_html__( 'Image Style', 'responsive' ); - $featured_image_style_choices = array( - 'default' => esc_html__( 'Default', 'responsive' ), - 'stretched' => esc_html__( 'Stretched', 'responsive' ), - ); - responsive_select_button_control( $wp_customize, 'page_featured_image_style', $featured_image_style_label, 'responsive_page', 40, $featured_image_style_choices, 'default', null, 'postMessage' ); - - responsive_horizontal_separator_control($wp_customize, 'page_featured_image_style_separator', 1, 'responsive_page', 42, 1, ); - // Featured Image Alignment. $featured_image_alignment_label = esc_html__( 'Image Alignment', 'responsive' ); $featured_image_alignment_choices = array( @@ -156,27 +372,61 @@ public function customizer_options( $wp_customize ) { 'right' => esc_html__( 'dashicons-editor-alignleft', 'responsive' ), ); } - responsive_select_button_control( $wp_customize, 'page_featured_image_alignment', $featured_image_alignment_label, 'responsive_page', 50, $featured_image_alignment_choices, 'left', null ); + responsive_select_button_control( $wp_customize, 'page_featured_image_alignment', $featured_image_alignment_label, 'responsive_page_title_area_layout', 150, $featured_image_alignment_choices, 'left', null ); - responsive_horizontal_separator_control($wp_customize, 'page_featured_image_alignment_separator', 2, 'responsive_page', 52, 1, ); + // Image Position. + $page_featured_image_position_label = esc_html__( 'Image Position', 'responsive' ); + $page_featured_image_position_choices = array( + 'none' => esc_html__( 'None', 'responsive' ), + 'outside' => esc_html__( 'Outside', 'responsive' ), + 'background' => esc_html__( 'Background', 'responsive' ), + ); + responsive_select_button_control( $wp_customize, 'page_featured_image_position', $page_featured_image_position_label, 'responsive_page_title_area_layout', 152, $page_featured_image_position_choices, 'none', null ); - // Alignment. - $page_title_alignment_label = esc_html__( 'Page Title Alignment', 'responsive' ); - $page_title_alignment_choices = array( - 'left' => esc_html__( 'dashicons-editor-alignleft', 'responsive' ), - 'center' => esc_html__( 'dashicons-editor-aligncenter', 'responsive' ), - 'right' => esc_html__( 'dashicons-editor-alignright', 'responsive' ), + // Image Ratio. + $page_featured_image_ratio_label = esc_html__( 'Image Ratio', 'responsive' ); + $page_featured_image_ratio_choices = array( + 'original' => esc_html__( 'Original', 'responsive' ), + 'predefined' => esc_html__( 'Predefined', 'responsive' ), + 'custom' => esc_html__( 'Custom', 'responsive' ), ); - if ( is_rtl() ) { - $page_title_alignment_choices = array( - 'left' => esc_html__( 'dashicons-editor-alignright', 'responsive' ), - 'center' => esc_html__( 'dashicons-editor-aligncenter', 'responsive' ), - 'right' => esc_html__( 'dashicons-editor-alignleft', 'responsive' ), - ); - } - responsive_select_button_control( $wp_customize, 'page_title_alignment', $page_title_alignment_label, 'responsive_page', 70, $page_title_alignment_choices, 'left', null ); + responsive_select_button_control( $wp_customize, 'page_featured_image_ratio', $page_featured_image_ratio_label, 'responsive_page_title_area_layout', 153, $page_featured_image_ratio_choices, 'original', null ); + + // Predefined Ratio. + $page_featured_image_predefined_ratio_label = esc_html__( 'Predefined Ratio', 'responsive' ); + $page_featured_image_predefined_ratio_choices = array( + '1:1' => esc_html__( '1:1', 'responsive' ), + '4:3' => esc_html__( '4:3', 'responsive' ), + '16:9' => esc_html__( '16:9', 'responsive' ), + '2:1' => esc_html__( '2:1', 'responsive' ), + ); + responsive_select_button_control( $wp_customize, 'page_featured_image_predefined_ratio', $page_featured_image_predefined_ratio_label, 'responsive_page_title_area_layout', 154, $page_featured_image_predefined_ratio_choices, '1:1', null ); + + // Custom Width & Height. + $page_featured_image_custom_width_label = esc_html__( 'Custom Width', 'responsive' ); + responsive_drag_number_control( $wp_customize, 'page_featured_image_custom_width', $page_featured_image_custom_width_label, 'responsive_page_title_area_layout', 155, '', null, 4800 ); - responsive_horizontal_separator_control($wp_customize, 'page_title_alignment_separator', 2, 'responsive_page', 72, 1, ); + $page_featured_image_custom_height_label = esc_html__( 'Custom Height', 'responsive' ); + responsive_drag_number_control( $wp_customize, 'page_featured_image_custom_height', $page_featured_image_custom_height_label, 'responsive_page_title_area_layout', 156, '', null, 4800 ); + + // Image Size Dropdown. + $page_featured_image_size_label = esc_html__( 'Image Size', 'responsive' ); + $page_featured_image_size_choices = array( + 'full' => esc_html__( 'Full Size', 'responsive' ), + 'thumbnail' => esc_html__( 'Thumbnail', 'responsive' ), + 'medium' => esc_html__( 'Medium', 'responsive' ), + 'medium_large' => esc_html__( 'Medium Large', 'responsive' ), + '1536x1536' => esc_html__( '1536 x 1536', 'responsive' ), + '2048x2048' => esc_html__( '2048x2048', 'responsive' ), + 'woocommerce_thumbnail' => esc_html__( 'woocommerce_thumbnail', 'responsive' ), + 'woocommerce_single' => esc_html__( 'woocommerce_single', 'responsive' ), + 'woocommerce_gallery_thumbnail' => esc_html__( 'woocommerce_gallery_thumbnail', 'responsive' ), + ); + responsive_select_control( $wp_customize, 'page_featured_image_size', $page_featured_image_size_label, 'responsive_page_title_area_layout', 157, $page_featured_image_size_choices, 'full', null ); + + // Overlay Color. + $page_featured_image_overlay_color_label = esc_html__( 'Overlay Color', 'responsive' ); + responsive_color_control( $wp_customize, 'page_featured_image_overlay', $page_featured_image_overlay_color_label, 'responsive_page_title_area_layout', 158, '' ); // Content Alignment. $page_content_alignment_label = esc_html__( 'Page Content Alignment', 'responsive' ); @@ -196,9 +446,52 @@ public function customizer_options( $wp_customize ) { } responsive_select_button_control( $wp_customize, 'page_content_alignment', $page_content_alignment_label, 'responsive_page', 90, $page_content_alignment_choices, 'left', null ); + responsive_horizontal_separator_control($wp_customize, 'page_content_alignment_separator', 2, 'responsive_page', 91, 1, ); + + // Content Top and Bottom Spacing + $page_content_top_bottom_spacing_label = esc_html__( 'Content Top and Bottom Spacing (px)', 'responsive' ); + responsive_drag_number_control( $wp_customize, 'page_content_top_bottom_spacing', $page_content_top_bottom_spacing_label, 'responsive_page', 92, 10, null, 4800 ); + // Typography $typography_label = __( 'Title Font', 'responsive' ); - responsive_typography_group_control( $wp_customize, 'page_title_typography_group', $typography_label, 'responsive_page', 91, 'page_title_typography' ); + responsive_typography_group_control( $wp_customize, 'page_title_typography_group', $typography_label, 'responsive_page', 93, 'page_title_typography' ); + + responsive_horizontal_separator_control($wp_customize, 'page_title_typography_group_separator', 1, 'responsive_page', 94, 1, ); + + responsive_unit_padding_control( $wp_customize, 'page_padding', 'responsive_page', 95, 30, 30, null, __( 'Padding', 'responsive' ), 'postMessage', 30, 30, 30, 30, 'px' ); + + responsive_unit_padding_control( $wp_customize, 'page_margin', 'responsive_page', 96, 0, 0, null, __( 'Margin', 'responsive' ), 'postMessage', 0, 0, 0, 0, 'px' ); + + responsive_horizontal_separator_control($wp_customize, 'page_margin_separator', 1, 'responsive_page', 97, 1, ); + + // Content Vertical Spacing + $page_content_vertical_label = esc_html__( 'Content Vertical Spacing', 'responsive' ); + $page_content_vertical_choices = array( + 'enable' => esc_html__( 'Enable', 'responsive' ), + 'disable' => esc_html__( 'Disable', 'responsive' ), + 'top_only' => esc_html__( 'Top Only', 'responsive' ), + 'bottom_only' => esc_html__( 'Bottom Only', 'responsive' ), + ); + + responsive_select_button_control( $wp_customize, 'page_content_vertical', $page_content_vertical_label, 'responsive_page', 98, $page_content_vertical_choices, 'default', null, 'refresh' ); + + responsive_horizontal_separator_control($wp_customize, 'page_content_vertical_separator', 1, 'responsive_page', 99, 1, ); + + // Show Comments + $page_show_comments_label = esc_html__( 'Show Comments', 'responsive' ); + responsive_toggle_control( $wp_customize, 'page_show_comments', $page_show_comments_label, 'responsive_page', 100, false, null, 'refresh' ); + + responsive_horizontal_separator_control($wp_customize, 'page_content_before_background_separator', 1, 'responsive_page', 101, 1, null ); + + // Page Site Background Color. + $page_site_background_color_label = __( 'Site Background', 'responsive' ); + responsive_color_control( $wp_customize, 'page_site_background', $page_site_background_color_label, 'responsive_page', 102, Responsive\Core\get_responsive_customizer_defaults('responsive_page_site_background_color') ); + + // Page Content Background Color. + $page_content_background_color_label = __( 'Content Background', 'responsive' ); + responsive_color_control( $wp_customize, 'page_content_background', $page_content_background_color_label, 'responsive_page', 103, Responsive\Core\get_responsive_customizer_defaults('responsive_page_content_background_color') ); + + responsive_horizontal_separator_control($wp_customize, 'page_content_background_separator', 1, 'responsive_page', 104, 1, null ); } diff --git a/core/includes/customizer/settings/class-responsive-sidebar-layout-customizer.php b/core/includes/customizer/settings/class-responsive-sidebar-layout-customizer.php index a949fe99e..b1fd43278 100644 --- a/core/includes/customizer/settings/class-responsive-sidebar-layout-customizer.php +++ b/core/includes/customizer/settings/class-responsive-sidebar-layout-customizer.php @@ -106,7 +106,7 @@ public function customizer_options($wp_customize) // Page Sidebar Sub-Heading $page_sidebar_heading_label = esc_html__('Sidebar', 'responsive'); - responsive_separator_control($wp_customize, 'page_sidebar_separator', $page_sidebar_heading_label, 'responsive_page', 20); + responsive_separator_control($wp_customize, 'page_sidebar_separator', $page_sidebar_heading_label, 'responsive_page', 20, 'responsive_active_page_sidebar_section'); // Page Sidebar. $sidebar_label = esc_html__('Sidebar Position', 'responsive'); @@ -124,7 +124,7 @@ public function customizer_options($wp_customize) 'left' => esc_html__('Right', 'responsive'), ); } - responsive_imageradio_button_control($wp_customize, 'page_sidebar_position', $sidebar_label, 'responsive_page', 22, $sidebar_choices, 'global', null, 'svg'); + responsive_imageradio_button_control($wp_customize, 'page_sidebar_position', $sidebar_label, 'responsive_page', 22, $sidebar_choices, 'global', 'responsive_active_page_sidebar_section', 'svg'); $page_sidebar_style_label = __( 'Sidebar Style', 'responsive' ); $page_sidebar_style_choice = array( @@ -138,7 +138,7 @@ public function customizer_options($wp_customize) responsive_drag_number_control($wp_customize, 'page_sidebar_width', $page_sidebar_width_label, 'responsive_page', 24, 30, 'responsive_active_page_sidebar_position', 50, 20, 'postMessage'); $blog_sidebar_heading_label = esc_html__( 'Blog/Archive Sidebar', 'responsive' ); - responsive_separator_control( $wp_customize, 'blog_sidebar_separator', $blog_sidebar_heading_label, 'responsive_blog_layout', 26 ); + responsive_separator_control( $wp_customize, 'blog_sidebar_separator', $blog_sidebar_heading_label, 'responsive_blog_layout', 26, 'responsive_active_blog_sidebar_section' ); // Blog/Archive Sidebar. $sidebar_label = esc_html__('Sidebar Position', 'responsive'); @@ -156,7 +156,7 @@ public function customizer_options($wp_customize) 'left' => esc_html__('Right', 'responsive'), ); } - responsive_imageradio_button_control($wp_customize, 'blog_sidebar_position', $sidebar_label, 'responsive_blog_layout', 30, $sidebar_choices, 'global', null, 'svg'); + responsive_imageradio_button_control($wp_customize, 'blog_sidebar_position', $sidebar_label, 'responsive_blog_layout', 30, $sidebar_choices, 'global', 'responsive_active_blog_sidebar_section', 'svg'); $blog_sidebar_style_label = __( 'Sidebar Style', 'responsive' ); $blog_sidebar_style_choice = array( @@ -170,7 +170,7 @@ public function customizer_options($wp_customize) responsive_drag_number_control($wp_customize, 'blog_sidebar_width', $page_sidebar_width_label, 'responsive_blog_layout', 35, 30, 'responsive_active_blog_sidebar_position', 50, 20, 'postMessage'); $single_blog_featured_image_label = esc_html__( 'Sidebar', 'responsive' ); - responsive_separator_control( $wp_customize, 'single_blog_sidebar_separator', $single_blog_featured_image_label, 'responsive_single_blog_layout', 38 ); + responsive_separator_control( $wp_customize, 'single_blog_sidebar_separator', $single_blog_featured_image_label, 'responsive_single_blog_layout', 38, 'responsive_active_single_blog_sidebar_section' ); // Single Post Sidebar. $sidebar_label = esc_html__('Sidebar Position', 'responsive'); @@ -188,7 +188,7 @@ public function customizer_options($wp_customize) 'left' => esc_html__('Right', 'responsive'), ); } - responsive_imageradio_button_control($wp_customize, 'single_blog_sidebar_position', $sidebar_label, 'responsive_single_blog_layout', 40, $sidebar_choices, 'global', null, 'svg'); + responsive_imageradio_button_control($wp_customize, 'single_blog_sidebar_position', $sidebar_label, 'responsive_single_blog_layout', 40, $sidebar_choices, 'global', 'responsive_active_single_blog_sidebar_section', 'svg'); $single_blog_sidebar_style_label = __( 'Sidebar Style', 'responsive' ); $single_blog_sidebar_style_choice = array( diff --git a/core/includes/customizer/settings/class-responsive-single-blog-layout-customizer.php b/core/includes/customizer/settings/class-responsive-single-blog-layout-customizer.php index 50d2fb89c..4d609d99c 100644 --- a/core/includes/customizer/settings/class-responsive-single-blog-layout-customizer.php +++ b/core/includes/customizer/settings/class-responsive-single-blog-layout-customizer.php @@ -34,6 +34,72 @@ public function __construct() { * @param object $wp_customize WordPress customization option. */ public function customizer_options( $wp_customize ) { + $main_tabs_label = esc_html__( 'Tabs', 'responsive' ); + $main_design_tab_ids_prefix = 'customize-control-'; + $main_design_tab_ids = array( + $main_design_tab_ids_prefix . 'responsive_single_blog_item_meta_color', + $main_design_tab_ids_prefix . 'responsive_single_blog_breadcrumb_color', + $main_design_tab_ids_prefix . 'responsive_single_blog_breadcrumb_color', + $main_design_tab_ids_prefix . 'responsive_single_blog_breadcrumb_typography_group', + $main_design_tab_ids_prefix . 'responsive_single_blog_excerpt_color_color', + $main_design_tab_ids_prefix . 'responsive_single_blog_excerpt_typography_group', + $main_design_tab_ids_prefix . 'responsive_single_blog_site_background_color', + $main_design_tab_ids_prefix . 'responsive_single_blog_content_background_color', + $main_design_tab_ids_prefix . 'responsive_single_blog_category_color_color', + $main_design_tab_ids_prefix . 'responsive_single_blog_category_typography_group', + $main_design_tab_ids_prefix . 'responsive_single_blog_category_typography_separator', + $main_design_tab_ids_prefix . 'responsive_single_blog_meta_typography_group_separator', + $main_design_tab_ids_prefix . 'responsive_single_blog_breadcrumb_typography_group_separator', + $main_design_tab_ids_prefix . 'responsive_single_blog_excerpt_typography_separator', + + ); + + $main_general_tab_ids_prefix = 'customize-control-responsive_single_blog_'; + $main_general_tab_ids = array( + $main_general_tab_ids_prefix . 'container_layout_separator', + $main_general_tab_ids_prefix . 'container_layout', + $main_general_tab_ids_prefix . 'container_style_separator', + $main_general_tab_ids_prefix . 'container_style', + $main_general_tab_ids_prefix . 'content_width', + $main_general_tab_ids_prefix . 'content_width_separator', + $main_general_tab_ids_prefix . 'elements_positioning', + $main_general_tab_ids_prefix . 'sidebar_separator', + $main_general_tab_ids_prefix . 'sidebar_position', + $main_general_tab_ids_prefix . 'sidebar_style', + $main_general_tab_ids_prefix . 'sidebar_width', + $main_general_tab_ids_prefix . 'featured_image_separator', + $main_general_tab_ids_prefix . 'featured_image_width', + $main_general_tab_ids_prefix . 'featured_image_width_separator', + $main_general_tab_ids_prefix . 'featured_image_style', + $main_general_tab_ids_prefix . 'featured_image_style_separator', + $main_general_tab_ids_prefix . 'featured_image_alignment', + $main_general_tab_ids_prefix . 'featured_image_alignment_separator', + $main_general_tab_ids_prefix . 'title_alignment', + $main_general_tab_ids_prefix . 'meta_control_separator', + $main_general_tab_ids_prefix . 'meta_separator_text', + $main_general_tab_ids_prefix . 'meta_alignment', + $main_general_tab_ids_prefix . 'meta_alignment_separator', + $main_general_tab_ids_prefix . 'content_alignment', + $main_general_tab_ids_prefix . 'related_posts_separator', + $main_general_tab_ids_prefix . 'enable_related_posts', + $main_general_tab_ids_prefix . 'comments_separator', + $main_general_tab_ids_prefix . 'comments', + $main_general_tab_ids_prefix . 'container_spacing', + $main_general_tab_ids_prefix . 'outside_container_padding', + $main_general_tab_ids_prefix . 'inside_container_padding', + $main_general_tab_ids_prefix . 'navigation', + $main_general_tab_ids_prefix . 'navigation_before', + 'customize-control-responsive_disable_author_meta', + 'customize-control-responsive_post_author_box_style', + 'customize-control-responsive_responsive_disable_author_meta_separator', + 'customize-control-responsive_responsive_blog_single_meta_separator', + 'customize-control-responsive_responsive_single_blog_meta_separator_text_separator', + 'customize-control-responsive_blog_single_elements_positioning', + 'customize-control-responsive_blog_single_meta', + + ); + responsive_tabs_button_control( $wp_customize, 'single_blog_tabs', $main_tabs_label, 'responsive_single_blog_layout', 1, '', 'responsive_single_blog_layout_general_tab', 'responsive_single_blog_layout_design_tab', $main_general_tab_ids, $main_design_tab_ids, null ); + /** * Section */ @@ -186,10 +252,142 @@ public function customizer_options( $wp_customize ) { responsive_typography_group_control( $wp_customize, 'rp_content_typography_group', __( 'Content Font', 'responsive' ), 'responsive_rp_layout', 24, 'rp_content_typography' ); + // Single Blog Post Title + responsive_section_toggle_control( $wp_customize, 'single_blog_post_title', __( 'Post Title Area', 'responsive' ), 'responsive_single_blog_layout', 1, 'section', 'responsive_single_blog_post_title_layout', true, null, 'refresh', 'Enable the toggle to customize single blog post title settings.'); + + // Single Blog Post Title Tabs + $single_blog_post_title_general_tab_ids = [ + 'customize-control-responsive_single_blog_post_title_layout', + 'customize-control-responsive_single_blog_banner_container_width', + 'customize-control-responsive_single_blog_banner_custom_width', + 'customize-control-responsive_single_blog_post_title_horizontal_alignment', + 'customize-control-responsive_single_blog_title_alignment', + 'customize-control-responsive_disable_author_meta', + 'customize-control-responsive_responsive_disable_author_meta_separator', + 'customize-control-responsive_blog_single_meta', + 'customize-control-responsive_single_blog_meta_separator_text', + 'customize-control-responsive_responsive_single_blog_meta_separator_text_separator', + 'customize-control-responsive_single_blog_meta_alignment', + 'customize-control-responsive_single_blog_meta_control_separator', + 'customize-control-responsive_single_blog_meta_alignment_separator', + 'customize-control-responsive_blog_single_elements_positioning', + 'customize-control-responsive_single_blog_featured_image_separator', + 'customize-control-responsive_single_blog_featured_image_alignment', + 'customize-control-responsive_single_blog_featured_image_position', + 'customize-control-responsive_single_blog_featured_image_ratio', + 'customize-control-responsive_single_blog_featured_image_predefined_ratio', + 'customize-control-responsive_single_blog_featured_image_custom_width', + 'customize-control-responsive_single_blog_featured_image_custom_height', + 'customize-control-responsive_single_blog_featured_image_size', + ]; + + $single_blog_post_title_design_tab_ids = [ + 'customize-control-responsive_single_blog_banner_min_height', + 'customize-control-responsive_single_blog_banner_background_color', + 'customize-control-responsive_single_blog_post_title_inner_elements_spacing', + 'customize-control-responsive_single_blog_post_title_inner_elements_spacing_separator', + 'customize-control-responsive_single_blog_post_title_color', + 'customize-control-responsive_single_blog_post_text_color', + 'customize-control-responsive_single_blog_post_link_color', + 'customize-control-responsive_single_blog_post_link_hover_color', + 'customize-control-responsive_single_blog_post_link_hover_separator', + 'customize-control-responsive_single_blog_post_title_typography_group', + 'customize-control-responsive_single_blog_post_text_typography_group', + 'customize-control-responsive_single_blog_post_meta_typography_group', + 'customize-control-responsive_single_blog_banner_padding_padding', + 'customize-control-responsive_single_blog_banner_margin_padding', + 'customize-control-responsive_single_blog_featured_image_overlay_color', + 'customize-control-responsive_single_blog_post_meta_typography_group_separator' + ]; + + // Single Blog Post Title Tabs + $tabs_label = esc_html__( 'Tabs', 'responsive' ); + + responsive_tabs_button_control( $wp_customize, 'single_blog_post_title_tabs', $tabs_label, 'responsive_single_blog_post_title_layout', 1, '', 'responsive_single_blog_post_title_general_tab', 'responsive_single_blog_post_title_design_tab', $single_blog_post_title_general_tab_ids, $single_blog_post_title_design_tab_ids, null ); + + $single_blog_post_title_layout_choices = array( + 'post_title_layout1' => esc_html__( 'Layout 1', 'responsive' ), + 'post_title_layout2' => esc_html__( 'Layout 2', 'responsive' ), + ); + + $single_blog_post_title_layout_label = esc_html__( 'Banner Layout', 'responsive' ); + + responsive_imageradio_button_control( $wp_customize, 'single_blog_post_title_layout', $single_blog_post_title_layout_label, 'responsive_single_blog_post_title_layout', 1, $single_blog_post_title_layout_choices, 'post_title_layout1', null, 'svg', 'refresh' ); + + // Container Width. + $single_blog_banner_container_width_label = esc_html__( 'Container Width', 'responsive' ); + $single_blog_banner_container_width_choices = array( + 'full_width' => esc_html__( 'Full Width', 'responsive' ), + 'custom' => esc_html__( 'Custom', 'responsive' ), + ); + responsive_select_button_control( $wp_customize, 'single_blog_banner_container_width', $single_blog_banner_container_width_label, 'responsive_single_blog_post_title_layout', 2, $single_blog_banner_container_width_choices, 'full_width', null, 'refresh' ); + + // Custom Width. + $single_blog_banner_custom_width_label = esc_html__( 'Custom Width', 'responsive' ); + responsive_drag_number_control( $wp_customize, 'single_blog_banner_custom_width', $single_blog_banner_custom_width_label, 'responsive_single_blog_post_title_layout', 3, 1200, null, 1920, 768, 'postMessage' ); + + // Vertical Alignment. + $single_blog_post_title_vertical_alignment_label = esc_html__( 'Vertical Alignment', 'responsive' ); + $single_blog_post_title_vertical_alignment_choices = array( + 'flex-start' => esc_html__( 'Top', 'responsive' ), + 'center' => esc_html__( 'Middle', 'responsive' ), + 'flex-end' => esc_html__( 'Bottom', 'responsive' ), + ); + + // Single Blog Post Title Vertical Alignment + responsive_select_button_control( $wp_customize, 'single_blog_post_title_vertical_alignment', $single_blog_post_title_vertical_alignment_label, 'responsive_single_blog_post_title_layout', 135, $single_blog_post_title_vertical_alignment_choices, 'flex-start', null ); + + // Banner Min Height + $single_blog_banner_min_height_label = esc_html__( 'Banner Min Height', 'responsive' ); + responsive_drag_number_control_with_switchers( $wp_customize, 'single_blog_banner_min_height', $single_blog_banner_min_height_label, 'responsive_single_blog_post_title_layout', 4, 0, null, 1000, 0, 'postMessage' ); + + // Banner Background Color + $single_blog_banner_background_color_label = __( 'Banner Background Color', 'responsive' ); + responsive_color_control_with_device_switchers( $wp_customize, 'single_blog_banner_background', $single_blog_banner_background_color_label, 'responsive_single_blog_post_title_layout', 4, '#ffffff' ); + + // Inner Elements Spacing + $single_blog_post_title_inner_elements_spacing_label = esc_html__( 'Inner Elements Spacing', 'responsive' ); + responsive_drag_number_control( $wp_customize, 'single_blog_post_title_inner_elements_spacing', $single_blog_post_title_inner_elements_spacing_label, 'responsive_single_blog_post_title_layout', 5, Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_title_inner_elements_spacing' ), null, 100, 1, 'postMessage' ); + + responsive_horizontal_separator_control( $wp_customize, 'single_blog_post_title_inner_elements_spacing_separator', 1, 'responsive_single_blog_post_title_layout',6, 1 ); + + // Padding + responsive_unit_padding_control( $wp_customize, 'single_blog_banner_padding', 'responsive_single_blog_post_title_layout', 51, 0, 0, null, __( 'Padding', 'responsive' ), 'postMessage', 0, 0, 0, 0, 'px' ); + // Margin + responsive_unit_padding_control( $wp_customize, 'single_blog_banner_margin', 'responsive_single_blog_post_title_layout', 52, 0, 0, null, __( 'Margin', 'responsive' ), 'postMessage', 0, 0, 0, 0, 'px' ); + // Single Blog Post Title Color + $single_blog_post_title_color_label = __( 'Title Color', 'responsive' ); + responsive_color_control( $wp_customize, 'single_blog_post_title', $single_blog_post_title_color_label, 'responsive_single_blog_post_title_layout', 10, Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_title_color' ) ); + // Single Blog Post Text Color + $single_blog_post_text_color_label = __( 'Text Color', 'responsive' ); + responsive_color_control( $wp_customize, 'single_blog_post_text', $single_blog_post_text_color_label, 'responsive_single_blog_post_title_layout', 15, Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_text_color' ) ); + // Single Blog Post Link Color + $single_blog_post_link_color_label = __( 'Link Color', 'responsive' ); + responsive_color_control( $wp_customize, 'single_blog_post_link', $single_blog_post_link_color_label, 'responsive_single_blog_post_title_layout', 20, Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_link_color' ) ); + + // Single Blog Post Link Hover Color + $single_blog_post_link_hover_color_label = __( 'Link Hover Color', 'responsive' ); + responsive_color_control( $wp_customize, 'single_blog_post_link_hover', $single_blog_post_link_hover_color_label, 'responsive_single_blog_post_title_layout', 25, Responsive\Core\get_responsive_customizer_defaults( 'single_blog_post_link_hover_color' ) ); + + responsive_horizontal_separator_control( $wp_customize, 'single_blog_post_link_hover_separator', 1, 'responsive_single_blog_post_title_layout',30, 1 ); + + // Single Blog Post Title Font + $single_blog_post_title_typography_label = __( 'Title Font', 'responsive' ); + responsive_typography_group_control( $wp_customize, 'single_blog_post_title_typography_group', $single_blog_post_title_typography_label, 'responsive_single_blog_post_title_layout', 35, 'single_blog_post_title_typography', true ); + + // Single Blog Post Text Font + $single_blog_post_text_typography_label = __( 'Text Font', 'responsive' ); + responsive_typography_group_control( $wp_customize, 'single_blog_post_text_typography_group', $single_blog_post_text_typography_label, 'responsive_single_blog_post_title_layout', 40, 'single_blog_post_text_typography', true ); + + // Single Blog Post Meta Font + $single_blog_post_meta_typography_label = __( 'Meta Font', 'responsive' ); + responsive_typography_group_control( $wp_customize, 'single_blog_post_meta_typography_group', $single_blog_post_meta_typography_label, 'responsive_single_blog_post_title_layout', 45, 'single_blog_post_meta_typography', true ); + + responsive_horizontal_separator_control( $wp_customize, 'single_blog_post_meta_typography_group_separator', 1, 'responsive_single_blog_post_title_layout',46, 1 ); // Main Content Width. $single_blog_content_width_label = esc_html__( 'Main Content Width (%)', 'responsive' ); @@ -215,10 +413,15 @@ public function customizer_options( $wp_customize ) { 'responsive_blog_single_elements_positioning', array( 'label' => esc_html__( 'Post Elements', 'responsive' ), - 'section' => 'responsive_single_blog_layout', + 'section' => 'responsive_single_blog_post_title_layout', 'settings' => 'responsive_blog_single_elements_positioning', 'priority' => 36, 'choices' => responsive_blog_single_elements(), + 'sub_controls' => array( + 'meta' => array( + 'responsive_single_blog_meta_separator_text' + ) + ), ) ) ); @@ -227,23 +430,7 @@ public function customizer_options( $wp_customize ) { * Entry Elements. */ $single_blog_featured_image_label = esc_html__( 'Featured Image', 'responsive' ); - responsive_separator_control( $wp_customize, 'single_blog_featured_image_separator', $single_blog_featured_image_label, 'responsive_single_blog_layout', 50 ); - - // Featured Image Width. - $single_blog_featured_image_width_label = esc_html__( 'Image Width Size (px)', 'responsive' ); - responsive_drag_number_control( $wp_customize, 'single_blog_featured_image_width', $single_blog_featured_image_width_label, 'responsive_single_blog_layout', 55, '', null, 4800 ); - - responsive_horizontal_separator_control( $wp_customize, 'single_blog_featured_image_width_separator', 1, 'responsive_single_blog_layout',56, 1 ); - - // Style. - $featured_image_style_label = esc_html__( 'Image Style', 'responsive' ); - $featured_image_style_choices = array( - 'default' => esc_html__( 'Default', 'responsive' ), - 'stretched' => esc_html__( 'Stretched', 'responsive' ), - ); - responsive_select_button_control( $wp_customize, 'single_blog_featured_image_style', $featured_image_style_label, 'responsive_single_blog_layout', 60, $featured_image_style_choices, 'default', null, 'postMessage' ); - - responsive_horizontal_separator_control( $wp_customize, 'single_blog_featured_image_style_separator', 1, 'responsive_single_blog_layout',61, 1 ); + responsive_separator_control( $wp_customize, 'single_blog_featured_image_separator', $single_blog_featured_image_label, 'responsive_single_blog_post_title_layout', 50 ); // Featured Image Alignment. $featured_image_alignment_label = esc_html__( 'Image Alignment', 'responsive' ); @@ -259,9 +446,61 @@ public function customizer_options( $wp_customize ) { 'right' => esc_html__( 'dashicons-editor-alignleft', 'responsive' ), ); } - responsive_select_button_control( $wp_customize, 'single_blog_featured_image_alignment', $featured_image_alignment_label, 'responsive_single_blog_layout', 70, $featured_image_alignment_choices, 'left', null ); + responsive_select_button_control( $wp_customize, 'single_blog_featured_image_alignment', $featured_image_alignment_label, 'responsive_single_blog_post_title_layout', 70, $featured_image_alignment_choices, 'left', null ); + + // Image Position. + $single_blog_featured_image_position_label = esc_html__( 'Image Position', 'responsive' ); + $single_blog_featured_image_position_choices = array( + 'none' => esc_html__( 'None', 'responsive' ), + 'outside' => esc_html__( 'Outside', 'responsive' ), + 'background' => esc_html__( 'Background', 'responsive' ), + ); + responsive_select_button_control( $wp_customize, 'single_blog_featured_image_position', $single_blog_featured_image_position_label, 'responsive_single_blog_post_title_layout', 71, $single_blog_featured_image_position_choices, 'none', null ); + + // Image Ratio. + $single_blog_featured_image_ratio_label = esc_html__( 'Image Ratio', 'responsive' ); + $single_blog_featured_image_ratio_choices = array( + 'original' => esc_html__( 'Original', 'responsive' ), + 'predefined' => esc_html__( 'Predefined', 'responsive' ), + 'custom' => esc_html__( 'Custom', 'responsive' ), + ); + responsive_select_button_control( $wp_customize, 'single_blog_featured_image_ratio', $single_blog_featured_image_ratio_label, 'responsive_single_blog_post_title_layout', 72, $single_blog_featured_image_ratio_choices, 'original', null ); + + // Predefined Ratio. + $single_blog_featured_image_predefined_ratio_label = esc_html__( 'Predefined Ratio', 'responsive' ); + $single_blog_featured_image_predefined_ratio_choices = array( + '1:1' => esc_html__( '1:1', 'responsive' ), + '4:3' => esc_html__( '4:3', 'responsive' ), + '16:9' => esc_html__( '16:9', 'responsive' ), + '2:1' => esc_html__( '2:1', 'responsive' ), + ); + responsive_select_button_control( $wp_customize, 'single_blog_featured_image_predefined_ratio', $single_blog_featured_image_predefined_ratio_label, 'responsive_single_blog_post_title_layout', 73, $single_blog_featured_image_predefined_ratio_choices, '1:1', null ); + + // Custom Width & Height. + $single_blog_featured_image_custom_width_label = esc_html__( 'Custom Width', 'responsive' ); + responsive_drag_number_control( $wp_customize, 'single_blog_featured_image_custom_width', $single_blog_featured_image_custom_width_label, 'responsive_single_blog_post_title_layout', 74, '', null, 4800 ); + + $single_blog_featured_image_custom_height_label = esc_html__( 'Custom Height', 'responsive' ); + responsive_drag_number_control( $wp_customize, 'single_blog_featured_image_custom_height', $single_blog_featured_image_custom_height_label, 'responsive_single_blog_post_title_layout', 75, '', null, 4800 ); + + // Image Size Dropdown. + $single_blog_featured_image_size_label = esc_html__( 'Image Size', 'responsive' ); + $single_blog_featured_image_size_choices = array( + 'full' => esc_html__( 'Full Size', 'responsive' ), + 'thumbnail' => esc_html__( 'Thumbnail', 'responsive' ), + 'medium' => esc_html__( 'Medium', 'responsive' ), + 'medium_large' => esc_html__( 'Medium Large', 'responsive' ), + '1536x1536' => esc_html__( '1536 x 1536', 'responsive' ), + '2048x2048' => esc_html__( '2048x2048', 'responsive' ), + 'woocommerce_thumbnail' => esc_html__( 'woocommerce_thumbnail', 'responsive' ), + 'woocommerce_single' => esc_html__( 'woocommerce_single', 'responsive' ), + 'woocommerce_gallery_thumbnail' => esc_html__( 'woocommerce_gallery_thumbnail', 'responsive' ), + ); + responsive_select_control( $wp_customize, 'single_blog_featured_image_size', $single_blog_featured_image_size_label, 'responsive_single_blog_post_title_layout', 76, $single_blog_featured_image_size_choices, 'full', null ); - responsive_horizontal_separator_control( $wp_customize, 'single_blog_featured_image_alignment_separator', 2, 'responsive_single_blog_layout',71, 1 ); + // Overlay Color. + $single_blog_featured_image_overlay_color_label = esc_html__( 'Overlay Color', 'responsive' ); + responsive_color_control( $wp_customize, 'single_blog_featured_image_overlay', $single_blog_featured_image_overlay_color_label, 'responsive_single_blog_post_title_layout', 77, '' ); // Alignment. $single_blog_title_alignment_label = esc_html__( 'Title Alignment', 'responsive' ); @@ -277,15 +516,15 @@ public function customizer_options( $wp_customize ) { 'right' => esc_html__( 'dashicons-editor-alignleft', 'responsive' ), ); } - responsive_select_button_control( $wp_customize, 'single_blog_title_alignment', $single_blog_title_alignment_label, 'responsive_single_blog_layout', 90, $single_blog_title_alignment_choices, 'left', null ); + responsive_select_button_with_switchers_control( $wp_customize, 'single_blog_title_alignment', $single_blog_title_alignment_label, 'responsive_single_blog_post_title_layout', 90, $single_blog_title_alignment_choices, 'left', null ); /** * Entry meta. */ $single_blog_meta_label = esc_html__( 'Meta', 'responsive' ); - responsive_separator_control( $wp_customize, 'single_blog_meta_control_separator', $single_blog_meta_label, 'responsive_single_blog_layout', 100 ); + responsive_separator_control( $wp_customize, 'single_blog_meta_control_separator', $single_blog_meta_label, 'responsive_single_blog_post_title_layout', 100 ); - responsive_horizontal_separator_control( $wp_customize, 'responsive_disable_author_meta_separator', 1, 'responsive_single_blog_layout',106, 1 ); + responsive_horizontal_separator_control( $wp_customize, 'responsive_disable_author_meta_separator', 1, 'responsive_single_blog_layout',107, 1 ); /** * Blog Single Meta @@ -305,7 +544,7 @@ public function customizer_options( $wp_customize ) { 'responsive_blog_single_meta', array( 'label' => esc_html__( 'Meta Elements', 'responsive' ), - 'section' => 'responsive_single_blog_layout', + 'section' => 'responsive_single_blog_post_title_layout', 'settings' => 'responsive_blog_single_meta', 'priority' => 110, 'choices' => apply_filters( @@ -323,13 +562,11 @@ public function customizer_options( $wp_customize ) { ) ); - responsive_horizontal_separator_control( $wp_customize, 'responsive_blog_single_meta_separator', 1, 'responsive_single_blog_layout',111, 1 ); - // Meta Separator Text. $wp_customize->add_setting( 'responsive_single_blog_meta_separator_text', array( - 'default' => '-', + 'default' => '•', 'sanitize_callback' => 'wp_check_invalid_utf8', 'type' => 'theme_mod', 'transport' => 'postMessage', @@ -338,15 +575,13 @@ public function customizer_options( $wp_customize ) { $wp_customize->add_control( 'responsive_single_blog_meta_separator_text', array( - 'label' => __( 'Meta Separator', 'responsive' ), - 'section' => 'responsive_single_blog_layout', + 'section' => 'responsive_single_blog_post_title_layout', 'settings' => 'responsive_single_blog_meta_separator_text', - 'type' => 'text', - 'priority' => 120, + 'type' => 'hidden', ) ); - responsive_horizontal_separator_control( $wp_customize, 'responsive_single_blog_meta_separator_text_separator', 1, 'responsive_single_blog_layout',121, 1 ); + responsive_horizontal_separator_control( $wp_customize, 'responsive_single_blog_meta_separator_text_separator', 1, 'responsive_single_blog_post_title_layout',121, 1 ); // Meta Alignment. $single_blog_meta_alignment_label = esc_html__( 'Meta Alignment', 'responsive' ); @@ -362,9 +597,9 @@ public function customizer_options( $wp_customize ) { 'right' => esc_html__( 'dashicons-editor-alignleft', 'responsive' ), ); } - responsive_select_button_control( $wp_customize, 'single_blog_meta_alignment', $single_blog_meta_alignment_label, 'responsive_single_blog_layout', 130, $single_blog_meta_alignment_choices, 'left', null ); + responsive_select_button_with_switchers_control( $wp_customize, 'single_blog_meta_alignment', $single_blog_meta_alignment_label, 'responsive_single_blog_post_title_layout', 130, $single_blog_meta_alignment_choices, 'left', null ); - responsive_horizontal_separator_control( $wp_customize, 'single_blog_meta_alignment_separator', 2, 'responsive_single_blog_layout',131, 1 ); + responsive_horizontal_separator_control( $wp_customize, 'single_blog_meta_alignment_separator', 1, 'responsive_single_blog_post_title_layout',131, 1 ); // Content Alignment. $single_blog_content_alignment_label = esc_html__( 'Post Content Alignment', 'responsive' ); @@ -523,7 +758,7 @@ public function customizer_options( $wp_customize ) { ); responsive_horizontal_separator_control( $wp_customize, 'related_post_meta_elements_separator', 1, 'responsive_rp_layout',95, 1, null ); - + // Comments. $single_blog_comments_label = esc_html__( 'Comments', 'responsive' ); @@ -572,6 +807,194 @@ public function customizer_options( $wp_customize ) { responsive_padding_control( $wp_customize, 'comments_padding', 'responsive_comments_layout', 8, $default_comments_padding, $default_comments_padding, null, __( 'Padding (px)', 'responsive' ) ); responsive_padding_control( $wp_customize, 'comments_margin', 'responsive_comments_layout', 9, Responsive\Core\get_responsive_customizer_defaults( 'responsive_comments_margin_y' ), Responsive\Core\get_responsive_customizer_defaults( 'responsive_comments_margin_x' ), null, __( 'Margin (px)', 'responsive' ) ); + + // Author Box Style — only visible when author box is NOT disabled. + $author_box_style_label = esc_html__( 'Author Box Style', 'responsive' ); + $author_box_style_choices = array( + 'normal' => esc_html__( 'Normal', 'responsive' ), + 'center' => esc_html__( 'Center', 'responsive' ), + ); + responsive_select_button_control( + $wp_customize, + 'post_author_box_style', + $author_box_style_label, + 'responsive_single_blog_layout', + 106, + $author_box_style_choices, + 'normal', + 'responsive_show_post_author_box', + ); + + // Category Color. + $blog_category_color_label = __( 'Category Color', 'responsive' ); + responsive_color_control( + $wp_customize, + 'single_blog_category_color', + $blog_category_color_label, + 'responsive_single_blog_layout', + 107, + Responsive\Core\get_responsive_customizer_defaults( 'responsive_single_blog_category_color' ), + null, + '', + false, + null, + null, + false, + null, + null, + 'color', + 'refresh' + ); + + // Category Font. + $blog_category_typography_label = esc_html__( 'Category Font', 'responsive' ); + responsive_typography_group_control( + $wp_customize, + 'single_blog_category_typography_group', + $blog_category_typography_label, + 'responsive_single_blog_layout', + 108, + 'single_blog_category_typography' + ); + responsive_horizontal_separator_control( $wp_customize, 'single_blog_category_typography_separator', 1, 'responsive_single_blog_layout',109, 1, null ); + + // Meta Color. + $blog_item_meta_color_label = __( 'Meta Color', 'responsive' ); + responsive_color_control( + $wp_customize, + 'single_blog_item_meta', + $blog_item_meta_color_label, + 'responsive_single_blog_layout', + 110, + Responsive\Core\get_responsive_customizer_defaults( 'responsive_single_blog_item_meta_color' ), + null, + '', + true, + Responsive\Core\get_responsive_customizer_defaults( 'blog_item_meta_hover' ), + 'blog_item_meta_hover', + 'refresh', + ); + + // Meta Font. + $blog_meta_typography_label = esc_html__( 'Meta Font', 'responsive' ); + responsive_typography_group_control( + $wp_customize, + 'single_blog_meta_typography_group', + $blog_meta_typography_label, + 'responsive_single_blog_layout', + 111, + 'single_blog_meta_typography' + ); + responsive_horizontal_separator_control( $wp_customize, 'single_blog_meta_typography_group_separator', 1, 'responsive_single_blog_layout',112, 1, null ); + + // Breadcrumb Color + $blog_breadcrumb_color_label = __( 'Breadcrumb Color', 'responsive' ); + responsive_color_control( + $wp_customize, + 'single_blog_breadcrumb', + $blog_breadcrumb_color_label, + 'responsive_single_blog_layout', + 113, + Responsive\Core\get_responsive_customizer_defaults( 'responsive_single_blog_breadcrumb_color' ), + null, + '', + false, + null, + null, + false, + null, + null, + 'color', + 'refresh' + ); + + // Breadcrumb Font + $blog_breadcrumb_typography_label = esc_html__( 'Breadcrumb Font', 'responsive' ); + responsive_typography_group_control( + $wp_customize, + 'single_blog_breadcrumb_typography_group', + $blog_breadcrumb_typography_label, + 'responsive_single_blog_layout', + 114, + 'single_blog_breadcrumb_typography' + ); + responsive_horizontal_separator_control( $wp_customize, 'single_blog_breadcrumb_typography_group_separator', 1, 'responsive_single_blog_layout',115, 1, null ); + + // Excerpt Color + $blog_excerpt_color_label = __( 'Excerpt Color', 'responsive' ); + responsive_color_control( + $wp_customize, + 'single_blog_excerpt_color', + $blog_excerpt_color_label, + 'responsive_single_blog_layout', + 116, + Responsive\Core\get_responsive_customizer_defaults( 'responsive_single_blog_excerpt_color' ), + null, + '', + true, + Responsive\Core\get_responsive_customizer_defaults( 'single_blog_excerpt_color_hover' ), + 'single_blog_excerpt_color_hover', + 'refresh', + ); + + // Excerpt Font + $blog_excerpt_typography_label = esc_html__( 'Excerpt Font', 'responsive' ); + responsive_typography_group_control( + $wp_customize, + 'single_blog_excerpt_typography_group', + $blog_excerpt_typography_label, + 'responsive_single_blog_layout', + 117, + 'single_blog_excerpt_typography' + ); + responsive_horizontal_separator_control( $wp_customize, 'single_blog_excerpt_typography_separator', 1, 'responsive_single_blog_layout',118, 1, null ); + + // Site Background Color. + $blog_site_background_color_label = __( 'Site Background Color', 'responsive' ); + responsive_color_control( + $wp_customize, + 'single_blog_site_background', + $blog_site_background_color_label, + 'responsive_single_blog_layout', + 119, + Responsive\Core\get_responsive_customizer_defaults( 'responsive_single_blog_site_background_color' ), + null, + '', + false, + null, + null, + false, + null, + null, + 'color', + 'refresh' + ); + + // Content Background Color. + $blog_content_background_color_label = __( 'Content Background Color', 'responsive' ); + responsive_color_control( + $wp_customize, + 'single_blog_content_background', + $blog_content_background_color_label, + 'responsive_single_blog_layout', + 120, + Responsive\Core\get_responsive_customizer_defaults( 'responsive_single_blog_content_background_color' ), + null, + '', + false, + null, + null, + false, + null, + null, + 'color', + 'refresh' + ); + + // Show Post navigation + responsive_horizontal_separator_control( $wp_customize, 'single_blog_navigation_before', 1, 'responsive_single_blog_layout',271, 1 ); + responsive_toggle_control( $wp_customize, 'single_blog_navigation', __( 'Show Post Navigation', 'responsive' ), 'responsive_single_blog_layout', 272, 0, null ); + } } diff --git a/core/includes/customizer/settings/class-responsive-site-color-palettes-scheme-customizer.php b/core/includes/customizer/settings/class-responsive-site-color-palettes-scheme-customizer.php index 85b2a2d75..252e2ebd9 100644 --- a/core/includes/customizer/settings/class-responsive-site-color-palettes-scheme-customizer.php +++ b/core/includes/customizer/settings/class-responsive-site-color-palettes-scheme-customizer.php @@ -52,13 +52,13 @@ public function customizer_options( $wp_customize ) { $transport = 'postMessage'; $default_colors = array( - 'responsive_global_color_palette_accent_color' => '#0066CC', + 'responsive_global_color_palette_accent_color' => '#3B82F6', 'responsive_global_color_palette_link_hover_color' => '#10659C', - 'responsive_global_color_palette_text_color' => '#333333', - 'responsive_global_color_palette_headings_color' => '#333333', + 'responsive_global_color_palette_text_color' => '#404040', + 'responsive_global_color_palette_headings_color' => '#404040', 'responsive_global_color_palette_content_bg_color' => '#ffffff', - 'responsive_global_color_palette_site_background_color' => '#f0f5fa', - 'responsive_global_color_palette_alt_background_color' => '#eaeaea', + 'responsive_global_color_palette_site_background_color' => '#f8fafc', + 'responsive_global_color_palette_alt_background_color' => '#ffffff', 'responsive_global_color_palette_subtle_background_color' => '#10659C' ); diff --git a/core/includes/customizer/settings/class-responsive-site-layouts-customizer.php b/core/includes/customizer/settings/class-responsive-site-layouts-customizer.php index e0f6a7b20..b9020bb93 100644 --- a/core/includes/customizer/settings/class-responsive-site-layouts-customizer.php +++ b/core/includes/customizer/settings/class-responsive-site-layouts-customizer.php @@ -133,18 +133,27 @@ public function customizer_options( $wp_customize ) { $responsive_width_label = __( 'Container Layout', 'responsive' ); $responsive_width_choice = array( 'contained' => esc_html__( 'Normal', 'responsive' ), + 'narrow' => esc_html__( 'Narrow', 'responsive' ), 'full-width' => esc_html__( 'Full Width', 'responsive' ), ); - responsive_imageradio_button_control( $wp_customize, 'width', $responsive_width_label, 'responsive_layout', 10, $responsive_width_choice, 'contained', null, 'svg', 'postMessage' ); + responsive_imageradio_button_control( $wp_customize, 'width', $responsive_width_label, 'responsive_layout', 10, $responsive_width_choice, 'contained', null, 'svg', 'refresh' ); + responsive_horizontal_separator_control( $wp_customize, 'width_separator', 1, 'responsive_layout', 20, 1 ); // responsive_select_control( $wp_customize, 'width', $responsive_width_label, 'responsive_layout', 10, $responsive_width_choice, 'contained', null, 'postMessage' ); // Container Width. - $container_width_label = __( 'Container Width (px)', 'responsive' ); - responsive_drag_number_control( $wp_customize, 'container_width', $container_width_label, 'responsive_layout', 20, 1140, 'responsive_active_site_layout_contained', 1500, 768, 'postMessage' ); + $container_width_label = __( 'Wide Container Width (px)', 'responsive' ); + responsive_drag_number_control( $wp_customize, 'container_width', $container_width_label, 'responsive_layout', 8, 1340, null, 1500, 768, 'postMessage' ); if ( $wp_customize->get_control( 'responsive_container_width' ) ) { $wp_customize->get_control( 'responsive_container_width' )->description = __( 'Note: This setting applies to Desktop devices only.', 'responsive' ); } + + // Narrow Container Width. + $narrow_container_width_label = __( 'Container Width (px)', 'responsive' ); + responsive_drag_number_control( $wp_customize, 'narrow_container_width', $narrow_container_width_label, 'responsive_layout', 9, 750, null, 1000, 400, 'postMessage' ); + if ( $wp_customize->get_control( 'responsive_narrow_container_width' ) ) { + $wp_customize->get_control( 'responsive_narrow_container_width' )->description = __( 'Note: This setting applies to Desktop devices only.', 'responsive' ); + } // Header Allignment. $responsive_style_label = __( 'Container Style', 'responsive' ); $responsive_style_choice = array( @@ -152,7 +161,7 @@ public function customizer_options( $wp_customize ) { 'content-boxed' => esc_html__( 'Content Boxed', 'responsive' ), 'flat' => esc_html__( 'Flat', 'responsive' ), ); - responsive_select_button_control( $wp_customize, 'style', $responsive_style_label, 'responsive_layout', 30, $responsive_style_choice, Responsive\Core\get_responsive_customizer_defaults( 'responsive_style' ), null, 'postMessage' ); + responsive_select_button_control( $wp_customize, 'style', $responsive_style_label, 'responsive_layout', 30, $responsive_style_choice, Responsive\Core\get_responsive_customizer_defaults( 'responsive_style' ), null, 'refresh' ); // responsive_select_control( $wp_customize, 'style', $responsive_style_label, 'responsive_layout', 30, $responsive_style_choice, Responsive\Core\get_responsive_customizer_defaults( 'responsive_style' ), null, 'postMessage' ); @@ -162,7 +171,7 @@ public function customizer_options( $wp_customize ) { // Box Radius. $box_radius_label = __( 'Box Radius (px)', 'responsive' ); - responsive_radius_control( $wp_customize, 'box', 'responsive_layout', 50, 8, 8, 'responsive_not_active_site_style_flat', $box_radius_label ); + responsive_radius_control( $wp_customize, 'box', 'responsive_layout', 50, 4, 4, 'responsive_not_active_site_style_flat', $box_radius_label ); // responsive_number_control( $wp_customize, 'box_radius', $box_radius_label, 'responsive_layout', 50, 0, 'responsive_not_active_site_style_flat' ); diff --git a/core/includes/customizer/settings/class-responsive-typography-customizer.php b/core/includes/customizer/settings/class-responsive-typography-customizer.php index a7bc79a9e..11ecf664c 100644 --- a/core/includes/customizer/settings/class-responsive-typography-customizer.php +++ b/core/includes/customizer/settings/class-responsive-typography-customizer.php @@ -68,6 +68,7 @@ public function elements() { 'priority' => 2, 'exclude' => array( 'font-color' ), 'defaults' => array( + 'font-family' => 'System Font', 'font-size' => '16px', 'font-weight' => '400', 'line-height' => '1.75', @@ -106,7 +107,9 @@ public function elements() { 'priority' => 9, 'exclude' => array( 'font-color' ), 'defaults' => array( - 'font-size' => '26px', + 'font-family' => 'System Font', + 'font-size' => '30px', + 'font-weight' => '600', 'line-height' => '1.25', 'text-transform' => 'inherit', ), @@ -118,7 +121,7 @@ public function elements() { 'priority' => 11, 'exclude' => array( 'font-color' ), 'defaults' => array( - 'font-size' => '20px', + 'font-size' => '24px', 'line-height' => '1.25', 'text-transform' => 'inherit', ), @@ -165,9 +168,82 @@ public function elements() { 'priority' => 19, 'exclude' => array( 'font-color' ), 'defaults' => array( - 'font-size' => '12px', + 'font-family' => 'System Font', + 'font-size' => '14px', 'line-height' => '1.75', - 'text-transform' => 'uppercase', + 'text-transform' => 'capitalize', + ), + ), + // Blog/Archive page Item Category font + 'item_category' => array( + 'label' => esc_html__( 'Item Category', 'responsive' ), + 'target' => $selectorArray['item_category'], + 'section' => 'responsive_blog_layout', + 'priority' => 96, + 'exclude' => array( 'font-color','font-size' ), + 'defaults' => array( + 'font-size' => '13px', + 'line-height' => '1.5', + ), + ), + // Blog/Archive page Item Meta font + 'item_meta' => array( + 'label' => esc_html__( 'Item Meta Font', 'responsive' ), + 'target' => $selectorArray['item_meta'], + 'section' => 'responsive_blog_layout', + 'priority' => 98, + 'exclude' => array( 'font-color','font-size' ), + 'defaults' => array( + 'font-size' => '13px', + 'line-height' => '1.5', + ), + ), + // Single Post — Excerpt Font. + 'single_blog_excerpt' => array( + 'label' => esc_html__( 'Excerpt Font', 'responsive' ), + 'target' => $selectorArray['single_blog_excerpt'], + 'section' => 'responsive_single_blog_layout', + 'priority' => 111, + 'exclude' => array( 'font-color' ), + 'defaults' => array( + 'font-size' => '16px', + 'line-height' => '1.75', + ), + ), + // Single Post — Breadcrumb Font. + 'single_blog_breadcrumb' => array( + 'label' => esc_html__( 'Breadcrumb Font', 'responsive' ), + 'target' => $selectorArray['single_blog_breadcrumb'], + 'section' => 'responsive_single_blog_layout', + 'priority' => 109, + 'exclude' => array( 'font-color' ), + 'defaults' => array( + 'font-size' => '13px', + 'line-height' => '1.75', + ), + ), + // Single Post — Category Font. + 'single_blog_category' => array( + 'label' => esc_html__( 'Category Font', 'responsive' ), + 'target' => $selectorArray['single_blog_category'], + 'section' => 'responsive_single_blog_layout', + 'priority' => 116, + 'exclude' => array( 'font-color', 'font-size' ), + 'defaults' => array( + 'font-size' => '13px', + 'line-height' => '1.5', + ), + ), + // Single Post - Meta font + 'single_blog_meta' => array( + 'label' => esc_html__( 'Meta Font', 'responsive' ), + 'target' => $selectorArray['single_blog_meta'], + 'section' => 'responsive_single_blog_layout', + 'priority' => 98, + 'exclude' => array( 'font-color','font-size' ), + 'defaults' => array( + 'font-size' => '13px', + 'line-height' => '1.5', ), ), 'button' => array( @@ -179,6 +255,8 @@ public function elements() { 'defaults' => array( 'font-size' => '16px', 'line-height' => '1', + 'text-transform' => 'capitalize', + 'font-weight' => '400', ), ), 'input' => array( @@ -199,6 +277,7 @@ public function elements() { 'priority' => 14, 'exclude' => array( 'font-color' ), 'defaults' => array( + 'font-family' => 'System Font', 'font-size' => '20px', 'line-height' => '1', 'letter-spacing' => '0', @@ -211,6 +290,7 @@ public function elements() { 'priority' => 15, 'exclude' => array( 'font-color' ), 'defaults' => array( + 'font-family' => 'System Font', 'font-size' => '13px', 'line-height' => '1.25', 'letter-spacing' => '0', @@ -254,6 +334,7 @@ public function elements() { 'priority' => 110, 'active_callback' => 'responsive_disabled_main_menu', 'defaults' => array( + 'font-family' => 'System Font', 'font-size' => '16px', 'font-weight' => '600', 'line-height' => '1.75', @@ -289,8 +370,9 @@ public function elements() { 'section' => 'responsive_content_header_layout', 'exclude' => array( 'font-color' ), 'defaults' => array( - 'font-size' => '33px', + 'font-size' => '32px', 'line-height' => '1.75', + 'font-weight' => '600', ), ), 'content_header_description' => array( @@ -373,7 +455,7 @@ public function elements() { 'exclude' => array( 'font-color' ), 'priority' => 80, 'defaults' => array( - 'font-size' => '13px', + 'font-size' => '16px', 'line-height' => '1.75', ), ), @@ -464,7 +546,96 @@ public function elements() { 'font-size' => '16px', 'line-height' => '1.75', ), + ), + 'single_blog_post_title' => array( + 'label' => esc_html( 'Typography', 'responsive' ), + 'target' => $selectorArray['single_blog_post_title'], + 'section' => 'responsive_single_blog_post_title_layout', + 'exclude' => array( 'font-color' ), + 'priority' => 40, + 'defaults' => array( + 'font-size' => '32px', + 'line-height' => '1.75' + ) + ), + 'single_blog_post_text' => array( + 'label' => esc_html( 'Typography', 'responsive' ), + 'target' => $selectorArray['single_blog_post_text'], + 'section' => 'responsive_single_blog_post_title_layout', + 'exclude' => array( 'font-color' ), + 'priority' => 45, + 'defaults' => array( + 'font-size' => '16px', + 'line-height' => '1.75' + ) + ), + 'single_blog_post_meta' => array( + 'label' => esc_html( 'Typography', 'responsive' ), + 'target' => $selectorArray['single_blog_post_meta'], + 'section' => 'responsive_single_blog_post_title_layout', + 'exclude' => array( 'font-color' ), + 'priority' => 45, + 'defaults' => array( + 'font-size' => '12px', + 'line-height' => '1.75' + ) + ), + 'page_title_area_title' => array( + 'label' => esc_html( 'Typography', 'responsive' ), + 'target' => $selectorArray['page_title_area_title'], + 'section' => 'responsive_page_title_area_layout', + 'exclude' => array( 'font-color' ), + 'priority' => 40, + 'defaults' => array( + 'font-size' => '32px', + 'line-height' => '1.75' + ) + ), + 'page_title_area_text' => array( + 'label' => esc_html( 'Typography', 'responsive' ), + 'target' => $selectorArray['page_title_area_text'], + 'section' => 'responsive_page_title_area_layout', + 'exclude' => array( 'font-color' ), + 'priority' => 45, + 'defaults' => array( + 'font-size' => '16px', + 'line-height' => '1.75' + ) + ), + 'page_title_area_meta' => array( + 'label' => esc_html( 'Typography', 'responsive' ), + 'target' => $selectorArray['page_title_area_meta'], + 'section' => 'responsive_page_title_area_layout', + 'exclude' => array( 'font-color' ), + 'priority' => 45, + 'defaults' => array( + 'font-size' => '12px', + 'line-height' => '1.75' + ) + ), + 'blog_post_title' => array( + 'label' => esc_html( 'Typography', 'responsive' ), + 'target' => $selectorArray['blog_post_title'], + 'section' => 'responsive_blog_title_layout', + 'exclude' => array( 'font-color' ), + 'priority' => 45, + 'defaults' => array( + 'font-size' => '32px', + 'line-height' => '1.75' + ) + ), + 'blog_post_text' => array( + 'label' => esc_html( 'Typography', 'responsive' ), + 'target' => $selectorArray['blog_post_text'], + 'section' => 'responsive_blog_title_layout', + 'exclude' => array( 'font-color' ), + 'priority' => 45, + 'defaults' => array( + 'font-size' => '16px', + 'line-height' => '1.75' + ) ) + ); for( $i=1;$i<=6;$i++ ) { @@ -550,6 +721,12 @@ public function getSelectorArray() { 'header_contact_info' => '.site-header-item .responsive-header-contact-info .responsive-header-contact-info-icons-types .responsive-header-contact-info-icons-list .responsive-header-contact-info-contact-info .responsive-header-contact-info-contact-title, .site-header-item .responsive-header-contact-info .responsive-header-contact-info-icons-types .responsive-header-contact-info-icons-list .responsive-header-contact-info-contact-info .responsive-header-contact-info-contact-text', 'mobile_header_contact_info' => '.site-mobile-header-item .responsive-header-contact-info .responsive-header-contact-info-icons-types .responsive-header-contact-info-icons-list .responsive-header-contact-info-contact-info .responsive-header-contact-info-contact-title, .site-mobile-header-item .responsive-header-contact-info .responsive-header-contact-info-icons-types .responsive-header-contact-info-icons-list .responsive-header-contact-info-contact-info .responsive-header-contact-info-contact-text', 'header_off_canvas_menu' => '.responsive-off-canvas-menu-container .responsive-off-canvas-menu-wrapper .responsive-off-canvas-menu-inner-wrapper .responsive-off-canvas-menu .responsive-off-canvas-menu-items .responsive-off-canvas-menu-item a, .off-canvas-widget-area #off-canvas-menu li a, #off-canvas-site-navigation .menu li a', + 'item_category' => '.blog .hentry .post-meta .entry-category a, .archive .hentry .post-meta .entry-category a', + 'item_meta' => '.blog .hentry .post-meta .entry-author, .blog .hentry .post-meta .entry-date, .archive .hentry .post-meta .entry-author, .archive .hentry .post-meta .entry-date', + 'single_blog_excerpt' => '.single.single-post .entry-excerpt', + 'single_blog_breadcrumb' => '.single.single-post .breadcrumbs', + 'single_blog_category' => '.single.single-post .entry-category a', + 'single_blog_meta' => '.single.single-post .hentry .post-meta .entry-author, .single.single-post .hentry .post-meta .entry-date', ); if ( $this->is_responsive_version_greater() ) { @@ -791,7 +968,7 @@ public function customizer_options( $wp_customize ) { 'type' => 'theme_mod', 'sanitize_callback' => 'responsive_sanitize_select', 'transport' => $transport, - 'default' => 'meta' === $element ? 'uppercase' : '', + 'default' => 'meta' === $element ? 'capitalize' : '', ) ); @@ -1152,6 +1329,9 @@ public function loop( $return = 'css' ) { } else { $val = $val; } + if ( 'System Font' === $val || '\'System Font\'' === $val || '"System Font"' === $val ) { + $val = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'; + } $fonts[] = $val; } diff --git a/core/includes/functions-extras.php b/core/includes/functions-extras.php index eff5a78f1..194458f1d 100644 --- a/core/includes/functions-extras.php +++ b/core/includes/functions-extras.php @@ -132,7 +132,7 @@ function responsive_read_more() { global $post; if ( is_object( $post ) ) { if ( 'product' !== $post->post_type ) { - return '
    ' . __( 'Read more ›', 'responsive' ) . '
    '; + return '
    ' . __( 'Read more →', 'responsive' ) . '
    '; } } } diff --git a/core/includes/functions.php b/core/includes/functions.php index 6622bf730..6caf69f19 100644 --- a/core/includes/functions.php +++ b/core/includes/functions.php @@ -48,6 +48,7 @@ function setup() { add_filter( 'body_class', $n( 'responsive_add_custom_body_classes' ), 999 ); add_filter( 'body_class', $n( 'responsive_add_container_layout_body_classes' ), 999 ); add_filter( 'get_custom_logo', $n( 'responsive_transparent_custom_logo', 10, 1 ) ); + add_filter( 'the_content_more_link', 'responsive_modify_read_more_link' ); if ( ! class_exists( 'Responsive_Addons_Pro_Public' ) && !responsive_is_user_pro()) { add_action( 'customize_controls_print_footer_scripts', $n( 'responsive_add_pro_button' ) ); @@ -407,7 +408,13 @@ function responsive_css() { wp_enqueue_style( 'icomoon-style', get_template_directory_uri() . "/core/css/icomoon/style{$suffix}.css", false, $responsive['Version'] ); // If plugin - 'WooCommerce' is active. - if ( class_exists( 'WooCommerce' ) ) { + if ( class_exists( 'WooCommerce' ) && ( + is_woocommerce() || is_cart() || is_checkout() || is_account_page() + || responsive_check_element_present_in_hfb( 'woo-cart', 'header' ) + || responsive_check_element_in_mobile_tablet_items( 'woo-cart', 'header' ) + || responsive_page_has_woocommerce_content() + || is_customize_preview() + ) ) { wp_enqueue_style( 'responsive-woocommerce-style', get_template_directory_uri() . "/core/css/woocommerce{$suffix}.css", false, $responsive['Version'] ); } @@ -495,6 +502,58 @@ function responsive_js() { } } + +/** + * LCP fix: stop 'responsive-style' and 'icomoon-style' from blocking initial render. + */ +if ( ! function_exists( 'responsive_defer_non_critical_styles' ) ) { + function responsive_defer_non_critical_styles( $html, $handle ) { + $deferred_handles = array( 'icomoon-style' ); + + if ( ! in_array( $handle, $deferred_handles, true ) ) { + return $html; + } + + // Turn the stylesheet link into a low-priority preload that swaps + // itself to a real stylesheet once loaded, without blocking the parser. + $html = preg_replace( + "/rel=(['\"])stylesheet\\1/", + "rel='preload' as='style' onload=\"this.onload=null;this.rel='stylesheet'\"", + $html, + 1 + ); + + // Fallback for no-JS environments so styles still load. + $noscript_html = preg_replace( "/(rel=)(['\"])preload\\2\\s+as=(['\"])style\\3\\s+onload=\"[^\"]*\"/", '$1$2stylesheet$2', $html, 1 ); + $html .= ''; + + return $html; + } + add_filter( 'style_loader_tag', __NAMESPACE__ . '\\responsive_defer_non_critical_styles', 10, 2 ); +} + +/** + * LCP fix: belt-and-suspenders defer on nav/menu scripts. + * + * 'navigation-scripts' and 'responsive_theme_nested_menus' are already + * enqueued with $in_footer = true, but some caching/optimization setups + * (or third-party plugins) can still surface them as render-blocking. + * Explicitly adding `defer` guarantees they never block the parser + * regardless of where they're printed. + */ +if ( ! function_exists( 'responsive_defer_nav_scripts' ) ) { + function responsive_defer_nav_scripts( $tag, $handle ) { + $defer_handles = array( 'navigation-scripts', 'responsive_theme_nested_menus' ); + + if ( in_array( $handle, $defer_handles, true ) && false === strpos( $tag, ' defer' ) ) { + $tag = str_replace( ' src=', ' defer src=', $tag ); + } + + return $tag; + } + add_filter( 'script_loader_tag', __NAMESPACE__ . '\\responsive_defer_nav_scripts', 10, 2 ); +} + /** * A comment reply. */ @@ -693,12 +752,17 @@ function responsive_add_custom_body_classes( $classes ) { $classes[] = 'sidebar-position-' . ( ( $single_blog_sidebar_value === 'global' || $single_blog_sidebar_value === 'default' ) ? $global_sidebar_position : $single_blog_sidebar_value ); - // Single Blog Featured Image Aligmnmnet. + // Single Blog Featured Image Alignment. $classes[] = 'featured-image-alignment-' . get_theme_mod( 'responsive_single_blog_featured_image_alignment', 'left' ); // Single Blog Title Aligmnmnet. $classes[] = 'title-alignment-' . get_theme_mod( 'responsive_single_blog_title_alignment', 'left' ); - // Single Blog Meta Aligmnmnet. + $classes[] = 'title-alignment-tablet-' . get_theme_mod( 'responsive_single_blog_title_alignment_tablet', 'left' ); + $classes[] = 'title-alignment-mobile-' . get_theme_mod( 'responsive_single_blog_title_alignment_mobile', 'left' ); + + // Single Blog Meta Aligmnmnet. $classes[] = 'meta-alignment-' . get_theme_mod( 'responsive_single_blog_meta_alignment', 'left' ); + $classes[] = 'meta-alignment-tablet-' . get_theme_mod( 'responsive_single_blog_meta_alignment_tablet', 'left' ); + $classes[] = 'meta-alignment-mobile-' . get_theme_mod( 'responsive_single_blog_meta_alignment_mobile', 'left' ); // Single Blog Content Aligmnmnet. $classes[] = 'content-alignment-' . get_theme_mod( 'responsive_single_blog_content_alignment', 'left' ); @@ -833,21 +897,79 @@ function responsive_add_custom_body_classes( $classes ) { * @param array $classes Body classes. * @return array */ +/** + * Check if the narrow container layout is active for the current page context. + * + * @return bool + */ +function responsive_is_narrow_container_layout() { + $container_layout = 'default'; + + if ( class_exists( 'WooCommerce' ) && ( is_shop() || is_product_category() || is_product_tag() ) ) { + $container_layout = get_theme_mod( 'responsive_product_catalog_container_layout', 'default' ); + } elseif ( class_exists( 'WooCommerce' ) && is_product() ) { + $container_layout = get_theme_mod( 'responsive_single_product_container_layout', 'default' ); + } elseif ( is_page() ) { + $container_layout = get_post_meta( get_the_ID(), 'responsive_page_meta_container_layout', true ); + if ( ! $container_layout ) { + $container_layout = get_theme_mod( 'responsive_page_container_layout', 'default' ); + } + } elseif ( is_single() ) { + $container_layout = get_theme_mod( 'responsive_single_blog_container_layout', 'default' ); + } elseif ( ! is_singular() && ( is_home() || is_archive() ) && ! is_search() ) { + $container_layout = get_theme_mod( 'responsive_blog_container_layout', 'default' ); + } + + $global_container_layout = get_theme_mod( 'responsive_width', 'contained' ); + $global_container_layout_key = 'normal'; + if ( 'full-width' === $global_container_layout ) { + $global_container_layout_key = 'full-width'; + } elseif ( 'narrow' === $global_container_layout ) { + $global_container_layout_key = 'narrow'; + } + + $resolved_layout = ( 'default' === $container_layout || 'default_container' === $container_layout ) ? $global_container_layout_key : $container_layout; + + return 'narrow' === $resolved_layout; +} + function responsive_add_container_layout_body_classes( $classes ) { $container_layout = 'default'; - if ( is_page() ) { - $container_layout = get_theme_mod( 'responsive_page_container_layout', 'default' ); + if ( class_exists( 'WooCommerce' ) && ( is_shop() || is_product_category() || is_product_tag() ) ) { + $container_layout = get_theme_mod( 'responsive_product_catalog_container_layout', 'default' ); + } elseif ( class_exists( 'WooCommerce' ) && is_product() ) { + $container_layout = get_theme_mod( 'responsive_single_product_container_layout', 'default' ); + } elseif ( is_page() ) { + $container_layout = get_post_meta( get_the_ID(), 'responsive_page_meta_container_layout', true ); + if ( ! $container_layout ) { + $container_layout = get_theme_mod( 'responsive_page_container_layout', 'default' ); + } } elseif ( is_single() ) { $container_layout = get_theme_mod( 'responsive_single_blog_container_layout', 'default' ); } elseif ( ! is_singular() && ( is_home() || is_archive() ) && ! is_search() ) { $container_layout = get_theme_mod( 'responsive_blog_container_layout', 'default' ); } - if ( 'default' !== $container_layout ) { - $classes = array_diff( $classes, array( 'responsive-site-' . get_theme_mod( 'responsive_width', 'contained' ) ) ); - $classes[] = 'responsive-site-' . ( 'full-width' === $container_layout ? 'full-width' : 'contained' ); + if ( 'default' !== $container_layout && 'default_container' !== $container_layout ) { + $classes = array_diff( $classes, array( 'responsive-site-' . get_theme_mod( 'responsive_width', 'contained' ) ) ); + if ( 'full-width' === $container_layout ) { + $classes[] = 'responsive-site-full-width'; + } elseif ( 'narrow' === $container_layout ) { + $classes[] = 'responsive-site-narrow'; + } else { + $classes[] = 'responsive-site-contained'; + } + } + + if ( responsive_is_narrow_container_layout() ) { + $classes = array_diff( $classes, array( + 'sidebar-position-left', + 'sidebar-position-right', + 'sidebar-position-no', + ) ); + $classes[] = 'sidebar-position-no'; } return $classes; @@ -867,14 +989,14 @@ function responsive_post_meta_data() { > ' . esc_html_e( 'Posted on', 'responsive' ) . '%2$s ' . esc_html_e( 'By', 'responsive' ) . ' %4$s', + '%4$s • %2$s', 'meta-prep meta-prep-author posted', sprintf( '', esc_url( get_permalink() ), esc_attr( get_the_title() ), esc_html( get_the_date( 'c' ) ), - esc_html( get_the_date() ) + esc_html( get_the_date( 'M j, Y' ) ) ), 'byline', sprintf( @@ -1116,17 +1238,30 @@ function defaults() { $theme_options = apply_filters( 'responsive_theme_defaults', array( - 'entry_columns' => 2, - 'buttons_radius' => 0, - 'responsive_border_box' => 8, + 'entry_columns' => 3, + 'responsive_buttons_radius' => 4, + 'buttons_radius' => 4, + 'responsive_border_box' => 4, 'shop_content_width' => 100, - 'blog_content_width' => 66, + 'blog_content_width' => 100, + 'responsive_container_width' => 1340, 'single_blog_content_width' => 66, - 'page_content_width' => 66, + 'single_blog_post_title_inner_elements_spacing' => 20, + 'single_blog_post_title_layout' => 'post_title_layout1', + 'blog_title_layout' => 'post_title_layout1', + 'page_title_layout' => 'post_title_layout1', + 'page_title_inner_elements_spacing' => 10, + 'single_blog_post_title_color' => 'palette3', + 'single_blog_post_text_color' => 'palette2', + 'single_blog_post_link_color' => 'palette0', + 'single_blog_post_link_hover_color' => 'palette1', + 'responsive_narrow_container_width' => 750, + 'single_blog_content_width' => 100, + 'page_content_width' => 100, 'breadcrumb_alignment' => 'center', - 'read_more_text' => 'Read more »', - 'blog_entry_elements_positioning' => array( 'title', 'meta', 'featured_image', 'content' ), - 'blog_single_elements_positioning' => array( 'title', 'meta', 'featured_image', 'content' ), + 'read_more_text' => 'Read more →', + 'blog_entry_elements_positioning' => array( 'featured_image', 'categories', 'title', 'meta', 'content' ), + 'blog_single_elements_positioning' => array( 'categories', 'title', 'meta', 'featured_image', 'content' ), // alignment. 'blog_entry_title_alignment' => 'left', @@ -1148,7 +1283,7 @@ function defaults() { 'responsive_header_button_bg_hover_color' => 'palette7', 'responsive_mobile_header_button_bg_hover_color' => 'palette7', 'shop_product_price' => '#333333', - 'content_header_heading' => '#333333', + 'content_header_heading' => '#404040', 'content_header_description' => '#999999', 'breadcrumb' => '#1e73be', 'footer_background' => '#333333', @@ -1157,7 +1292,7 @@ function defaults() { 'footer_links_hover' => '#ffffff', 'header_background' => '#ffffff', 'header_border' => '#eaeaea', - 'header_site_title' => '#333333', + 'header_site_title' => '#404040', 'header_site_title_hover' => '#10659C', 'header_text' => 'palette2', @@ -1221,18 +1356,18 @@ function defaults() { 'responsive_alt_background_color' => 'palette6', 'responsive_button_text_color' => 'palette6', 'responsive_button_hover_text_color' => 'palette1', - 'body_text' => '#333333', + 'body_text' => '#404040', 'responsive_h1_text_color' => 'headings-color', 'responsive_h2_text_color' => 'headings-color', 'responsive_h3_text_color' => 'headings-color', 'responsive_h4_text_color' => 'headings-color', 'responsive_h5_text_color' => 'headings-color', 'responsive_h6_text_color' => 'headings-color', - 'h2_text' => '#333333', - 'h3_text' => '#333333', - 'h4_text' => '#333333', - 'h5_text' => '#333333', - 'h6_text' => '#333333', + 'h2_text' => '#404040', + 'h3_text' => '#404040', + 'h4_text' => '#404040', + 'h5_text' => '#404040', + 'h6_text' => '#404040', 'responsive_all_heading_text_color' => 'palette3', 'responsive_meta_text_color' => 'palette0', 'link' => '#0066CC', @@ -1244,9 +1379,9 @@ function defaults() { 'button_border' => '#10659C', 'button_hover_border' => '#0066CC', 'inputs_background' => '#ffffff', - 'inputs_text' => '#333333', + 'inputs_text' => '#404040', 'inputs_border' => '#cccccc', - 'label' => '#333333', + 'label' => '#404040', 'responsive_style' => 'boxed', 'responsive_sidebar_style' => 'boxed', @@ -1259,7 +1394,7 @@ function defaults() { // 'responsive_header_alignment' => 'center', 'header_menu_full_width' => 1, 'header_secondary_menu_full_width' => 1, - 'blog_content_width' => 66, + 'blog_content_width' => 100, 'res_breadcrumb' => 1, 'blog_sidebar_position' => 'global', 'header_social_show_label' => 0, @@ -1353,8 +1488,8 @@ function defaults() { ), 'responsive_header_primary_row_bg_color' => '#FFFFFF', 'responsive_header_primary_row_bg_hover_color' => '#FFFFFF', - 'responsive_header_primary_row_bottom_border_color' => '#0066CC', - 'responsive_header_primary_row_bottom_border_hover_color' => '#0066CC', + 'responsive_header_primary_row_bottom_border_color' => '#D4D4D4', + 'responsive_header_primary_row_bottom_border_hover_color' => '#D4D4D4', 'responsive_header_above_row_bg_color' => '#FFFFFF', 'responsive_header_above_row_bg_hover_color' => '#FFFFFF', 'responsive_header_above_row_bottom_border_color' => '#007CBA', @@ -1368,7 +1503,7 @@ function defaults() { 'responsive_footer_primary_row_bg_color' => '#333333', 'responsive_footer_primary_row_border_color' => '#aaaaaa', 'responsive_footer_below_row_bg_color' => '#FFFFFF', - 'responsive_footer_below_row_border_color' => '#0066CC', + 'responsive_footer_below_row_border_color' => '#D4D4D4', 'responsive_header_button_label' => 'Button', 'responsive_header_toggle_button_menu_label' => '', 'responsive_header_toggle_button_icon' => 'hamburger_solid', @@ -1704,6 +1839,9 @@ function defaults() { 'palette' => responsive_get_selected_palette_color_scheme(), ), 'responsive_single_blog_comments' => true, + 'responsive_single_blog_post_title' => true, + 'responsive_page_title_area' => true, + 'responsive_blog_title_area' => true, 'responsive_comments_position' => 'below', 'responsive_comments_border_width' => 0, 'responsive_comments_border_color' => '', @@ -1940,7 +2078,7 @@ function responsive_border_width_backward_compatibility() { } // Buttons border width - $button_border_width = get_theme_mod( 'responsive_buttons_border_width', $default_value ); + $button_border_width = get_theme_mod( 'responsive_buttons_border_width', 0 ); foreach ( $sides as $side ) { set_theme_mod( "responsive_buttons_border_width_{$side}_border", $button_border_width ); @@ -2806,4 +2944,70 @@ function responsive_prepare_css_value( $key, $default = '' ) { return $value; } + /** + * Check if the current singular page contains WooCommerce blocks or shortcodes. + * Lightweight helper — uses WordPress core has_block() and has_shortcode() + * which operate on already-fetched post content (no extra DB queries). + * Only runs on singular pages; returns false for archives/listings. + * + * @return bool True if the page contains WooCommerce content. + */ + function responsive_page_has_woocommerce_content() { + if ( ! is_singular() ) { + return false; + } + $post = get_queried_object(); + if ( ! $post || ! isset( $post->post_content ) ) { + return false; + } + + // Check for WooCommerce blocks — must use the 'woocommerce/' namespace, + // not a bare name, or has_block() silently rewrites it to 'core/...' + // and never matches. + $wc_blocks = array( + 'woocommerce/cart', + 'woocommerce/checkout', + 'woocommerce/all-products', + 'woocommerce/all-reviews', + 'woocommerce/featured-product', + 'woocommerce/product-new', + 'woocommerce/product-category', + 'woocommerce/product-best-sellers', + 'woocommerce/product-top-rated', + 'woocommerce/product-on-sale', + 'woocommerce/product-search', + ); + foreach ( $wc_blocks as $block ) { + if ( has_block( $block, $post ) ) { + return true; + } + } + + // Check for WooCommerce shortcodes. + $wc_shortcodes = array( + 'products', + 'product_category', + 'product', + 'product_page', + 'add_to_cart', + 'add_to_cart_url', + 'best_selling_products', + 'recent_products', + 'featured_products', + 'sale_products', + 'top_rated_products', + 'related_products', + 'woocommerce_cart', + 'woocommerce_checkout', + 'woocommerce_my_account', + ); + foreach ( $wc_shortcodes as $shortcode ) { + if ( has_shortcode( $post->post_content, $shortcode ) ) { + return true; + } + } + + return false; + } + } \ No newline at end of file diff --git a/core/includes/modules/related-posts/class-responsive-related-posts.php b/core/includes/modules/related-posts/class-responsive-related-posts.php index 5f371081e..3064762de 100644 --- a/core/includes/modules/related-posts/class-responsive-related-posts.php +++ b/core/includes/modules/related-posts/class-responsive-related-posts.php @@ -353,14 +353,14 @@ public function responsive_get_related_single_post_meta_data($current_post_id) ' . esc_html_e('Posted on ', 'responsive') . '', + '', 'meta-prep meta-prep-author posted', sprintf( '', esc_url(get_permalink()), esc_attr(get_the_title()), esc_html(get_the_date('c')), - esc_html(get_the_date()) + esc_html(get_the_date('M j, Y')) ) ); ?> diff --git a/core/includes/template-hooks.php b/core/includes/template-hooks.php index e423f0d0a..4b34b8016 100644 --- a/core/includes/template-hooks.php +++ b/core/includes/template-hooks.php @@ -95,4 +95,203 @@ function resposive_entry_content_404_page_template() {
    + +
    > +
    + +
    +
    + + +
    > +
    + +
    +
    + +
    +
    + ' . wp_kses_post( $responsive_page_title ) . ''; + } elseif ( 'description' === $element && $responsive_page_description ) { + echo '
    ' . wp_kses_post( $responsive_page_description ) . '
    '; + } elseif ( 'breadcrumb' === $element ) { + ?> +
    + +
    + +
    +
    + array ( 'responsive_theme_background_updater_footer_links_restyle' + ), + '6.4.1' => array ( + 'responsive_theme_background_updater_blog_container_margin_legacy' ) ); diff --git a/core/sass/_blog.scss b/core/sass/_blog.scss index fb65f7b8c..aa8053b04 100644 --- a/core/sass/_blog.scss +++ b/core/sass/_blog.scss @@ -1,4 +1,30 @@ /* Loader */ +.site-content .container { + margin: 52px auto; +} + +body.responsive-blog-container-margin-legacy .site-content .container { + margin-top: unset; + margin-bottom: unset; +} + +.blog .site-content article, .category .site-content article, .search .site-content article, .author .site-content article { + height: 100%; +} + +.post-entry .wp-block-quote { + border-left: 1px solid #404040; +} + +.blog.responsive-site-style-content-boxed .site-content #main-blog { + padding: 30px; + row-gap: 24px; +} + +.responsive-site-style-content-boxed .site-content .comments-area, .responsive-site-style-content-boxed .site-content .comment-respond { + background: none; +} + .responsive-loader { display: none; margin: 0 auto; diff --git a/core/sass/_content.scss b/core/sass/_content.scss index ce82a3799..ad55361ca 100644 --- a/core/sass/_content.scss +++ b/core/sass/_content.scss @@ -107,12 +107,8 @@ .responsive-site-style-content-boxed & { margin: 0; - border-bottom: 1px solid map-get($colors, light-gray); - } - - .entry-title { - margin-top: $base-line-height-px / 2; - margin-bottom: $base-line-height-px / 2; + border: 1px solid map-get($colors, light-gray); + border-radius: none !important; } .thumbnail { @@ -127,8 +123,8 @@ .post-data, .post-edit-link, .post-meta { - margin-top: $base-line-height-px / 2; - margin-bottom: $base-line-height-px / 2; + margin-top: 20px; + margin-bottom: 20px; color: map-get($colors, gray); font-size: map-get($font-sizes, small); @@ -213,19 +209,19 @@ .blog { &.featured-image-alignment { &-left { - .hentry .thumbnail { + .hentry .thumbnail, .responsive-single-entry-banner .container .thumbnail, .responsive-blog-single-banner2 .container .thumbnail { text-align: left; } } &-right { - .hentry .thumbnail { + .hentry .thumbnail, .responsive-single-entry-banner .container .thumbnail, .responsive-blog-single-banner2 .container .thumbnail { text-align: right; } } &-center { - .hentry .thumbnail { + .hentry .thumbnail, .responsive-single-entry-banner .container .thumbnail, .responsive-blog-single-banner2 .container .thumbnail { text-align: center; } } @@ -240,23 +236,67 @@ .blog { &.title-alignment { &-left { - .hentry .entry-title { + .hentry .entry-title, .responsive-blog-single-banner2 .container .entry-title { text-align: left; } } &-right { - .hentry .entry-title { + .hentry .entry-title, .responsive-blog-single-banner2 .container .entry-title { text-align: right; } } &-center { - .hentry .entry-title { + .hentry .entry-title, .responsive-blog-single-banner2 .container .entry-title { text-align: center; } } } + + @media (max-width: map-get($screens, lg)) { + &.title-alignment-tablet { + &-left { + .hentry .entry-title, .responsive-blog-single-banner2 .container .entry-title { + text-align: left; + } + } + + &-right { + .hentry .entry-title, .responsive-blog-single-banner2 .container .entry-title { + text-align: right; + } + } + + &-center { + .hentry .entry-title, .responsive-blog-single-banner2 .container .entry-title { + text-align: center; + } + } + } + } + + @media (max-width: map-get($screens, sm)) { + &.title-alignment-mobile { + &-left { + .hentry .entry-title, .responsive-blog-single-banner2 .container .entry-title { + text-align: left; + } + } + + &-right { + .hentry .entry-title, .responsive-blog-single-banner2 .container .entry-title { + text-align: right; + } + } + + &-center { + .hentry .entry-title, .responsive-blog-single-banner2 .container .entry-title { + text-align: center; + } + } + } + } } @@ -301,7 +341,7 @@ .blog { &.meta-alignment { &-left { - .hentry { + .hentry, .responsive-blog-single-banner2 .container { .post-data, .post-edit-link, .post-meta { @@ -311,7 +351,7 @@ } &-right { - .hentry { + .hentry, .responsive-blog-single-banner2 .container { .post-data, .post-edit-link, .post-meta { @@ -321,7 +361,7 @@ } &-center { - .hentry { + .hentry, .responsive-blog-single-banner2 .container { .post-data, .post-edit-link, .post-meta { @@ -330,6 +370,74 @@ } } } + + @media (max-width: map-get($screens, lg)) { + &.meta-alignment-tablet { + &-left { + .hentry, .responsive-blog-single-banner2 .container { + .post-data, + .post-edit-link, + .post-meta { + text-align: left; + } + } + } + + &-right { + .hentry, .responsive-blog-single-banner2 .container { + .post-data, + .post-edit-link, + .post-meta { + text-align: right; + } + } + } + + &-center, .responsive-blog-single-banner2 .container { + .hentry { + .post-data, + .post-edit-link, + .post-meta { + text-align: center; + } + } + } + } + } + + @media (max-width: map-get($screens, sm)) { + &.meta-alignment-mobile { + &-left { + .hentry, .responsive-blog-single-banner2 .container { + .post-data, + .post-edit-link, + .post-meta { + text-align: left; + } + } + } + + &-right { + .hentry, .responsive-blog-single-banner2 .container { + .post-data, + .post-edit-link, + .post-meta { + text-align: right; + } + } + } + + &-center { + .hentry, .responsive-blog-single-banner2 .container { + .post-data, + .post-edit-link, + .post-meta { + text-align: center; + } + } + } + } + } } .content-area-wrapper { @@ -349,6 +457,10 @@ margin-bottom: 0; } + &:last-child { + margin-bottom: $grid-gutter-width; + } + .archive.blog-entry-columns-2 &, .search.blog-entry-columns-2 &, .blog.blog-entry-columns-2 & { @@ -386,6 +498,10 @@ margin-bottom: 0; } + &:last-child { + margin-bottom: $grid-gutter-width; + } + .archive.blog-entry-columns-2 &, .search.blog-entry-columns-2 &, .blog.blog-entry-columns-2 & { @@ -522,10 +638,29 @@ .single .navigation .nav-links { display: flex; + justify-content: space-between; + + .nav-subtitle { + display: block; + color: #777; + margin-bottom: 5px; + } + + .nav-next { + text-align: right; + margin-left: auto; + } } -.comment-respond, -.comments-area { +.comment-respond { + margin-top: 28px; +} + +.comment-respond form p.form-submit { + margin-bottom: 0; +} + +div.comments-area { @include make-block-element(); padding: $base-line-height-px; background-color: map-get($colors, white); @@ -536,7 +671,7 @@ } .responsive-site-style-flat & { - padding: 0; + padding: 0 !important; background-color: transparent; } @@ -556,29 +691,51 @@ } .reply, - .comment-meta, .comment-author { - font-size: map-get($font-sizes, small); + font-size: map-get($font-sizes, normal); + } + + .comment-metadata { + font-size: 14px; + color: #737373; + } + + .comment-metadata a { + color: #737373; + } + + .comment-author a { + color: #404040; + } + + .reply { + margin-top: 40px; + } + + .comment-metadata .edit-link { + display: none; } .comment-reply-link { - float: right; + display: inline-block; + margin-right: 30px; + color: #737373; &:before { margin-right: $base-line-height-px / 5; - color: inherit; - font-family: icomoon; - content: "\f122"; + content: url("../../admin/images/reply.svg"); } } + .comment-edit-link { - float: right; + display: inline-block; + margin-right: 15px; + color: #737373; &:before { margin-right: $base-line-height-px / 5; - font-family: icomoon; - content: "\f044"; + content: url("../../admin/images/edit.svg"); } } @@ -638,3 +795,13 @@ embed, iframe, object { .course #commentform #submit, .course .submit, .course a.button, .course a.button:visited, .course a.comment-reply-link, .course button.button, .course input.button, .course input[type="submit"], .course-container #commentform #submit, .course-container .submit, .course-container a.button, .course-container a.button:visited, .course-container a.comment-reply-link, .course-container button.button, .course-container input.button, .course-container input[type="submit"], .lesson #commentform #submit, .lesson .submit, .lesson a.button, .lesson a.button:visited, .lesson a.comment-reply-link, .lesson button.button, .lesson input.button, .lesson input[type="submit"], .quiz #commentform #submit, .quiz .submit, .quiz a.button, .quiz a.button:visited, .quiz a.comment-reply-link, .quiz button.button, .quiz input.button, .quiz input[type="submit"], .page.front-page .button, .blog.front-page .button, .read-more-button .hentry .read-more .more-link, input[type="button"], input[type="submit"], button, .button, .wp-block-button__link, div.wpforms-container-full .wpforms-form input[type="submit"], body div.wpforms-container-full .wpforms-form button[type="submit"], div.wpforms-container-full .wpforms-form .wpforms-page-button, .read-more-button .hentry .read-more .more-link, input[type="button"], input[type="submit"], button, .button, .wp-block-button__link, div.wpforms-container-full .wpforms-form input[type="submit"], div.wpforms-container-full .wpforms-form button[type="submit"], div.wpforms-container-full .wpforms-form .wpforms-page-button, .page.woocommerce-cart .woocommerce a.button.alt, .page.woocommerce-cart .woocommerce a.button, .woocommerce-cart .woocommerce a.button.alt, .woocommerce-cart .woocommerce a.button, .woocommerce button.button, .wp-block-button__link { line-height: 1; } + +.comment-content { + margin-top: 16px; +} + + +.comment-content, +.comment-meta { + overflow: hidden; +} \ No newline at end of file diff --git a/core/sass/_form.scss b/core/sass/_form.scss index b8f9bcca0..00d6342f6 100644 --- a/core/sass/_form.scss +++ b/core/sass/_form.scss @@ -30,7 +30,6 @@ input[type="submit"] { font-weight: bold; letter-spacing: 1px; line-height: $base-line-height-px; - text-transform: uppercase; width: auto; &:focus, diff --git a/core/sass/_mixins.scss b/core/sass/_mixins.scss index a9a4c5bd6..459ef501a 100644 --- a/core/sass/_mixins.scss +++ b/core/sass/_mixins.scss @@ -51,8 +51,10 @@ color: map-get($colors, gray); font-size: map-get($font-sizes, small); - a { + a:not(:where(h1, h2, h3, h4, h5, h6) a) { @include make-link(map-get($colors, gray), map-get($colors, dark-blue)); + } + a { text-decoration: none; } } diff --git a/core/sass/_typography.scss b/core/sass/_typography.scss index 8e575ab4e..2cf3fde51 100644 --- a/core/sass/_typography.scss +++ b/core/sass/_typography.scss @@ -151,8 +151,13 @@ table { * Inline elements styles * ----------------------------------------------------------------------------- */ +a:not(:where(h1, h2, h3, h4, h5, h6) a) { + @include make-link(map-get($colors, dark-blue), map-get($colors, gray)); +} +:where(h1, h2, h3, h4, h5, h6) a { + color: inherit; +} a { - @include make-link(map-get($colors, dark-blue), map-get($colors, gray)); text-decoration: none; } diff --git a/core/sass/_variables.scss b/core/sass/_variables.scss index 72b35cd7a..524e010f0 100644 --- a/core/sass/_variables.scss +++ b/core/sass/_variables.scss @@ -21,7 +21,7 @@ $containers: ( xxxl: 4640px, ); -$grid-gutter-width: 30px; +$grid-gutter-width: 24px; $grid-columns: 12; @@ -29,9 +29,9 @@ $grid-columns: 12; // Typography variables // ----------------------------------------------------------------------------- $code-font: monospace; -$heading-font: Arial, Helvetica, sans-serif; +$heading-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; $icon-font: icomoon; -$text-font: Arial, Helvetica, sans-serif; +$text-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; $base-font-size: 16px; $base-line-height: 1.75; @@ -40,7 +40,7 @@ $heading-line-height: 1.25; $font-sizes: ( small: 13px, - normal: 16px, + normal: 18px, medium: 20px, large: 26px, extra-large: 33px, diff --git a/functions.php b/functions.php index a79d666ec..984a13a01 100644 --- a/functions.php +++ b/functions.php @@ -11,7 +11,7 @@ /** * Define constants. */ -define( 'RESPONSIVE_THEME_VERSION', '6.4.0' ); +define( 'RESPONSIVE_THEME_VERSION', '6.4.1' ); define( 'RESPONSIVE_THEME_DIR', trailingslashit( get_template_directory() ) ); define( 'RESPONSIVE_THEME_URI', trailingslashit( esc_url( get_template_directory_uri() ) ) ); define( 'RESPONSIVE_PRO_OLDER_VERSION_CHECK', '2.4.2' ); @@ -122,7 +122,7 @@ function responsive_setup_content_width() { * Content Width */ if ( ( 'contained' === get_theme_mod( 'responsive_width', 'contained' ) ) ) { - $container_max_width = esc_html( get_theme_mod( 'responsive_container_width', 1140 ) ); + $container_max_width = esc_html( get_theme_mod( 'responsive_container_width', Responsive\Core\get_responsive_customizer_defaults( 'responsive_container_width' ) ) ); // Helper to resolve sidebar position with "global" fallback $get_sidebar_position = function( $context, $fallback = 'no' ) { @@ -136,7 +136,7 @@ function responsive_setup_content_width() { $sidebar_position = $get_sidebar_position( 'page', 'no' ); if ( 'no' !== $sidebar_position ) { - $page_content_width = esc_html( get_theme_mod( 'responsive_page_content_width', 66 ) ); + $page_content_width = esc_html( get_theme_mod( 'responsive_page_content_width', 100 ) ); $content_width = ( $page_content_width / 100 ) * $container_max_width; } else { $content_width = $container_max_width; @@ -651,6 +651,27 @@ function responsive_exclude_post_cat( $query ) { endif; add_action( 'pre_get_posts', 'responsive_exclude_post_cat', 10 ); +/** + * Set custom posts per page for blog and archive pages. + */ +if ( ! function_exists( 'responsive_blog_posts_per_page' ) ) : + /** + * Set custom posts per page for blog and archive pages. + * + * @param object $query Query. + */ + function responsive_blog_posts_per_page( $query ) { + $per_page = get_theme_mod( 'responsive_blog_post_per_page', 10 ); + + if ( ! is_admin() && $query->is_main_query() ) { + if ( $query->is_home() || $query->is_archive() ) { + $query->set( 'posts_per_page', absint( $per_page ) ); + } + } + } +endif; +add_action( 'pre_get_posts', 'responsive_blog_posts_per_page', 10 ); + /** * Enqueue customizer styling */ @@ -799,7 +820,7 @@ function responsive_check_previous_version() { } ! get_theme_mod( 'responsive_header_alignment' ) && get_theme_mod( 'header_layout_options' ) ? set_theme_mod( 'responsive_header_alignment', str_replace( 'header-logo-', '', get_theme_mod( 'header_layout_options' ) ) ) : ''; - ! get_theme_mod( 'responsive_container_width' ) ? set_theme_mod( 'responsive_container_width', get_theme_mod( 'responsive_main_container_width', 1140 ) ) : ''; + ! get_theme_mod( 'responsive_container_width' ) ? set_theme_mod( 'responsive_container_width', get_theme_mod( 'responsive_main_container_width', 1340 ) ) : ''; $responsive_options_blog = array( 'full-width-page', 'blog-2-col', 'blog-3-col', 'blog-4-col' ); @@ -835,7 +856,7 @@ function responsive_check_previous_version() { if ( get_theme_mod( 'responsive_display_thumbnail_without_padding' ) ) { - ! get_theme_mod( 'responsive_blog_entry_featured_image_style' ) ? set_theme_mod( 'responsive_blog_entry_featured_image_style', 'stretched' ) : ''; + ! get_theme_mod( 'responsive_blog_entry_featured_image_style' ) ? set_theme_mod( 'responsive_blog_entry_featured_image_style', 'default' ) : ''; } if ( 'sidebar-content-page' === $responsive_options['single_post_layout_default'] ) { @@ -2660,10 +2681,10 @@ function responsive_theme_background_updater_global_palette_revamp() { 'style' => $old_palette_scheme, 'palette' => array ( 'label' => '', - 'accent' => get_theme_mod( 'responsive_global_color_palette_accent_color', '#0066CC' ), + 'accent' => get_theme_mod( 'responsive_global_color_palette_accent_color', '#3B82F6' ), 'link_hover' => get_theme_mod( 'responsive_global_color_palette_link_hover_color', '#10659C' ), - 'text' => get_theme_mod( 'responsive_global_color_palette_text_color', '#333333' ), - 'header_text' => get_theme_mod( 'responsive_global_color_palette_headings_color', '#333333' ), + 'text' => get_theme_mod( 'responsive_global_color_palette_text_color', '#404040' ), + 'header_text' => get_theme_mod( 'responsive_global_color_palette_headings_color', '#404040' ), 'content_background' => get_theme_mod( 'responsive_global_color_palette_content_bg_color', '#ffffff' ), 'site_background' => get_theme_mod( 'responsive_global_color_palette_site_background_color', '#f0f5fa' ), 'alt_background' => get_theme_mod( 'responsive_global_color_palette_alt_background_color', '#eaeaea' ), @@ -3010,6 +3031,171 @@ function responsive_theme_background_updater_footer_links_restyle() { } } +if( !function_exists( 'responsive_theme_background_updater_blog_container_margin_legacy' ) ) { + /** + * Handle backward compatibility for blog container margin which was added in 6.4.1 + * @since 6.4.1 + * @return void + */ + function responsive_theme_background_updater_blog_container_margin_legacy() { + $responsive_options = get_option( 'responsive_theme_options' ); + if ( ! isset( $responsive_options['blog_container_margin_6_4_1_backward_done'] ) || ! $responsive_options['blog_container_margin_6_4_1_backward_done'] ) { + + $single_mods = array( + 'responsive_blog_content_width' => 66, + 'responsive_container_width' => 1140, + 'responsive_blog_entry_columns' => 2, + 'responsive_page_content_width' => 66, + 'responsive_single_blog_content_width' => 66, + 'responsive_header_primary_row_bottom_border_color' => '#0066CC', + 'responsive_footer_below_row_border_color' => '#0066CC', + 'responsive_global_color_palette_accent_color' => '#0066CC', + 'responsive_global_color_palette_site_background_color' => '#F0F5FA', + 'responsive_global_color_palette_alt_background_color' => '#EAEAEA', + 'responsive_blog_entry_featured_image_style' => 'default' + ); + + foreach( $single_mods as $mod_name => $value ) { + if ( false === get_theme_mod( $mod_name, false ) ) { + set_theme_mod( $mod_name, $value ); + } + } + + $padding_types = array( + 'responsive_outside_container', + 'responsive_blog_outside_container', + 'responsive_sidebar_outside_container' + ); + $devices = array( '', '_tablet', '_mobile' ); + $sides = array( + 'top' => 0, + 'right' => 15, + 'bottom' => 0, + 'left' => 15 + ); + foreach( $padding_types as $padding_type ) { + foreach( $devices as $device ) { + foreach( $sides as $side => $value ) { + $mod_name = $padding_type . $device . '_' . $side . '_padding'; + if ( false === get_theme_mod( $mod_name, false ) ) { + set_theme_mod( $mod_name, $value ); + } + } + } + } + + $responsive_options['blog_container_margin_6_4_1_backward_legacy'] = true; + $responsive_options['blog_container_margin_6_4_1_backward_done'] = true; + update_option( 'responsive_theme_options', $responsive_options ); + } +} +} + +add_filter( 'body_class', function( $classes ) { + $responsive_options = get_option( 'responsive_theme_options' ); + if ( isset( $responsive_options['blog_container_margin_6_4_1_backward_legacy'] ) && $responsive_options['blog_container_margin_6_4_1_backward_legacy'] ) { + $classes[] = 'responsive-blog-container-margin-legacy'; + } + return $classes; +} ); + add_action( 'wp', 'responsive_header_button_border_none_legacy_migrate', 5 ); add_action( 'admin_init', 'responsive_header_button_border_none_legacy_migrate', 5 ); -add_action( 'customize_save_responsive_header_button_border_style', 'responsive_header_button_border_none_clear_legacy_on_save' ); \ No newline at end of file +add_action( 'customize_save_responsive_header_button_border_style', 'responsive_header_button_border_none_clear_legacy_on_save' ); + +if ( ! function_exists( 'responsive_is_seo_plugin_active' ) ) { + /** + * Check if a dedicated SEO plugin is active that already outputs a meta description. + * + * @return bool + */ + function responsive_is_seo_plugin_active() { + // Yoast SEO, Rank Math, All in One SEO, SEOPress, The SEO Framework. + return defined( 'WPSEO_VERSION' ) + || class_exists( 'RankMath' ) + || defined( 'AIOSEO_VERSION' ) + || defined( 'SEOPRESS_VERSION' ) + || class_exists( 'The_SEO_Framework\Load' ); + } +} + +if ( ! function_exists( 'responsive_get_meta_description' ) ) { + /** + * Build a fallback meta description string for the current request. + * + * @return string + */ + function responsive_get_meta_description() { + $description = ''; + + if ( is_home() ) { + if ( 'page' === get_option( 'show_on_front' ) && is_front_page() ) { + // Home set as a static front page + global $post; + if ( $post instanceof WP_Post && has_excerpt( $post ) ) { + $description = $post->post_excerpt; + } else { + $description = get_bloginfo( 'description' ); + } + } else { + // Default posts page as home + $description = get_bloginfo( 'description' ); + } + } + + if ( empty( $description ) ) { + $description = get_bloginfo( 'description' ); + } + + $description = wp_strip_all_tags( strip_shortcodes( $description ) ); + $description = trim( preg_replace( '/\s+/', ' ', $description ) ); + + return wp_trim_words( $description, 30, '...' ); + } +} + +if ( ! function_exists( 'responsive_output_meta_description' ) ) { + /** + * Output a meta description tag in wp_head when no SEO plugin is handling it. + */ + function responsive_output_meta_description() { + if ( is_admin() || responsive_is_seo_plugin_active() ) { + return; + } + + if ( is_404() || ( is_search() && empty( get_search_query() ) ) ) { + return; + } + + $description = responsive_get_meta_description(); + $default_desc = "Responsive is a flexible WordPress theme that helps you create fast, mobile-friendly, and professional websites."; + + if ( empty( $description ) ) { + echo '' . "\n"; + } + else{ + echo '' . "\n"; + } + } +} + +add_action( 'wp_head', 'responsive_output_meta_description', 1 ); + +/** + * Append edit link to the reply link so they appear together at the bottom. + */ +add_filter( 'comment_reply_link', 'responsive_custom_comment_reply_link', 10, 4 ); +function responsive_custom_comment_reply_link( $link, $args, $comment, $post ) { + if ( current_user_can( 'edit_comment', $comment->comment_ID ) ) { + $edit_url = get_edit_comment_link( $comment ); + $edit_link = '' . __( 'Edit', 'responsive' ) . ''; + + $pos = strrpos( $link, '' ); + if ( $pos !== false ) { + $link = substr_replace( $link, $edit_link . '', $pos, 6 ); + } else { + $link .= $edit_link; + } + } + return $link; +} \ No newline at end of file diff --git a/gutenberg-fullwidth.php b/gutenberg-fullwidth.php index 58dfa75bd..a730e5c1f 100644 --- a/gutenberg-fullwidth.php +++ b/gutenberg-fullwidth.php @@ -42,7 +42,7 @@
    '