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/core/gutenberg/gutenberg-support.php b/core/gutenberg/gutenberg-support.php index 20bf24fc9..e5780f0b9 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' ) ); @@ -140,6 +140,10 @@ function responsive_gutenberg_customizer_css() { $buttons_padding_top = esc_html( get_theme_mod( 'responsive_buttons_top_padding', 10 ) ); $buttons_padding_bottom = esc_html( get_theme_mod( 'responsive_buttons_bottom_padding', 10 ) ); + $buttons_desktop_unit = esc_html( get_theme_mod( 'responsive_buttons_desktop_unit', 'px' ) ); + $buttons_tablet_unit = esc_html( get_theme_mod( 'responsive_buttons_tablet_unit', 'px' ) ); + $buttons_mobile_unit = esc_html( get_theme_mod( 'responsive_buttons_mobile_unit', 'px' ) ); + $buttons_tablet_padding_right = esc_html( get_theme_mod( 'responsive_buttons_tablet_right_padding', 10 ) ); $buttons_tablet_padding_left = esc_html( get_theme_mod( 'responsive_buttons_tablet_left_padding', 10 ) ); $buttons_tablet_padding_top = esc_html( get_theme_mod( 'responsive_buttons_tablet_top_padding', 10 ) ); @@ -152,26 +156,34 @@ 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_width_desktop_unit = esc_html( get_theme_mod( 'responsive_buttons_border_width_desktop_unit', 'px' ) ); + $buttons_border_width_tablet_unit = esc_html( get_theme_mod( 'responsive_buttons_border_width_tablet_unit', 'px' ) ); + $buttons_border_width_mobile_unit = esc_html( get_theme_mod( 'responsive_buttons_border_width_mobile_unit', 'px' ) ); - $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' ) ) ); $button_top_right_radius = esc_html( get_theme_mod( 'responsive_buttons_radius_top_right_radius', Responsive\Core\get_responsive_customizer_defaults( 'responsive_buttons_radius' ) ) ); $button_bottom_right_radius = esc_html( get_theme_mod( 'responsive_buttons_radius_bottom_right_radius', Responsive\Core\get_responsive_customizer_defaults( 'responsive_buttons_radius' ) ) ); $button_bottom_left_radius = esc_html( get_theme_mod( 'responsive_buttons_radius_bottom_left_radius', Responsive\Core\get_responsive_customizer_defaults( 'responsive_buttons_radius' ) ) ); + + $buttons_radius_desktop_unit = esc_html( get_theme_mod( 'responsive_buttons_radius_desktop_unit', 'px' ) ); + $buttons_radius_tablet_unit = esc_html( get_theme_mod( 'responsive_buttons_radius_tablet_unit', 'px' ) ); + $buttons_radius_mobile_unit = esc_html( get_theme_mod( 'responsive_buttons_radius_mobile_unit', 'px' ) ); // Tablet button radius. $button_tablet_top_left_radius = esc_html( get_theme_mod( 'responsive_buttons_radius_tablet_top_left_radius', Responsive\Core\get_responsive_customizer_defaults( 'responsive_buttons_radius' ) ) ); $button_tablet_top_right_radius = esc_html( get_theme_mod( 'responsive_buttons_radius_tablet_top_right_radius', Responsive\Core\get_responsive_customizer_defaults( 'responsive_buttons_radius' ) ) ); @@ -483,17 +495,17 @@ function responsive_gutenberg_customizer_css() { background-color:' . $button_background . '; border-style: solid; border-color: ' . $button_border_color . '; - border-top-width: ' . $buttons_border_width_top . 'px; - border-right-width: ' . $buttons_border_width_right . 'px; - border-bottom-width: ' . $buttons_border_width_bottom . 'px; - border-left-width: ' . $buttons_border_width_left . 'px; - border-radius:' . responsive_spacing_css( $button_top_left_radius, $button_top_right_radius, $button_bottom_right_radius, $button_bottom_left_radius ) . '; + border-top-width: ' . $buttons_border_width_top . $buttons_border_width_desktop_unit . '; + border-right-width: ' . $buttons_border_width_right . $buttons_border_width_desktop_unit . '; + border-bottom-width: ' . $buttons_border_width_bottom . $buttons_border_width_desktop_unit . '; + border-left-width: ' . $buttons_border_width_left . $buttons_border_width_desktop_unit . '; + border-radius:' . responsive_spacing_css( $button_top_left_radius, $button_top_right_radius, $button_bottom_right_radius, $button_bottom_left_radius, $buttons_radius_desktop_unit ) . '; color: ' . $button_text_color . '; - padding: ' . responsive_spacing_css( $buttons_padding_top, $buttons_padding_right, $buttons_padding_bottom, $buttons_padding_left ) . '; + padding: ' . responsive_spacing_css( $buttons_padding_top, $buttons_padding_right, $buttons_padding_bottom, $buttons_padding_left, $buttons_desktop_unit ) . '; } .wp-block-search__button{ - padding: ' . responsive_spacing_css( $buttons_padding_top, $buttons_padding_right, $buttons_padding_bottom, $buttons_padding_left ) . '; + padding: ' . responsive_spacing_css( $buttons_padding_top, $buttons_padding_right, $buttons_padding_bottom, $buttons_padding_left, $buttons_desktop_unit ) . '; } .responsive-block-editor-addons-buttons-repeater.responsive-block-editor-addons-button__wrapper > .not-inherited-from-theme { 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/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/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/customize-preview-color-control.js b/core/includes/customizer/assets/js/customize-preview-color-control.js index bef5e3856..bfddec69e 100644 --- a/core/includes/customizer/assets/js/customize-preview-color-control.js +++ b/core/includes/customizer/assets/js/customize-preview-color-control.js @@ -51,6 +51,9 @@ if (typeof value === 'string' && value.startsWith('palette')) { return `var(--responsive-global-${value})`; } + if (typeof value === 'string' && value === 'border-color') { + return `var(--responsive-border-color)`; + } return value; } @@ -110,7 +113,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 +128,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 +174,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 +189,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', @@ -519,6 +522,45 @@ } ); } ); + //Global Border Color + api( 'responsive_border_color', function( value ) { + value.bind( function( newval ) { + if( newval && newval.startsWith('palette') ) { + newval = `var(--responsive-global-${newval})`; + } + document.documentElement.style.setProperty( + '--responsive-border-color', + newval + ); + } ); + } ); + + // Title Above Content Background Color + api( 'responsive_title_above_content_bg_color', function( value ) { + value.bind( function( newval ) { + if( newval && newval.startsWith('palette') ) { + newval = `var(--responsive-global-${newval})`; + } + document.documentElement.style.setProperty( + '--responsive-title-above-content-bg-color', + newval + ); + } ); + } ); + + // Title Above Content Overlay Color + api( 'responsive_title_above_content_overlay_color', function( value ) { + value.bind( function( newval ) { + if( newval && newval.startsWith('palette') ) { + newval = `var(--responsive-global-${newval})`; + } + document.documentElement.style.setProperty( + '--responsive-title-above-content-overlay-color', + newval + ); + } ); + } ); + //All Heading text Color api( 'responsive_all_heading_text_color', function( value ) { value.bind( function( newval ) { @@ -603,7 +645,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 ); } ); } ); @@ -645,7 +687,7 @@ if( newval && newval.startsWith('palette') ) { newval = `var(--responsive-global-${newval})`; } - $('a:hover').css('color', newval ); + $('a:hover').not('.link-style-color-underline .entry-content a').not('.link-style-offset-background .entry-content a').css('color', newval ); } ); } ); @@ -1818,7 +1860,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('.link-style-color-underline .entry-content a').not('.link-style-offset-background .entry-content 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 +5041,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 f2ae221fb..f67cfb111 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 @@ -327,6 +327,179 @@ } ); } ); + 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( @@ -1505,4 +1678,165 @@ }); }); + function updateWidgetBottomSpacingCss() { + jQuery('style#responsive-widget-bottom-spacing-css').remove(); + + var val = api('responsive_widget_bottom_spacing') ? api('responsive_widget_bottom_spacing').get() : 30; + var unit = api('responsive_widget_bottom_spacing_unit') ? api('responsive_widget_bottom_spacing_unit').get() : 'px'; + + var val_tablet = api('responsive_widget_bottom_spacing_tablet') ? api('responsive_widget_bottom_spacing_tablet').get() : ''; + var unit_tablet = api('responsive_widget_bottom_spacing_tablet_unit') ? api('responsive_widget_bottom_spacing_tablet_unit').get() : 'px'; + + var val_mobile = api('responsive_widget_bottom_spacing_mobile') ? api('responsive_widget_bottom_spacing_mobile').get() : ''; + var unit_mobile = api('responsive_widget_bottom_spacing_mobile_unit') ? api('responsive_widget_bottom_spacing_mobile_unit').get() : 'px'; + + var css = '#secondary.widget-area .widget-wrapper { margin-bottom: ' + val + unit + '; }'; + + if (val_tablet !== '') { + css += '@media screen and (max-width: 992px) { #secondary.widget-area .widget-wrapper { margin-bottom: ' + val_tablet + unit_tablet + '; } }'; + } + if (val_mobile !== '') { + css += '@media screen and (max-width: 576px) { #secondary.widget-area .widget-wrapper { margin-bottom: ' + val_mobile + unit_mobile + ' !important; } }'; + } + + jQuery('head').append(''); + } + + var settingsToBind = [ + 'responsive_widget_bottom_spacing', + 'responsive_widget_bottom_spacing_unit', + 'responsive_widget_bottom_spacing_tablet', + 'responsive_widget_bottom_spacing_tablet_unit', + 'responsive_widget_bottom_spacing_mobile', + 'responsive_widget_bottom_spacing_mobile_unit' + ]; + + settingsToBind.forEach(function(settingId) { + api(settingId, function(value) { + value.bind(updateWidgetBottomSpacingCss); + }); + }); + + function updateSidebarBorderDividerCss() { + jQuery('style#responsive-sidebar-border-divider-css').remove(); + + var style = api('responsive_sidebar_border_divider_style') ? api('responsive_sidebar_border_divider_style').get() : 'none'; + var width = api('responsive_sidebar_border_divider_width') ? api('responsive_sidebar_border_divider_width').get() : 0; + var unit = api('responsive_sidebar_border_divider_width_unit') ? api('responsive_sidebar_border_divider_width_unit').get() : 'px'; + var width_tablet = api('responsive_sidebar_border_divider_width_tablet') ? api('responsive_sidebar_border_divider_width_tablet').get() : ''; + var unit_tablet = api('responsive_sidebar_border_divider_width_tablet_unit') ? api('responsive_sidebar_border_divider_width_tablet_unit').get() : 'px'; + var width_mobile = api('responsive_sidebar_border_divider_width_mobile') ? api('responsive_sidebar_border_divider_width_mobile').get() : ''; + var unit_mobile = api('responsive_sidebar_border_divider_width_mobile_unit') ? api('responsive_sidebar_border_divider_width_mobile_unit').get() : 'px'; + var color = api('responsive_sidebar_border_divider_color') ? api('responsive_sidebar_border_divider_color').get() : '#cccccc'; + + if (style === 'none') { + return; + } + + var css = '@media screen and (min-width: 992px) {' + + ' body.sidebar-position-left #secondary { border-right-style: ' + style + '; border-right-width: ' + width + unit + '; border-right-color: ' + color + '; border-left-style: none; }' + + ' body.sidebar-position-right #secondary { border-left-style: ' + style + '; border-left-width: ' + width + unit + '; border-left-color: ' + color + '; border-right-style: none; }' + + '}'; + + if (width_tablet !== '') { + css += '@media screen and (min-width: 577px) and (max-width: 991px) {' + + ' body.sidebar-position-left #secondary { border-right-style: ' + style + '; border-right-width: ' + width_tablet + unit_tablet + '; border-right-color: ' + color + '; border-left-style: none; }' + + ' body.sidebar-position-right #secondary { border-left-style: ' + style + '; border-left-width: ' + width_tablet + unit_tablet + '; border-left-color: ' + color + '; border-right-style: none; }' + + '}'; + } + if (width_mobile !== '') { + css += '@media screen and (max-width: 576px) {' + + ' body.sidebar-position-left #secondary { border-right-style: ' + style + '; border-right-width: ' + width_mobile + unit_mobile + '; border-right-color: ' + color + '; border-left-style: none; }' + + ' body.sidebar-position-right #secondary { border-left-style: ' + style + '; border-left-width: ' + width_mobile + unit_mobile + '; border-left-color: ' + color + '; border-right-style: none; }' + + '}'; + } + + jQuery('head').append(''); + } + + var dividerSettingsToBind = [ + 'responsive_sidebar_border_divider_style', + 'responsive_sidebar_border_divider_width', + 'responsive_sidebar_border_divider_width_unit', + 'responsive_sidebar_border_divider_width_tablet', + 'responsive_sidebar_border_divider_width_tablet_unit', + 'responsive_sidebar_border_divider_width_mobile', + 'responsive_sidebar_border_divider_width_mobile_unit', + 'responsive_sidebar_border_divider_color' + ]; + + dividerSettingsToBind.forEach(function(settingId) { + api(settingId, function(value) { + value.bind(updateSidebarBorderDividerCss); + }); + }); + + function updateSidebarStickyCss() { + jQuery('style#responsive-sidebar-sticky-css').remove(); + var sticky = api('responsive_sidebar_sticky') ? api('responsive_sidebar_sticky').get() : 0; + if (sticky == 1) { + var isAdminBar = jQuery('body').hasClass('admin-bar'); + var hasStickyHeader = jQuery('#masthead').hasClass('sticky-header'); + + var baseOffset = 20; + var headerHeight = hasStickyHeader ? 80 : 0; + var topOffset = baseOffset + headerHeight; + var topOffsetAdmin = topOffset + (isAdminBar ? 32 : 0); + + var css = '@media screen and (min-width: 992px) {' + + ' #secondary.widget-area {' + + ' position: sticky;' + + ' top: ' + topOffsetAdmin + 'px;' + + ' align-self: flex-start;' + + ' max-height: calc(100vh - ' + (topOffsetAdmin + 20) + 'px);' + + ' overflow-y: auto;' + + ' }' + + '}'; + jQuery('head').append(''); + } + } + + api('responsive_sidebar_sticky', function(value) { + value.bind(updateSidebarStickyCss); + }); + + function updateContentEdgeSpacingCss() { + jQuery('style#responsive-content-edge-spacing-css').remove(); + + var val = api('responsive_content_edge_spacing') ? api('responsive_content_edge_spacing').get() : 12; + var unit = api('responsive_content_edge_spacing_unit') ? api('responsive_content_edge_spacing_unit').get() : 'px'; + + var val_tablet = api('responsive_content_edge_spacing_tablet') ? api('responsive_content_edge_spacing_tablet').get() : ''; + var unit_tablet = api('responsive_content_edge_spacing_tablet_unit') ? api('responsive_content_edge_spacing_tablet_unit').get() : 'px'; + + var val_mobile = api('responsive_content_edge_spacing_mobile') ? api('responsive_content_edge_spacing_mobile').get() : ''; + var unit_mobile = api('responsive_content_edge_spacing_mobile_unit') ? api('responsive_content_edge_spacing_mobile_unit').get() : 'px'; + + var css = '.container { padding-left: ' + val + unit + '; padding-right: ' + val + unit + '; }'; + + if (val_tablet !== '') { + css += '@media screen and (max-width: 992px) { .container { padding-left: ' + val_tablet + unit_tablet + '; padding-right: ' + val_tablet + unit_tablet + '; } }'; + } + if (val_mobile !== '') { + css += '@media screen and (max-width: 576px) { .container { padding-left: ' + val_mobile + unit_mobile + '; padding-right: ' + val_mobile + unit_mobile + '; } }'; + } + + jQuery('head').append(''); + } + + [ + 'responsive_content_edge_spacing', + 'responsive_content_edge_spacing_unit', + 'responsive_content_edge_spacing_tablet', + 'responsive_content_edge_spacing_tablet_unit', + 'responsive_content_edge_spacing_mobile', + 'responsive_content_edge_spacing_mobile_unit' + ].forEach(function(settingId) { + api(settingId, function(value) { + value.bind(updateContentEdgeSpacingCss); + }); + }); + + } )( jQuery ); + diff --git a/core/includes/customizer/assets/js/customize-preview-number-control.js b/core/includes/customizer/assets/js/customize-preview-number-control.js index 03a63ba6c..77c9d6c29 100644 --- a/core/includes/customizer/assets/js/customize-preview-number-control.js +++ b/core/includes/customizer/assets/js/customize-preview-number-control.js @@ -11,19 +11,23 @@ mobile_menu_breakpoint = 0; } + var desktopUnit = api.has('responsive_' + control + '_radius_desktop_unit') ? (api('responsive_' + control + '_radius_desktop_unit').get() || 'px') : (api.has('responsive_' + control + '_desktop_unit') ? (api('responsive_' + control + '_desktop_unit').get() || 'px') : 'px'); + var tabletUnit = api.has('responsive_' + control + '_radius_tablet_unit') ? (api('responsive_' + control + '_radius_tablet_unit').get() || 'px') : (api.has('responsive_' + control + '_tablet_unit') ? (api('responsive_' + control + '_tablet_unit').get() || 'px') : 'px'); + var mobileUnit = api.has('responsive_' + control + '_radius_mobile_unit') ? (api('responsive_' + control + '_radius_mobile_unit').get() || 'px') : (api.has('responsive_' + control + '_mobile_unit') ? (api('responsive_' + control + '_mobile_unit').get() || 'px') : 'px'); + jQuery('style#responsive-' + control + '-radius').remove(); - var desktopRadius = 'border-top-left-radius:' + api('responsive_' + control + '_radius_top_left_radius').get() + 'px; ' + - 'border-top-right-radius:' + api('responsive_' + control + '_radius_top_right_radius').get() + 'px; ' + - 'border-bottom-left-radius:' + api('responsive_' + control + '_radius_bottom_left_radius').get() + 'px; ' + - 'border-bottom-right-radius:' + api('responsive_' + control + '_radius_bottom_right_radius').get() + 'px;'; - var tabletRadius = 'border-top-left-radius:' + api('responsive_' + control + '_radius_tablet_top_left_radius').get() + 'px; ' + - 'border-top-right-radius:' + api('responsive_' + control + '_radius_tablet_top_right_radius').get() + 'px; ' + - 'border-bottom-left-radius:' + api('responsive_' + control + '_radius_tablet_bottom_left_radius').get() + 'px; ' + - 'border-bottom-right-radius:' + api('responsive_' + control + '_radius_tablet_bottom_right_radius').get() + 'px;'; - var mobileRadius = 'border-top-left-radius:' + api('responsive_' + control + '_radius_mobile_top_left_radius').get() + 'px; ' + - 'border-top-right-radius:' + api('responsive_' + control + '_radius_mobile_top_right_radius').get() + 'px; ' + - 'border-bottom-left-radius:' + api('responsive_' + control + '_radius_mobile_bottom_left_radius').get() + 'px; ' + - 'border-bottom-right-radius:' + api('responsive_' + control + '_radius_mobile_bottom_right_radius').get() + 'px;'; + var desktopRadius = 'border-top-left-radius:' + api('responsive_' + control + '_radius_top_left_radius').get() + desktopUnit + '; ' + + 'border-top-right-radius:' + api('responsive_' + control + '_radius_top_right_radius').get() + desktopUnit + '; ' + + 'border-bottom-left-radius:' + api('responsive_' + control + '_radius_bottom_left_radius').get() + desktopUnit + '; ' + + 'border-bottom-right-radius:' + api('responsive_' + control + '_radius_bottom_right_radius').get() + desktopUnit + ';'; + var tabletRadius = 'border-top-left-radius:' + api('responsive_' + control + '_radius_tablet_top_left_radius').get() + tabletUnit + '; ' + + 'border-top-right-radius:' + api('responsive_' + control + '_radius_tablet_top_right_radius').get() + tabletUnit + '; ' + + 'border-bottom-left-radius:' + api('responsive_' + control + '_radius_tablet_bottom_left_radius').get() + tabletUnit + '; ' + + 'border-bottom-right-radius:' + api('responsive_' + control + '_radius_tablet_bottom_right_radius').get() + tabletUnit + ';'; + var mobileRadius = 'border-top-left-radius:' + api('responsive_' + control + '_radius_mobile_top_left_radius').get() + mobileUnit + '; ' + + 'border-top-right-radius:' + api('responsive_' + control + '_radius_mobile_top_right_radius').get() + mobileUnit + '; ' + + 'border-bottom-left-radius:' + api('responsive_' + control + '_radius_mobile_bottom_left_radius').get() + mobileUnit + '; ' + + 'border-bottom-right-radius:' + api('responsive_' + control + '_radius_mobile_bottom_right_radius').get() + mobileUnit + ';'; jQuery('head').append( '
  • + 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 cf2875733..f78c4bcdd 100644 --- a/core/includes/customizer/custom-styles.php +++ b/core/includes/customizer/custom-styles.php @@ -221,19 +221,19 @@ function responsive_customizer_styles() { $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 ) ); @@ -382,6 +382,42 @@ function responsive_customizer_styles() { }"; } + // Content Left/Right Edge Spacing + $content_edge_spacing = esc_html( get_theme_mod( 'responsive_content_edge_spacing', Responsive\Core\get_responsive_customizer_defaults( 'content_edge_spacing' ) ) ); + $content_edge_spacing_unit = esc_html( get_theme_mod( 'responsive_content_edge_spacing_unit', 'px' ) ); + $content_edge_spacing_tablet = esc_html( get_theme_mod( 'responsive_content_edge_spacing_tablet', '' ) ); + $content_edge_spacing_tablet_unit = esc_html( get_theme_mod( 'responsive_content_edge_spacing_tablet_unit', 'px' ) ); + $content_edge_spacing_mobile = esc_html( get_theme_mod( 'responsive_content_edge_spacing_mobile', '' ) ); + $content_edge_spacing_mobile_unit = esc_html( get_theme_mod( 'responsive_content_edge_spacing_mobile_unit', 'px' ) ); + + if ( '' !== $content_edge_spacing ) { + $custom_css .= " + .container { + padding-left: {$content_edge_spacing}{$content_edge_spacing_unit}; + padding-right: {$content_edge_spacing}{$content_edge_spacing_unit}; + }"; + } + + if ( '' !== $content_edge_spacing_tablet ) { + $custom_css .= " + @media screen and ( max-width: 992px ) { + .container { + padding-left: {$content_edge_spacing_tablet}{$content_edge_spacing_tablet_unit}; + padding-right: {$content_edge_spacing_tablet}{$content_edge_spacing_tablet_unit}; + } + }"; + } + + if ( '' !== $content_edge_spacing_mobile ) { + $custom_css .= " + @media screen and ( max-width: 576px ) { + .container { + padding-left: {$content_edge_spacing_mobile}{$content_edge_spacing_mobile_unit}; + padding-right: {$content_edge_spacing_mobile}{$content_edge_spacing_mobile_unit}; + } + }"; + } + // Container Style (Default / Boxed / Unboxed) $global_container_style = get_theme_mod( 'responsive_style', 'boxed' ); if ( 'flat' === $global_container_style ) { @@ -406,26 +442,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; @@ -437,26 +473,39 @@ function responsive_customizer_styles() { $responsive_blog_container_style = ( 'default' === $blog_container_style_setting ) ? $global_container_style_key : $blog_container_style_setting; if ( 'boxed' === $responsive_blog_container_style ) { + // Archive Grid Boxed Shadow. + $archive_grid_boxed_shadow_x = get_theme_mod( 'responsive_archive_grid_boxed_shadow_x_axis', 0 ); + $archive_grid_boxed_shadow_y = get_theme_mod( 'responsive_archive_grid_boxed_shadow_y_axis', 0 ); + $archive_grid_boxed_shadow_blur = get_theme_mod( 'responsive_archive_grid_boxed_shadow_blur', 0 ); + $archive_grid_boxed_shadow_spread = get_theme_mod( 'responsive_archive_grid_boxed_shadow_spread', 0 ); + $archive_grid_boxed_shadow_inset = get_theme_mod( 'responsive_archive_grid_boxed_shadow_inset', false ); + $archive_grid_boxed_shadow_color = esc_html( get_theme_mod( 'responsive_archive_grid_boxed_shadow_color', '#FFFFFF' ) ); + $archive_grid_boxed_shadow_inset_style = $archive_grid_boxed_shadow_inset ? 'inset' : ''; + $custom_css .= " .blog:not(.custom-home-page-active) .site-content .hentry, .archive:not(.post-type-archive-product) .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( $blog_inside_container_padding_top, $blog_inside_container_padding_right, $blog_inside_container_padding_bottom, $blog_inside_container_padding_left ) . "; - } + box-shadow: {$archive_grid_boxed_shadow_inset_style} {$archive_grid_boxed_shadow_x}px {$archive_grid_boxed_shadow_y}px {$archive_grid_boxed_shadow_blur}px {$archive_grid_boxed_shadow_spread}px {$archive_grid_boxed_shadow_color}; + }"; + $custom_css .= " @media screen and ( max-width: 992px ) { .blog:not(.custom-home-page-active) .site-content .hentry, .archive:not(.post-type-archive-product) .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( $blog_inside_container_tablet_padding_top, $blog_inside_container_tablet_padding_right, $blog_inside_container_tablet_padding_bottom, $blog_inside_container_tablet_padding_left ) . "; - } + }"; + $custom_css .= " } @media screen and ( max-width: 576px ) { .blog:not(.custom-home-page-active) .site-content .hentry, .archive:not(.post-type-archive-product) .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( $blog_inside_container_mobile_padding_top, $blog_inside_container_mobile_padding_right, $blog_inside_container_mobile_padding_bottom, $blog_inside_container_mobile_padding_left ) . "; - } + }"; + $custom_css .= " }"; } elseif ( 'unboxed' === $responsive_blog_container_style ) { $custom_css .= " @@ -473,6 +522,23 @@ function responsive_customizer_styles() { $single_blog_container_style_setting = get_theme_mod( 'responsive_single_blog_container_style', 'default' ); $responsive_single_blog_container_style = ( 'default' === $single_blog_container_style_setting ) ? $global_container_style_key : $single_blog_container_style_setting; + // Single Post Boxed Border Radius. + $single_post_boxed_radius = get_theme_mod( 'responsive_single_post_boxed_radius', '' ); + $single_post_boxed_radius_unit = get_theme_mod( 'responsive_single_post_boxed_radius_unit', 'px' ); + $single_post_boxed_radius_tablet = get_theme_mod( 'responsive_single_post_boxed_radius_tablet', '' ); + $single_post_boxed_radius_tablet_unit = get_theme_mod( 'responsive_single_post_boxed_radius_tablet_unit', 'px' ); + $single_post_boxed_radius_mobile = get_theme_mod( 'responsive_single_post_boxed_radius_mobile', '' ); + $single_post_boxed_radius_mobile_unit = get_theme_mod( 'responsive_single_post_boxed_radius_mobile_unit', 'px' ); + + // Single Post Boxed Shadow. + $single_post_boxed_shadow_x = get_theme_mod( 'responsive_single_post_boxed_shadow_x_axis', 0 ); + $single_post_boxed_shadow_y = get_theme_mod( 'responsive_single_post_boxed_shadow_y_axis', 0 ); + $single_post_boxed_shadow_blur = get_theme_mod( 'responsive_single_post_boxed_shadow_blur', 0 ); + $single_post_boxed_shadow_spread = get_theme_mod( 'responsive_single_post_boxed_shadow_spread', 0 ); + $single_post_boxed_shadow_inset = get_theme_mod( 'responsive_single_post_boxed_shadow_inset', false ); + $single_post_boxed_shadow_color = esc_html( responsive_prepare_css_value( 'responsive_single_post_boxed_shadow_color', '#FFFFFF' ) ); + $single_post_boxed_shadow_inset_style = $single_post_boxed_shadow_inset ? 'inset' : ''; + if ( 'boxed' === $responsive_single_blog_container_style ) { $single_boxed_background_css = ( 'gradient' === $box_background_color_type && ! empty( $box_background_gradient_color ) ) ? "background: {$box_background_gradient_color};" @@ -483,20 +549,54 @@ function responsive_customizer_styles() { {$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 ) . "; + }"; + if ( '' !== $single_post_boxed_radius ) { + $custom_css .= " + .single:not(.single-product) .site-content .hentry { + border-radius: {$single_post_boxed_radius}{$single_post_boxed_radius_unit}; + }"; + } + $custom_css .= " + .single:not(.single-product) .site-content .hentry { + box-shadow: {$single_post_boxed_shadow_inset_style} {$single_post_boxed_shadow_x}px {$single_post_boxed_shadow_y}px {$single_post_boxed_shadow_blur}px {$single_post_boxed_shadow_spread}px {$single_post_boxed_shadow_color}; } @media screen and ( max-width: 992px ) { .single:not(.single-product) .site-content .hentry, .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 ) . "; - } + }"; + if ( '' !== $single_post_boxed_radius_tablet ) { + $custom_css .= " + .single:not(.single-product) .site-content .hentry { + border-radius: {$single_post_boxed_radius_tablet}{$single_post_boxed_radius_tablet_unit}; + }"; + } elseif ( '' !== $single_post_boxed_radius ) { + $custom_css .= " + .single:not(.single-product) .site-content .hentry { + border-radius: {$single_post_boxed_radius}{$single_post_boxed_radius_unit}; + }"; + } + $custom_css .= " } @media screen and ( max-width: 576px ) { .single:not(.single-product) .site-content .hentry, .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 ) . "; - } + }"; + if ( '' !== $single_post_boxed_radius_mobile ) { + $custom_css .= " + .single:not(.single-product) .site-content .hentry { + border-radius: {$single_post_boxed_radius_mobile}{$single_post_boxed_radius_mobile_unit}; + }"; + } elseif ( '' !== $single_post_boxed_radius ) { + $custom_css .= " + .single:not(.single-product) .site-content .hentry { + border-radius: {$single_post_boxed_radius}{$single_post_boxed_radius_unit}; + }"; + } + $custom_css .= " }"; } elseif ( 'unboxed' === $responsive_single_blog_container_style ) { $custom_css .= " @@ -507,6 +607,47 @@ function responsive_customizer_styles() { padding: " . responsive_spacing_css( $outside_container_padding_top, $outside_container_padding_right, $outside_container_padding_bottom, $outside_container_padding_left) . "; }"; + } elseif ( 'content-boxed' === $responsive_single_blog_container_style ) { + $custom_css .= " + .single:not(.single-product) .site-content .hentry { + box-shadow: {$single_post_boxed_shadow_inset_style} {$single_post_boxed_shadow_x}px {$single_post_boxed_shadow_y}px {$single_post_boxed_shadow_blur}px {$single_post_boxed_shadow_spread}px {$single_post_boxed_shadow_color}; + }"; + if ( '' !== $single_post_boxed_radius ) { + $custom_css .= " + .single:not(.single-product) .site-content .hentry { + border-radius: {$single_post_boxed_radius}{$single_post_boxed_radius_unit}; + }"; + } + if ( '' !== $single_post_boxed_radius_tablet ) { + $custom_css .= " + @media screen and ( max-width: 992px ) { + .single:not(.single-product) .site-content .hentry { + border-radius: {$single_post_boxed_radius_tablet}{$single_post_boxed_radius_tablet_unit}; + } + }"; + } elseif ( '' !== $single_post_boxed_radius ) { + $custom_css .= " + @media screen and ( max-width: 992px ) { + .single:not(.single-product) .site-content .hentry { + border-radius: {$single_post_boxed_radius}{$single_post_boxed_radius_unit}; + } + }"; + } + if ( '' !== $single_post_boxed_radius_mobile ) { + $custom_css .= " + @media screen and ( max-width: 576px ) { + .single:not(.single-product) .site-content .hentry { + border-radius: {$single_post_boxed_radius_mobile}{$single_post_boxed_radius_mobile_unit}; + } + }"; + } elseif ( '' !== $single_post_boxed_radius ) { + $custom_css .= " + @media screen and ( max-width: 576px ) { + .single:not(.single-product) .site-content .hentry { + border-radius: {$single_post_boxed_radius}{$single_post_boxed_radius_unit}; + } + }"; + } } // Product Catalog Container Style. @@ -596,6 +737,8 @@ function responsive_customizer_styles() { $custom_css .= ' :root { --responsive-scrollbar-width: ' . $scrollbar_width . '; + --responsive-title-above-content-bg-color: ' . esc_attr( responsive_prepare_css_value( 'responsive_title_above_content_bg_color', Responsive\Core\get_responsive_customizer_defaults( 'responsive_title_above_content_bg_color' ) ) ) . '; + --responsive-title-above-content-overlay-color: ' . esc_attr( responsive_prepare_css_value( 'responsive_title_above_content_overlay_color', Responsive\Core\get_responsive_customizer_defaults( 'responsive_title_above_content_overlay_color' ) ) ) . '; } '; if ( 'gradient' === $box_background_color_type && ! empty( $box_background_gradient_color ) ) { @@ -630,6 +773,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, @@ -676,6 +820,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, @@ -743,6 +888,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; @@ -781,6 +927,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; @@ -1014,6 +1161,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}; @@ -1157,14 +1305,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; @@ -1381,6 +1531,10 @@ function responsive_customizer_styles() { $buttons_padding_top = esc_html( get_theme_mod( 'responsive_buttons_top_padding', 10 ) ); $buttons_padding_bottom = esc_html( get_theme_mod( 'responsive_buttons_bottom_padding', 10 ) ); + $buttons_desktop_unit = esc_html( get_theme_mod( 'responsive_buttons_desktop_unit', 'px' ) ); + $buttons_tablet_unit = esc_html( get_theme_mod( 'responsive_buttons_tablet_unit', 'px' ) ); + $buttons_mobile_unit = esc_html( get_theme_mod( 'responsive_buttons_mobile_unit', 'px' ) ); + $buttons_tablet_padding_right = esc_html( get_theme_mod( 'responsive_buttons_tablet_right_padding', 10 ) ); $buttons_tablet_padding_left = esc_html( get_theme_mod( 'responsive_buttons_tablet_left_padding', 10 ) ); $buttons_tablet_padding_top = esc_html( get_theme_mod( 'responsive_buttons_tablet_top_padding', 10 ) ); @@ -1398,6 +1552,10 @@ function responsive_customizer_styles() { $button_bottom_right_radius = esc_html( get_theme_mod( 'responsive_buttons_radius_bottom_right_radius', Responsive\Core\get_responsive_customizer_defaults( 'responsive_buttons_radius' ) ) ); $button_bottom_left_radius = esc_html( get_theme_mod( 'responsive_buttons_radius_bottom_left_radius', Responsive\Core\get_responsive_customizer_defaults( 'responsive_buttons_radius' ) ) ); + $buttons_radius_desktop_unit = esc_html( get_theme_mod( 'responsive_buttons_radius_desktop_unit', 'px' ) ); + $buttons_radius_tablet_unit = esc_html( get_theme_mod( 'responsive_buttons_radius_tablet_unit', 'px' ) ); + $buttons_radius_mobile_unit = esc_html( get_theme_mod( 'responsive_buttons_radius_mobile_unit', 'px' ) ); + // Tablet button. $button_tablet_top_left_radius = esc_html( get_theme_mod( 'responsive_buttons_radius_tablet_top_left_radius', Responsive\Core\get_responsive_customizer_defaults( 'responsive_buttons_radius' ) ) ); $button_tablet_top_right_radius = esc_html( get_theme_mod( 'responsive_buttons_radius_tablet_top_right_radius', Responsive\Core\get_responsive_customizer_defaults( 'responsive_buttons_radius' ) ) ); @@ -1411,20 +1569,42 @@ 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_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_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_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_width_desktop_unit = esc_html( get_theme_mod( 'responsive_buttons_border_width_desktop_unit', 'px' ) ); + $buttons_border_width_tablet_unit = esc_html( get_theme_mod( 'responsive_buttons_border_width_tablet_unit', 'px' ) ); + $buttons_border_width_mobile_unit = esc_html( get_theme_mod( 'responsive_buttons_border_width_mobile_unit', 'px' ) ); + + $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', 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 Shadow. + $button_shadow_x = get_theme_mod( 'responsive_button_shadow_x_axis', Responsive\Core\get_responsive_customizer_defaults( 'responsive_button_shadow_x' ) ); + $button_shadow_y = get_theme_mod( 'responsive_button_shadow_y_axis', Responsive\Core\get_responsive_customizer_defaults( 'responsive_button_shadow_y' ) ); + $button_shadow_blur = get_theme_mod( 'responsive_button_shadow_blur', Responsive\Core\get_responsive_customizer_defaults( 'responsive_button_shadow_blur' ) ); + $button_shadow_spread = get_theme_mod( 'responsive_button_shadow_spread', Responsive\Core\get_responsive_customizer_defaults( 'responsive_button_shadow_spread' ) ); + $button_shadow_inset = get_theme_mod( 'responsive_button_shadow_inset', Responsive\Core\get_responsive_customizer_defaults( 'responsive_button_shadow_inset' ) ); + $button_shadow_color = esc_html( responsive_prepare_css_value( 'responsive_button_shadow_color', Responsive\Core\get_responsive_customizer_defaults( 'responsive_button_shadow_color' ) ) ); + $button_shadow_inset_style = $button_shadow_inset ? 'inset' : ''; + + // Button Hover Shadow. + $button_hover_shadow_x = get_theme_mod( 'responsive_button_hover_shadow_x_axis', Responsive\Core\get_responsive_customizer_defaults( 'responsive_button_hover_shadow_x' ) ); + $button_hover_shadow_y = get_theme_mod( 'responsive_button_hover_shadow_y_axis', Responsive\Core\get_responsive_customizer_defaults( 'responsive_button_hover_shadow_y' ) ); + $button_hover_shadow_blur = get_theme_mod( 'responsive_button_hover_shadow_blur', Responsive\Core\get_responsive_customizer_defaults( 'responsive_button_hover_shadow_blur' ) ); + $button_hover_shadow_spread = get_theme_mod( 'responsive_button_hover_shadow_spread', Responsive\Core\get_responsive_customizer_defaults( 'responsive_button_hover_shadow_spread' ) ); + $button_hover_shadow_inset = get_theme_mod( 'responsive_button_hover_shadow_inset', Responsive\Core\get_responsive_customizer_defaults( 'responsive_button_hover_shadow_inset' ) ); + $button_hover_shadow_color = esc_html( responsive_prepare_css_value( 'responsive_button_hover_shadow_color', Responsive\Core\get_responsive_customizer_defaults( 'responsive_button_hover_shadow_color' ) ) ); + $button_hover_shadow_inset_style = $button_hover_shadow_inset ? 'inset' : ''; // Inputs Padding. $inputs_padding_right = esc_html( get_theme_mod( 'responsive_inputs_right_padding', 3 ) ); @@ -1479,7 +1659,7 @@ function responsive_customizer_styles() { $input_border_mobile_left_width = esc_html( get_theme_mod( 'responsive_inputs_border_width_mobile_left_border', 1 ) ); // New Border width control ends here. - $inputs_border_color = esc_html( get_theme_mod( 'responsive_inputs_border_color', Responsive\Core\get_responsive_customizer_defaults( 'inputs_border' ) ) ); + $inputs_border_color = esc_html( responsive_prepare_css_value( 'responsive_inputs_border_color', Responsive\Core\get_responsive_customizer_defaults( 'inputs_border' ) ) ); $inputs_text_color = esc_html( get_theme_mod( 'responsive_inputs_text_color', Responsive\Core\get_responsive_customizer_defaults( 'inputs_text' ) ) ); $inputs_background_color = esc_html( get_theme_mod( 'responsive_inputs_background_color', Responsive\Core\get_responsive_customizer_defaults( 'inputs_background' ) ) ); @@ -1509,23 +1689,15 @@ 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, - .blog-entry-category *, .blog-entry-category a { - color:{$meta_text_color}; - } - .entry-category, .entry-category a, - .blog-entry-category, .blog-entry-category a, - .posted-in, .posted-in a, - .cat-links, .cat-links a { - text-transform: capitalize; - } - a:not(:where(h1, h2, h3, h4, h5, h6) a) { + a { color:{$link_color}; } :where(h1, h2, h3, h4, h5, h6) a { @@ -1539,6 +1711,100 @@ function responsive_customizer_styles() { color: {$link_hover_color}; } + /* Content Link Styles */ + .link-style-standard .entry-content p a, + .link-style-standard .entry-content strong>a, + .link-style-standard .entry-content em>a, + .link-style-standard .entry-content>ul a, + .link-style-standard .entry-content>ol a, + .link-style-color-underline .entry-content p a, + .link-style-color-underline .entry-content strong>a, + .link-style-color-underline .entry-content em>a, + .link-style-color-underline .entry-content>ul a, + .link-style-color-underline .entry-content>ol a, + .link-style-no-underline .entry-content p a, + .link-style-no-underline .entry-content strong>a, + .link-style-no-underline .entry-content em>a, + .link-style-no-underline .entry-content>ul a, + .link-style-no-underline .entry-content>ol a, + .link-style-hover-background .entry-content p a, + .link-style-hover-background .entry-content strong>a, + .link-style-hover-background .entry-content em>a, + .link-style-hover-background .entry-content>ul a, + .link-style-hover-background .entry-content>ol a { + color: {$link_color}; + } + + .link-style-standard .entry-content p a, + .link-style-standard .entry-content strong>a, + .link-style-standard .entry-content em>a, + .link-style-standard .entry-content>ul a, + .link-style-standard .entry-content>ol a, + .link-style-color-underline .entry-content p a, + .link-style-color-underline .entry-content strong>a, + .link-style-color-underline .entry-content em>a, + .link-style-color-underline .entry-content>ul a, + .link-style-color-underline .entry-content>ol a { + text-decoration: underline; + } + + .link-style-color-underline .entry-content p a:hover, + .link-style-color-underline .entry-content strong>a:hover, + .link-style-color-underline .entry-content em>a:hover, + .link-style-color-underline .entry-content>ul a:hover, + .link-style-color-underline .entry-content>ol a:hover { + color: {$link_color}; + text-decoration-color: {$link_hover_color}; + } + + .link-style-no-underline .entry-content p a, + .link-style-no-underline .entry-content strong>a, + .link-style-no-underline .entry-content em>a, + .link-style-no-underline .entry-content>ul a, + .link-style-no-underline .entry-content>ol a, + .link-style-no-underline .entry-content p a:hover, + .link-style-no-underline .entry-content strong>a:hover, + .link-style-no-underline .entry-content em>a:hover, + .link-style-no-underline .entry-content>ul a:hover, + .link-style-no-underline .entry-content>ol a:hover { + text-decoration: none; + } + + .link-style-hover-background .entry-content p a:hover, + .link-style-hover-background .entry-content strong>a:hover, + .link-style-hover-background .entry-content em>a:hover, + .link-style-hover-background .entry-content>ul a:hover, + .link-style-hover-background .entry-content>ol a:hover { + background-color: {$link_color}; + color: {$link_hover_color}; + text-decoration: none; + } + + .link-style-offset-background .entry-content p a, + .link-style-offset-background .entry-content strong>a, + .link-style-offset-background .entry-content em>a, + .link-style-offset-background .entry-content>ul a, + .link-style-offset-background .entry-content>ol a { + color: inherit; + text-decoration: none; + background-image: linear-gradient(180deg, transparent 60%, {$link_color} 0%); + background-repeat: no-repeat; + background-position: 0 bottom; + background-size: 100% 10px; + } + + .link-style-offset-background .entry-content p a:hover, + .link-style-offset-background .entry-content strong>a:hover, + .link-style-offset-background .entry-content em>a:hover, + .link-style-offset-background .entry-content>ul a:hover, + .link-style-offset-background .entry-content>ol a:hover { + color: inherit; + text-decoration: none; + background-image: linear-gradient(180deg, transparent 60%, {$link_hover_color} 0%); + background-position: 0 bottom; + background-size: 100% 10px; + } + label, div.wpforms-container-full .wpforms-form .wpforms-field-label, .wp-core-ui div.wpforms-container-full .wpforms-form .wpforms-field-label { @@ -1655,13 +1921,14 @@ function responsive_customizer_styles() { background-color:' . $button_color . '; border-style: solid; border-color: ' . $button_border_color . '; - border-top-width: ' . $buttons_border_width_top . 'px; - border-right-width: ' . $buttons_border_width_right . 'px; - border-bottom-width: ' . $buttons_border_width_bottom . 'px; - border-left-width: ' . $buttons_border_width_left . 'px; - border-radius:' . responsive_spacing_css( $button_top_left_radius, $button_top_right_radius, $button_bottom_right_radius, $button_bottom_left_radius ) . '; + border-top-width: ' . $buttons_border_width_top . $buttons_border_width_desktop_unit . '; + border-right-width: ' . $buttons_border_width_right . $buttons_border_width_desktop_unit . '; + border-bottom-width: ' . $buttons_border_width_bottom . $buttons_border_width_desktop_unit . '; + border-left-width: ' . $buttons_border_width_left . $buttons_border_width_desktop_unit . '; + border-radius:' . responsive_spacing_css( $button_top_left_radius, $button_top_right_radius, $button_bottom_right_radius, $button_bottom_left_radius, $buttons_radius_desktop_unit ) . '; color: ' . $button_text_color . '; - padding: ' . responsive_spacing_css( $buttons_padding_top, $buttons_padding_right, $buttons_padding_bottom, $buttons_padding_left ) . '; + padding: ' . responsive_spacing_css( $buttons_padding_top, $buttons_padding_right, $buttons_padding_bottom, $buttons_padding_left, $buttons_desktop_unit ) . '; + box-shadow: ' . $button_shadow_inset_style . ' ' . $button_shadow_x . 'px ' . $button_shadow_y . 'px ' . $button_shadow_blur . 'px ' . $button_shadow_spread . 'px ' . $button_shadow_color . '; }'; $button_preset = get_theme_mod( 'responsive_button_presets', '' ); @@ -1681,13 +1948,13 @@ function responsive_customizer_styles() { $custom_css .= ' .wp-block-search__button{ - padding: ' . responsive_spacing_css( $buttons_padding_top, $buttons_padding_right, $buttons_padding_bottom, $buttons_padding_left ) . '; + padding: ' . responsive_spacing_css( $buttons_padding_top, $buttons_padding_right, $buttons_padding_bottom, $buttons_padding_left, $buttons_desktop_unit ) . '; border-color: ' . $button_border_color . '; border-style: solid; - border-top-width: ' . $buttons_border_width_top . 'px; - border-right-width: ' . $buttons_border_width_right . 'px; - border-bottom-width: ' . $buttons_border_width_bottom . 'px; - border-left-width: ' . $buttons_border_width_left . 'px; + border-top-width: ' . $buttons_border_width_top . $buttons_border_width_desktop_unit . '; + border-right-width: ' . $buttons_border_width_right . $buttons_border_width_desktop_unit . '; + border-bottom-width: ' . $buttons_border_width_bottom . $buttons_border_width_desktop_unit . '; + border-left-width: ' . $buttons_border_width_left . $buttons_border_width_desktop_unit . '; } @media screen and ( max-width: 992px ) { ' . $sensei_button . ' @@ -1706,24 +1973,24 @@ function responsive_customizer_styles() { body div.wpforms-container-full .wpforms-form input[type=submit]:not(:hover):not(:active), body div.wpforms-container-full .wpforms-form button[type=submit]:not(:hover):not(:active), body div.wpforms-container-full .wpforms-form .wpforms-page-button:not(:hover):not(:active), .main-navigation .menu .res-button-menu .res-custom-button, #off-canvas-site-navigation .menu .res-button-menu .res-custom-button { - padding: ' . responsive_spacing_css( $buttons_tablet_padding_top, $buttons_tablet_padding_right, $buttons_tablet_padding_bottom, $buttons_tablet_padding_left ) . '; - border-radius:' . responsive_spacing_css( $button_tablet_top_left_radius, $button_tablet_top_right_radius, $button_tablet_bottom_right_radius, $button_tablet_bottom_left_radius ) . '; + padding: ' . responsive_spacing_css( $buttons_tablet_padding_top, $buttons_tablet_padding_right, $buttons_tablet_padding_bottom, $buttons_tablet_padding_left, $buttons_tablet_unit ) . '; + border-radius:' . responsive_spacing_css( $button_tablet_top_left_radius, $button_tablet_top_right_radius, $button_tablet_bottom_right_radius, $button_tablet_bottom_left_radius, $buttons_radius_tablet_unit ) . '; border-color: ' . $button_border_color . '; border-style: solid; - border-top-width: ' . $buttons_border_tablet_width_top . 'px; - border-right-width: ' . $buttons_border_tablet_width_right . 'px; - border-bottom-width: ' . $buttons_border_tablet_width_bottom . 'px; - border-left-width: ' . $buttons_border_tablet_width_left . 'px; + border-top-width: ' . $buttons_border_tablet_width_top . $buttons_border_width_tablet_unit . '; + border-right-width: ' . $buttons_border_tablet_width_right . $buttons_border_width_tablet_unit . '; + border-bottom-width: ' . $buttons_border_tablet_width_bottom . $buttons_border_width_tablet_unit . '; + border-left-width: ' . $buttons_border_tablet_width_left . $buttons_border_width_tablet_unit . '; } .wp-block-search__button{ - padding: ' . responsive_spacing_css( $buttons_tablet_padding_top, $buttons_tablet_padding_right, $buttons_tablet_padding_bottom, $buttons_tablet_padding_left ) . '; + padding: ' . responsive_spacing_css( $buttons_tablet_padding_top, $buttons_tablet_padding_right, $buttons_tablet_padding_bottom, $buttons_tablet_padding_left, $buttons_tablet_unit ) . '; border-color: ' . $button_border_color . '; border-style: solid; - border-top-width: ' . $buttons_border_tablet_width_top . 'px; - border-right-width: ' . $buttons_border_tablet_width_right . 'px; - border-bottom-width: ' . $buttons_border_tablet_width_bottom . 'px; - border-left-width: ' . $buttons_border_tablet_width_left . 'px; + border-top-width: ' . $buttons_border_tablet_width_top . $buttons_border_width_tablet_unit . '; + border-right-width: ' . $buttons_border_tablet_width_right . $buttons_border_width_tablet_unit . '; + border-bottom-width: ' . $buttons_border_tablet_width_bottom . $buttons_border_width_tablet_unit . '; + border-left-width: ' . $buttons_border_tablet_width_left . $buttons_border_width_tablet_unit . '; } } @@ -1744,25 +2011,25 @@ function responsive_customizer_styles() { body div.wpforms-container-full .wpforms-form input[type=submit]:not(:hover):not(:active), body div.wpforms-container-full .wpforms-form button[type=submit]:not(:hover):not(:active), body div.wpforms-container-full .wpforms-form .wpforms-page-button:not(:hover):not(:active), .main-navigation .menu .res-button-menu .res-custom-button, #off-canvas-site-navigation .menu .res-button-menu .res-custom-button { - padding: ' . responsive_spacing_css( $buttons_mobile_padding_top, $buttons_mobile_padding_right, $buttons_mobile_padding_bottom, $buttons_mobile_padding_left ) . '; - border-radius:' . responsive_spacing_css( $button_mobile_top_left_radius, $button_mobile_top_right_radius, $button_mobile_bottom_right_radius, $button_mobile_bottom_left_radius ) . '; + padding: ' . responsive_spacing_css( $buttons_mobile_padding_top, $buttons_mobile_padding_right, $buttons_mobile_padding_bottom, $buttons_mobile_padding_left, $buttons_mobile_unit ) . '; + border-radius:' . responsive_spacing_css( $button_mobile_top_left_radius, $button_mobile_top_right_radius, $button_mobile_bottom_right_radius, $button_mobile_bottom_left_radius, $buttons_radius_mobile_unit ) . '; border-color: ' . $button_border_color . '; border-style: solid; - border-top-width: ' . $buttons_border_mobile_width_top . 'px; - border-right-width: ' . $buttons_border_mobile_width_right . 'px; - border-bottom-width: ' . $buttons_border_mobile_width_bottom . 'px; - border-left-width: ' . $buttons_border_mobile_width_left . 'px; + border-top-width: ' . $buttons_border_mobile_width_top . $buttons_border_width_mobile_unit . '; + border-right-width: ' . $buttons_border_mobile_width_right . $buttons_border_width_mobile_unit . '; + border-bottom-width: ' . $buttons_border_mobile_width_bottom . $buttons_border_width_mobile_unit . '; + border-left-width: ' . $buttons_border_mobile_width_left . $buttons_border_width_mobile_unit . '; } .wp-block-search__button{ - padding: ' . responsive_spacing_css( $buttons_mobile_padding_top, $buttons_mobile_padding_right, $buttons_mobile_padding_bottom, $buttons_mobile_padding_left ) . '; + padding: ' . responsive_spacing_css( $buttons_mobile_padding_top, $buttons_mobile_padding_right, $buttons_mobile_padding_bottom, $buttons_mobile_padding_left, $buttons_mobile_unit ) . '; border-color: ' . $button_border_color . '; border-style: solid; - border-top-width: ' . $buttons_border_mobile_width_top . 'px; - border-right-width: ' . $buttons_border_mobile_width_right . 'px; - border-bottom-width: ' . $buttons_border_mobile_width_bottom . 'px; - border-left-width: ' . $buttons_border_mobile_width_left . 'px; - } + border-top-width: ' . $buttons_border_mobile_width_top . $buttons_border_width_mobile_unit . '; + border-right-width: ' . $buttons_border_mobile_width_right . $buttons_border_width_mobile_unit . '; + border-bottom-width: ' . $buttons_border_mobile_width_bottom . $buttons_border_width_mobile_unit . '; + border-left-width: ' . $buttons_border_mobile_width_left . $buttons_border_width_mobile_unit . '; + }` } .page.front-page .button:focus, @@ -1806,6 +2073,7 @@ function responsive_customizer_styles() { color:' . $button_hover_text_color . '; border-color: ' . $button_hover_border_color . '; background-color:' . $button_hover_background . '; + box-shadow: ' . $button_hover_shadow_inset_style . ' ' . $button_hover_shadow_x . 'px ' . $button_hover_shadow_y . 'px ' . $button_hover_shadow_blur . 'px ' . $button_hover_shadow_spread . 'px ' . $button_hover_shadow_color . '; } select, @@ -1988,15 +2256,15 @@ function responsive_customizer_styles() { '; if ( defined( 'ELEMENTOR_VERSION' ) ) { - $custom_css .= '.elementor-button-wrapper .elementor-button, .elementor-widget-button .elementor-button{ padding: ' . responsive_spacing_css( $buttons_padding_top, $buttons_padding_right, $buttons_padding_bottom, $buttons_padding_left ) . '; }'; + $custom_css .= '.elementor-button-wrapper .elementor-button, .elementor-widget-button .elementor-button{ padding: ' . responsive_spacing_css( $buttons_padding_top, $buttons_padding_right, $buttons_padding_bottom, $buttons_padding_left, $buttons_desktop_unit ) . '; }'; $custom_css .= '@media screen and ( max-width: 992px ) { .elementor-button-wrapper .elementor-button, .elementor-widget-button .elementor-button { - padding: ' . responsive_spacing_css( $buttons_tablet_padding_top, $buttons_tablet_padding_right, $buttons_tablet_padding_bottom, $buttons_tablet_padding_left ) . ' + padding: ' . responsive_spacing_css( $buttons_tablet_padding_top, $buttons_tablet_padding_right, $buttons_tablet_padding_bottom, $buttons_tablet_padding_left, $buttons_tablet_unit ) . ' } }'; $custom_css .= '@media screen and ( max-width: 576px ) { .elementor-button-wrapper .elementor-button, .elementor-widget-button .elementor-button { - padding: ' . responsive_spacing_css( $buttons_mobile_padding_top, $buttons_mobile_padding_right, $buttons_mobile_padding_bottom, $buttons_mobile_padding_left ) . ' + padding: ' . responsive_spacing_css( $buttons_mobile_padding_top, $buttons_mobile_padding_right, $buttons_mobile_padding_bottom, $buttons_mobile_padding_left, $buttons_mobile_unit ) . ' } }'; @@ -2236,6 +2504,17 @@ function responsive_customizer_styles() { $sidebar_text_color = esc_html( responsive_prepare_css_value( 'responsive_sidebar_text_color' ) ); $sidebar_link_color = esc_html( responsive_prepare_css_value( 'responsive_sidebar_link_color' ) ); $sidebar_link_hover_color = esc_html( responsive_prepare_css_value('responsive_sidebar_link_hover_color') ); + $sidebar_link_style = get_theme_mod( 'responsive_sidebar_link_style', 'none' ); + $sidebar_link_decoration = 'none'; + $sidebar_link_hover_deco = 'none'; + + if ( 'hover' === $sidebar_link_style ) { + $sidebar_link_decoration = 'none'; + $sidebar_link_hover_deco = 'underline'; + } elseif ( 'underline' === $sidebar_link_style ) { + $sidebar_link_decoration = 'underline'; + $sidebar_link_hover_deco = 'underline'; + } $custom_css .= " .widget-area h1, .widget-area h2, .widget-area h3, .widget-area h4, .widget-area h5, .widget-area h6 { @@ -2251,10 +2530,12 @@ function responsive_customizer_styles() { } .widget-area .widget-wrapper a { color: {$sidebar_link_color}; + text-decoration: {$sidebar_link_decoration}; } .widget-area .widget-wrapper a:hover { color: {$sidebar_link_hover_color}; + text-decoration: {$sidebar_link_hover_deco}; } "; @@ -4207,11 +4488,14 @@ function responsive_customizer_styles() { // Entry Blog Meta Separator. $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}'; }"; @@ -4277,9 +4561,13 @@ function responsive_customizer_styles() { // Entry Blog Meta Separator. $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}'; }"; @@ -5093,7 +5381,7 @@ function responsive_customizer_styles() { $header_above_row_bottom_border_size_mobile = get_theme_mod( 'responsive_header_above_row_bottom_border_size_mobile', $header_above_row_bottom_border_size ); // Desktop border colors - $header_above_row_bottom_border_color = get_theme_mod( 'responsive_header_above_row_bottom_border_color', Responsive\Core\get_responsive_customizer_defaults( 'responsive_header_above_row_bottom_border_color' ) ); + $header_above_row_bottom_border_color = esc_html( responsive_prepare_css_value( 'responsive_header_above_row_bottom_border_color', Responsive\Core\get_responsive_customizer_defaults( 'responsive_header_above_row_bottom_border_color' ) ) ); $header_above_row_bottom_border_hover_color = get_theme_mod( 'responsive_header_above_row_bottom_border_color_hover', Responsive\Core\get_responsive_customizer_defaults( 'responsive_header_above_row_bottom_border_hover_color' ) ); // Tablet border colors (for mobile header on tablet) @@ -5122,7 +5410,7 @@ function responsive_customizer_styles() { $header_primary_row_bottom_border_size_mobile = get_theme_mod( 'responsive_header_primary_row_bottom_border_size_mobile', $header_primary_row_bottom_border_size ); // Desktop border colors - $header_primary_row_bottom_border_color = get_theme_mod( 'responsive_header_primary_row_bottom_border_color', Responsive\Core\get_responsive_customizer_defaults( 'responsive_header_primary_row_bottom_border_color' ) ); + $header_primary_row_bottom_border_color = esc_html( responsive_prepare_css_value( 'responsive_header_primary_row_bottom_border_color', Responsive\Core\get_responsive_customizer_defaults( 'responsive_header_primary_row_bottom_border_color' ) ) ); $header_primary_row_bottom_border_hover_color = get_theme_mod( 'responsive_header_primary_row_bottom_border_color_hover', Responsive\Core\get_responsive_customizer_defaults( 'responsive_header_primary_row_bottom_border_hover_color' ) ); // Tablet border colors (for mobile header on tablet) @@ -5151,7 +5439,7 @@ function responsive_customizer_styles() { $header_below_row_bottom_border_size_mobile = get_theme_mod( 'responsive_header_below_row_bottom_border_size_mobile', $header_below_row_bottom_border_size ); // Desktop border colors - Below Row - $header_below_row_bottom_border_color = get_theme_mod( 'responsive_header_below_row_bottom_border_color', Responsive\Core\get_responsive_customizer_defaults( 'responsive_header_below_row_bottom_border_color' ) ); + $header_below_row_bottom_border_color = esc_html( responsive_prepare_css_value( 'responsive_header_below_row_bottom_border_color', Responsive\Core\get_responsive_customizer_defaults( 'responsive_header_below_row_bottom_border_color' ) ) ); $header_below_row_bottom_border_hover_color = get_theme_mod( 'responsive_header_below_row_bottom_border_color_hover', Responsive\Core\get_responsive_customizer_defaults( 'responsive_header_below_row_bottom_border_hover_color' ) ); // Tablet border colors (for mobile header on tablet) @@ -5411,7 +5699,7 @@ function responsive_customizer_styles() { $above_footer_top_border_size = get_theme_mod( 'responsive_footer_above_row_top_border_size', 0 ); $above_footer_top_border_size_tablet = get_theme_mod( 'responsive_footer_above_row_top_border_size_tablet', $above_footer_top_border_size ); $above_footer_top_border_size_mobile = get_theme_mod( 'responsive_footer_above_row_top_border_size_mobile', $above_footer_top_border_size ); - $above_footer_top_border_color = get_theme_mod( 'responsive_footer_above_row_border_color', '#FFF' ); + $above_footer_top_border_color = esc_html( responsive_prepare_css_value( 'responsive_footer_above_row_border_color', Responsive\Core\get_responsive_customizer_defaults( 'responsive_footer_above_row_border_color' ) ) ); $above_footer_top_border_color_tablet = get_theme_mod( 'responsive_footer_above_row_border_color_tablet', $above_footer_top_border_color ); $above_footer_top_border_color_mobile = get_theme_mod( 'responsive_footer_above_row_border_color_mobile', $above_footer_top_border_color ); @@ -5514,7 +5802,7 @@ function responsive_customizer_styles() { $primary_footer_top_border_size = get_theme_mod( 'responsive_footer_primary_row_top_border_size', 1 ); $primary_footer_top_border_size_tablet = get_theme_mod( 'responsive_footer_primary_row_top_border_size_tablet', $primary_footer_top_border_size ); $primary_footer_top_border_size_mobile = get_theme_mod( 'responsive_footer_primary_row_top_border_size_mobile', $primary_footer_top_border_size ); - $primary_footer_top_border_color = get_theme_mod( 'responsive_footer_primary_row_border_color', '#aaaaaa' ); + $primary_footer_top_border_color = esc_html( responsive_prepare_css_value( 'responsive_footer_primary_row_border_color', Responsive\Core\get_responsive_customizer_defaults( 'responsive_footer_primary_row_border_color' ) ) ); $primary_footer_top_border_color_tablet = get_theme_mod( 'responsive_footer_primary_row_border_color_tablet', $primary_footer_top_border_color ); $primary_footer_top_border_color_mobile = get_theme_mod( 'responsive_footer_primary_row_border_color_mobile', $primary_footer_top_border_color ); @@ -5607,7 +5895,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 = esc_html( responsive_prepare_css_value( 'responsive_footer_below_row_border_color', Responsive\Core\get_responsive_customizer_defaults( 'responsive_footer_below_row_border_color' ) ) ); $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 ); @@ -5825,7 +6113,7 @@ function responsive_build_responsive_margin_spacing_css( $margin ) { } "; // 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']); @@ -5872,7 +6160,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 {"; @@ -7566,73 +7854,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 ) ); @@ -7652,6 +7945,14 @@ function responsive_build_responsive_margin_spacing_css( $margin ) { $sidebar_inside_container_mobile_padding_top = esc_html( get_theme_mod( 'responsive_sidebar_inside_container_mobile_top_padding', 28 ) ); $sidebar_inside_container_mobile_padding_bottom = esc_html( get_theme_mod( 'responsive_sidebar_inside_container_mobile_bottom_padding', 28 ) ); + // Widget Bottom Spacing. + $widget_bottom_spacing = esc_html( get_theme_mod( 'responsive_widget_bottom_spacing', 30 ) ); + $widget_bottom_spacing_unit = esc_html( get_theme_mod( 'responsive_widget_bottom_spacing_unit', 'px' ) ); + $widget_bottom_spacing_tablet = esc_html( get_theme_mod( 'responsive_widget_bottom_spacing_tablet', '' ) ); + $widget_bottom_spacing_tablet_unit = esc_html( get_theme_mod( 'responsive_widget_bottom_spacing_tablet_unit', 'px' ) ); + $widget_bottom_spacing_mobile = esc_html( get_theme_mod( 'responsive_widget_bottom_spacing_mobile', '' ) ); + $widget_bottom_spacing_mobile_unit = esc_html( get_theme_mod( 'responsive_widget_bottom_spacing_mobile_unit', 'px' ) ); + $custom_css .= ' .responsive-site-style-content-boxed #primary.content-area, .responsive-site-style-boxed #primary.content-area{ padding: ' . responsive_spacing_css( $outside_container_padding_top, $outside_container_padding_right, $outside_container_padding_bottom, $outside_container_padding_left ) . '; @@ -7696,29 +7997,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 . '; } } @@ -7737,19 +8038,120 @@ function responsive_build_responsive_margin_spacing_css( $margin ) { } #secondary.widget-area .widget-wrapper{ padding: ' . responsive_spacing_css( $sidebar_inside_container_padding_top, $sidebar_inside_container_padding_right, $sidebar_inside_container_padding_bottom, $sidebar_inside_container_padding_left ) . '; + margin-bottom: ' . $widget_bottom_spacing . $widget_bottom_spacing_unit . '; } @media screen and ( max-width: 992px ) { #secondary.widget-area .widget-wrapper{ padding: ' . responsive_spacing_css( $sidebar_inside_container_tablet_padding_top, $sidebar_inside_container_tablet_padding_right, $sidebar_inside_container_tablet_padding_bottom, $sidebar_inside_container_tablet_padding_left ) . '; + ' . ( '' !== $widget_bottom_spacing_tablet ? 'margin-bottom: ' . $widget_bottom_spacing_tablet . $widget_bottom_spacing_tablet_unit . ';' : '' ) . ' } } @media screen and ( max-width: 576px ) { #secondary.widget-area .widget-wrapper{ padding: ' . responsive_spacing_css( $sidebar_inside_container_mobile_padding_top, $sidebar_inside_container_mobile_padding_right, $sidebar_inside_container_mobile_padding_bottom, $sidebar_inside_container_mobile_padding_left ) . '; + ' . ( '' !== $widget_bottom_spacing_mobile ? 'margin-bottom: ' . $widget_bottom_spacing_mobile . $widget_bottom_spacing_mobile_unit . ';' : '' ) . ' } } '; + // Sidebar Border Divider. + $sidebar_border_divider_style = get_theme_mod( 'responsive_sidebar_border_divider_style', 'none' ); + $sidebar_border_divider_width = get_theme_mod( 'responsive_sidebar_border_divider_width', 0 ); + $sidebar_border_divider_width_unit = get_theme_mod( 'responsive_sidebar_border_divider_width_unit', 'px' ); + $sidebar_border_divider_width_tablet = get_theme_mod( 'responsive_sidebar_border_divider_width_tablet', '' ); + $sidebar_border_divider_width_tablet_unit = get_theme_mod( 'responsive_sidebar_border_divider_width_tablet_unit', 'px' ); + $sidebar_border_divider_width_mobile = get_theme_mod( 'responsive_sidebar_border_divider_width_mobile', '' ); + $sidebar_border_divider_width_mobile_unit = get_theme_mod( 'responsive_sidebar_border_divider_width_mobile_unit', 'px' ); + $sidebar_border_divider_color = get_theme_mod( 'responsive_sidebar_border_divider_color', '#cccccc' ); + + if ( 'none' !== $sidebar_border_divider_style ) { + $custom_css .= ' + @media screen and ( min-width: 992px ) { + body.sidebar-position-left #secondary { + border-right-style: ' . esc_html( $sidebar_border_divider_style ) . '; + border-right-width: ' . esc_html( $sidebar_border_divider_width ) . esc_html( $sidebar_border_divider_width_unit ) . '; + border-right-color: ' . esc_html( $sidebar_border_divider_color ) . '; + border-left-style: none; + } + body.sidebar-position-right #secondary { + border-left-style: ' . esc_html( $sidebar_border_divider_style ) . '; + border-left-width: ' . esc_html( $sidebar_border_divider_width ) . esc_html( $sidebar_border_divider_width_unit ) . '; + border-left-color: ' . esc_html( $sidebar_border_divider_color ) . '; + border-right-style: none; + } + } + '; + + if ( '' !== $sidebar_border_divider_width_tablet ) { + $custom_css .= ' + @media screen and ( min-width: 577px ) and ( max-width: 991px ) { + body.sidebar-position-left #secondary { + border-right-style: ' . esc_html( $sidebar_border_divider_style ) . '; + border-right-width: ' . esc_html( $sidebar_border_divider_width_tablet ) . esc_html( $sidebar_border_divider_width_tablet_unit ) . '; + border-right-color: ' . esc_html( $sidebar_border_divider_color ) . '; + border-left-style: none; + } + body.sidebar-position-right #secondary { + border-left-style: ' . esc_html( $sidebar_border_divider_style ) . '; + border-left-width: ' . esc_html( $sidebar_border_divider_width_tablet ) . esc_html( $sidebar_border_divider_width_tablet_unit ) . '; + border-left-color: ' . esc_html( $sidebar_border_divider_color ) . '; + border-right-style: none; + } + } + '; + } + + if ( '' !== $sidebar_border_divider_width_mobile ) { + $custom_css .= ' + @media screen and ( max-width: 576px ) { + body.sidebar-position-left #secondary { + border-right-style: ' . esc_html( $sidebar_border_divider_style ) . '; + border-right-width: ' . esc_html( $sidebar_border_divider_width_mobile ) . esc_html( $sidebar_border_divider_width_mobile_unit ) . '; + border-right-color: ' . esc_html( $sidebar_border_divider_color ) . '; + border-left-style: none; + } + body.sidebar-position-right #secondary { + border-left-style: ' . esc_html( $sidebar_border_divider_style ) . '; + border-left-width: ' . esc_html( $sidebar_border_divider_width_mobile ) . esc_html( $sidebar_border_divider_width_mobile_unit ) . '; + border-left-color: ' . esc_html( $sidebar_border_divider_color ) . '; + border-right-style: none; + } + } + '; + } + } + + // Sticky Sidebar. + $sidebar_sticky = get_theme_mod( 'responsive_sidebar_sticky', 0 ); + if ( 1 == $sidebar_sticky ) { + $sticky_header = false; + if ( function_exists( 'responsive_is_sticky_header_enabled' ) && responsive_is_sticky_header_enabled() ) { + $sticky_header = true; + } + + $base_offset = 20; + $header_height = $sticky_header ? 80 : 0; + + $top_desktop = $base_offset + $header_height; + $top_desktop_admin = $top_desktop + 32; + + $custom_css .= ' + @media screen and ( min-width: 992px ) { + #secondary.widget-area { + position: sticky; + top: ' . $top_desktop . 'px; + align-self: flex-start; + max-height: calc( 100vh - ' . ( $top_desktop + 20 ) . 'px ); + overflow-y: auto; + } + .admin-bar #secondary.widget-area { + top: ' . $top_desktop_admin . 'px; + max-height: calc( 100vh - ' . ( $top_desktop_admin + 20 ) . 'px ); + } + } + '; + } + // 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 ); @@ -7870,128 +8272,663 @@ function responsive_build_responsive_margin_spacing_css( $margin ) { } "; - // 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 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 ) ); - /* 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); - $body_font_val_tablet = ( isset( get_theme_mod( 'body_tablet_typography' )['font-size'] ) && '' !== get_theme_mod( 'body_tablet_typography' )['font-size'] ) ? get_theme_mod( 'body_tablet_typography' )['font-size'] : '16px'; - $body_font_val_tablet = typography_unit_conversion($body_font_val_tablet, 16); - $body_font_val_mobile = ( isset( get_theme_mod( 'body_mobile_typography' )['font-size'] ) && '' !== get_theme_mod( 'body_mobile_typography' )['font-size'] ) ? get_theme_mod( 'body_mobile_typography' )['font-size'] : '16px'; - $body_font_val_mobile = typography_unit_conversion($body_font_val_mobile, 16); + $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 ) ); - /* Calculation for desktop view */ - $datebox_month_year_font_desktop = $body_font_val_desktop - 2.5; - $datebox_day_font_desktop = $body_font_val_desktop * 2; - $datebox_container_width_height_desktop = ( $body_font_val_desktop * 2 ) + $datebox_day_font_desktop + 20; + $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 ) ); - /* Calculation for tablet view */ - $datebox_month_year_font_tablet = $body_font_val_tablet - 2.5; - $datebox_day_font_tablet = $body_font_val_tablet * 2; - $datebox_container_width_height_tablet = ( $body_font_val_tablet * 2 ) + $datebox_day_font_tablet + 20; - - /* Calculation for mobile view */ - $datebox_month_year_font_mobile = $body_font_val_mobile - 2.5; - $datebox_day_font_mobile = $body_font_val_mobile * 2; - $datebox_container_width_height_mobile = ( $body_font_val_mobile * 2 ) + $datebox_day_font_mobile + 20; - if ( $responsive_date_box ) { - $custom_css .= ".responsive-date-box { - background-color: {$date_box_background_color}; - width: {$datebox_container_width_height_desktop}px; - height: {$datebox_container_width_height_desktop}px; - } - .date-box-day { - color: {$date_box_calculated_color_value}; - font-size: {$datebox_day_font_desktop}px; - } - .date-box-month { - color: {$date_box_calculated_color_value}; - font-size: {$datebox_month_year_font_desktop}px; - } - .date-box-year { - color: {$date_box_calculated_color_value}; - font-size: {$datebox_month_year_font_desktop}px; + $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 (min-width: 576px) and (max-width: 768px) { - .responsive-date-box { - width: {$datebox_container_width_height_tablet}px; - height: {$datebox_container_width_height_tablet}px; - } - .date-box-day { - font-size: {$datebox_day_font_tablet}px; - } - .date-box-month, - .date-box-year { - font-size: {$datebox_month_year_font_tablet}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 (max-width: 575px) { - .responsive-date-box { - width: {$datebox_container_width_height_mobile}px; - height: {$datebox_container_width_height_mobile}px; - } - .date-box-day { - font-size: {$datebox_day_font_mobile}px; - } - .date-box-month, - .date-box-year { - font-size: {$datebox_month_year_font_mobile}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; } }"; - } - // Change of blog/archive date box style. - $responsive_date_box_style = esc_html( get_theme_mod( 'responsive_date_box_style' ) ); - if ( 'round' === $responsive_date_box_style ) { - $custom_css .= '.responsive-date-box { - border-radius: 100%; - }'; - } elseif ( 'square' === $responsive_date_box_style ) { - $custom_css .= '.responsive-date-box { - border-radius: 0; - }'; - } else { - $custom_css .= '.responsive-date-box { - border-radius: 0; - }'; + // 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; + }"; - //font preset css conditional addition - $font_preset_css = ""; - $preset = get_theme_mod( 'responsive_font_presets', '' ); - if ( $preset !== '' ) { - $choices = json_decode( get_theme_mod( 'font_presets_value'),true ); - if ( isset( $choices[ $preset ] ) ) { - $headingFontFamily = $choices[ $preset ]['headingFont']; - $bodyFontFamily = $choices[ $preset ]['bodyFont']; - $bodyFontWeight = $choices[ $preset ]['bodyWeight']; - $headingFontWeight = $choices[ $preset ]['headingWeight']; - responsive_enqueue_google_font($bodyFontFamily); - responsive_enqueue_google_font($headingFontFamily); - $font_preset_css .= " - /* Font Preset */ - body, .post-meta * { - font-family: {$bodyFontFamily}; - font-weight: {$bodyFontWeight}; - } - h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { - font-family: {$headingFontFamily}; - font-weight: {$headingFontWeight}; + // 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. - // Footer Builder Widget Elements alignments. - for ( $i = 1; $i <= 6; $i++ ) { - // Check if element is present in footer builder. - if ( Responsive\Core\responsive_check_element_present_in_hfb( "widget-{$i}", 'footer' ) || Responsive\Core\responsive_check_element_in_mobile_tablet_items( "widget-{$i}", 'footer' ) ) { + $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' ) + ) + ); - // Content Alignment. + 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); + $body_font_val_tablet = ( isset( get_theme_mod( 'body_tablet_typography' )['font-size'] ) && '' !== get_theme_mod( 'body_tablet_typography' )['font-size'] ) ? get_theme_mod( 'body_tablet_typography' )['font-size'] : '16px'; + $body_font_val_tablet = typography_unit_conversion($body_font_val_tablet, 16); + $body_font_val_mobile = ( isset( get_theme_mod( 'body_mobile_typography' )['font-size'] ) && '' !== get_theme_mod( 'body_mobile_typography' )['font-size'] ) ? get_theme_mod( 'body_mobile_typography' )['font-size'] : '16px'; + $body_font_val_mobile = typography_unit_conversion($body_font_val_mobile, 16); + + /* Calculation for desktop view */ + $datebox_month_year_font_desktop = $body_font_val_desktop - 2.5; + $datebox_day_font_desktop = $body_font_val_desktop * 2; + $datebox_container_width_height_desktop = ( $body_font_val_desktop * 2 ) + $datebox_day_font_desktop + 20; + + /* Calculation for tablet view */ + $datebox_month_year_font_tablet = $body_font_val_tablet - 2.5; + $datebox_day_font_tablet = $body_font_val_tablet * 2; + $datebox_container_width_height_tablet = ( $body_font_val_tablet * 2 ) + $datebox_day_font_tablet + 20; + + /* Calculation for mobile view */ + $datebox_month_year_font_mobile = $body_font_val_mobile - 2.5; + $datebox_day_font_mobile = $body_font_val_mobile * 2; + $datebox_container_width_height_mobile = ( $body_font_val_mobile * 2 ) + $datebox_day_font_mobile + 20; + + if ( $responsive_date_box ) { + $custom_css .= ".responsive-date-box { + background-color: {$date_box_background_color}; + width: {$datebox_container_width_height_desktop}px; + height: {$datebox_container_width_height_desktop}px; + } + .date-box-day { + color: {$date_box_calculated_color_value}; + font-size: {$datebox_day_font_desktop}px; + } + .date-box-month { + color: {$date_box_calculated_color_value}; + font-size: {$datebox_month_year_font_desktop}px; + } + .date-box-year { + color: {$date_box_calculated_color_value}; + font-size: {$datebox_month_year_font_desktop}px; + } + @media (min-width: 576px) and (max-width: 768px) { + .responsive-date-box { + width: {$datebox_container_width_height_tablet}px; + height: {$datebox_container_width_height_tablet}px; + } + .date-box-day { + font-size: {$datebox_day_font_tablet}px; + } + .date-box-month, + .date-box-year { + font-size: {$datebox_month_year_font_tablet}px; + } + } + @media (max-width: 575px) { + .responsive-date-box { + width: {$datebox_container_width_height_mobile}px; + height: {$datebox_container_width_height_mobile}px; + } + .date-box-day { + font-size: {$datebox_day_font_mobile}px; + } + .date-box-month, + .date-box-year { + font-size: {$datebox_month_year_font_mobile}px; + } + }"; + } + + // Change of blog/archive date box style. + $responsive_date_box_style = esc_html( get_theme_mod( 'responsive_date_box_style' ) ); + if ( 'round' === $responsive_date_box_style ) { + $custom_css .= '.responsive-date-box { + border-radius: 100%; + }'; + } elseif ( 'square' === $responsive_date_box_style ) { + $custom_css .= '.responsive-date-box { + border-radius: 0; + }'; + } else { + $custom_css .= '.responsive-date-box { + border-radius: 0; + }'; + } + } + + //font preset css conditional addition + $font_preset_css = ""; + $preset = get_theme_mod( 'responsive_font_presets', '' ); + if ( $preset !== '' ) { + $choices = json_decode( get_theme_mod( 'font_presets_value'),true ); + if ( isset( $choices[ $preset ] ) ) { + $headingFontFamily = $choices[ $preset ]['headingFont']; + $bodyFontFamily = $choices[ $preset ]['bodyFont']; + $bodyFontWeight = $choices[ $preset ]['bodyWeight']; + $headingFontWeight = $choices[ $preset ]['headingWeight']; + responsive_enqueue_google_font($bodyFontFamily); + responsive_enqueue_google_font($headingFontFamily); + $font_preset_css .= " + /* Font Preset */ + body, .post-meta * { + font-family: {$bodyFontFamily}; + font-weight: {$bodyFontWeight}; + } + h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { + font-family: {$headingFontFamily}; + font-weight: {$headingFontWeight}; + }"; + } + } + + // Footer Builder Widget Elements alignments. + for ( $i = 1; $i <= 6; $i++ ) { + // Check if element is present in footer builder. + if ( Responsive\Core\responsive_check_element_present_in_hfb( "widget-{$i}", 'footer' ) || Responsive\Core\responsive_check_element_in_mobile_tablet_items( "widget-{$i}", 'footer' ) ) { + + // Content Alignment. $widget_align_desktop = get_theme_mod( "responsive_footer_widget{$i}_content_align", 'left' ); $widget_align_tablet = get_theme_mod( "responsive_footer_widget{$i}_content_align_tablet", 'left' ); $widget_align_mobile = get_theme_mod( "responsive_footer_widget{$i}_content_align_mobile", 'left' ); @@ -8910,7 +9847,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 = responsive_prepare_css_value( 'responsive_single_blog_banner_background_color', Responsive\Core\get_responsive_customizer_defaults( 'responsive_single_blog_banner_background_color' ) ); + $single_blog_banner_tablet_background_color = responsive_prepare_css_value( 'responsive_single_blog_banner_background_color_tablet', Responsive\Core\get_responsive_customizer_defaults( 'responsive_single_blog_banner_background_color' ) ); + $single_blog_banner_mobile_background_color = responsive_prepare_css_value( 'responsive_single_blog_banner_background_color_mobile', Responsive\Core\get_responsive_customizer_defaults( 'responsive_single_blog_banner_background_color' ) ); + + // 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 = responsive_prepare_css_value( 'responsive_blog_banner_background_color', Responsive\Core\get_responsive_customizer_defaults( 'responsive_blog_banner_background_color' ) ); + $blog_banner_tablet_background_color = responsive_prepare_css_value( 'responsive_blog_banner_background_color_tablet', Responsive\Core\get_responsive_customizer_defaults( 'responsive_blog_banner_background_color' ) ); + $blog_banner_mobile_background_color = responsive_prepare_css_value( 'responsive_blog_banner_background_color_mobile', Responsive\Core\get_responsive_customizer_defaults( 'responsive_blog_banner_background_color' ) ); + + // 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 = responsive_prepare_css_value( 'responsive_page_title_banner_background_color', Responsive\Core\get_responsive_customizer_defaults( 'responsive_page_title_banner_background_color' ) ); + $page_banner_tablet_background_color = responsive_prepare_css_value( 'responsive_page_title_banner_background_color_tablet', Responsive\Core\get_responsive_customizer_defaults( 'responsive_page_title_banner_background_color' ) ); + $page_banner_mobile_background_color = responsive_prepare_css_value( 'responsive_page_title_banner_background_color_mobile', Responsive\Core\get_responsive_customizer_defaults( 'responsive_page_title_banner_background_color' ) ); + + // 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)); @@ -9656,13 +11150,13 @@ function responsive_build_responsive_margin_spacing_css( $margin ) { line-height: 1; border-color: ' . $cart_buttons_color . '; border-style: solid; - border-top-width: ' . $buttons_border_width_top . 'px; - border-right-width: ' . $buttons_border_width_right . 'px; - border-bottom-width: ' . $buttons_border_width_bottom . 'px; - border-left-width: ' . $buttons_border_width_left . 'px; + border-top-width: ' . $buttons_border_width_top . $buttons_border_width_desktop_unit . '; + border-right-width: ' . $buttons_border_width_right . $buttons_border_width_desktop_unit . '; + border-bottom-width: ' . $buttons_border_width_bottom . $buttons_border_width_desktop_unit . '; + border-left-width: ' . $buttons_border_width_left . $buttons_border_width_desktop_unit . '; // border-radius:' . $buttons_radius . 'px; - border-radius:' . responsive_spacing_css( $button_top_left_radius, $button_top_right_radius, $button_bottom_right_radius, $button_bottom_left_radius ) . '; - padding: ' . responsive_spacing_css( $buttons_padding_top, $buttons_padding_right, $buttons_padding_bottom, $buttons_padding_left ) . '; + border-radius:' . responsive_spacing_css( $button_top_left_radius, $button_top_right_radius, $button_bottom_right_radius, $button_bottom_left_radius, $buttons_radius_desktop_unit ) . '; + padding: ' . responsive_spacing_css( $buttons_padding_top, $buttons_padding_right, $buttons_padding_bottom, $buttons_padding_left, $buttons_desktop_unit ) . '; } @media screen and ( max-width: 992px ) { .woocommerce #respond input#submit.alt, @@ -9673,14 +11167,14 @@ function responsive_build_responsive_margin_spacing_css( $margin ) { .woocommerce a.button, .woocommerce button.button, .woocommerce input.button { - padding: ' . responsive_spacing_css( $buttons_tablet_padding_top, $buttons_tablet_padding_right, $buttons_tablet_padding_bottom, $buttons_tablet_padding_left ) . '; - border-radius:' . responsive_spacing_css( $button_tablet_top_left_radius, $button_tablet_top_right_radius, $button_tablet_bottom_right_radius, $button_tablet_bottom_left_radius ) . '; + padding: ' . responsive_spacing_css( $buttons_tablet_padding_top, $buttons_tablet_padding_right, $buttons_tablet_padding_bottom, $buttons_tablet_padding_left, $buttons_tablet_unit ) . '; + border-radius:' . responsive_spacing_css( $button_tablet_top_left_radius, $button_tablet_top_right_radius, $button_tablet_bottom_right_radius, $button_tablet_bottom_left_radius, $buttons_radius_tablet_unit ) . '; border-color: ' . $cart_buttons_color . '; border-style: solid; - border-top-width: ' . $buttons_border_tablet_width_top . 'px; - border-right-width: ' . $buttons_border_tablet_width_right . 'px; - border-bottom-width: ' . $buttons_border_tablet_width_bottom . 'px; - border-left-width: ' . $buttons_border_tablet_width_left . 'px; + border-top-width: ' . $buttons_border_tablet_width_top . $buttons_border_width_tablet_unit . '; + border-right-width: ' . $buttons_border_tablet_width_right . $buttons_border_width_tablet_unit . '; + border-bottom-width: ' . $buttons_border_tablet_width_bottom . $buttons_border_width_tablet_unit . '; + border-left-width: ' . $buttons_border_tablet_width_left . $buttons_border_width_tablet_unit . '; } } @@ -9693,13 +11187,13 @@ function responsive_build_responsive_margin_spacing_css( $margin ) { .woocommerce a.button, .woocommerce button.button, .woocommerce input.button { - padding: ' . responsive_spacing_css( $buttons_mobile_padding_top, $buttons_mobile_padding_right, $buttons_mobile_padding_bottom, $buttons_mobile_padding_left ) . '; - border-radius:' . responsive_spacing_css( $button_mobile_top_left_radius, $button_mobile_top_right_radius, $button_mobile_bottom_right_radius, $button_mobile_bottom_left_radius ) . '; + padding: ' . responsive_spacing_css( $buttons_mobile_padding_top, $buttons_mobile_padding_right, $buttons_mobile_padding_bottom, $buttons_mobile_padding_left, $buttons_mobile_unit ) . '; + border-radius:' . responsive_spacing_css( $button_mobile_top_left_radius, $button_mobile_top_right_radius, $button_mobile_bottom_right_radius, $button_mobile_bottom_left_radius, $buttons_radius_mobile_unit ) . '; border-style: solid; - border-top-width: ' . $buttons_border_mobile_width_top . 'px; - border-right-width: ' . $buttons_border_mobile_width_right . 'px; - border-bottom-width: ' . $buttons_border_mobile_width_bottom . 'px; - border-left-width: ' . $buttons_border_mobile_width_left . 'px; + border-top-width: ' . $buttons_border_mobile_width_top . $buttons_border_width_mobile_unit . '; + border-right-width: ' . $buttons_border_mobile_width_right . $buttons_border_width_mobile_unit . '; + border-bottom-width: ' . $buttons_border_mobile_width_bottom . $buttons_border_width_mobile_unit . '; + border-left-width: ' . $buttons_border_mobile_width_left . $buttons_border_width_mobile_unit . '; } }'; 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/color-states/responsive-color-states-picker-control.js b/core/includes/customizer/extend-controls/src/color-states/responsive-color-states-picker-control.js index d95ef297b..cb1ea4de6 100644 --- a/core/includes/customizer/extend-controls/src/color-states/responsive-color-states-picker-control.js +++ b/core/includes/customizer/extend-controls/src/color-states/responsive-color-states-picker-control.js @@ -24,19 +24,16 @@ class ResponsiveColorStatesPickerControl extends Component { }; resolveColorValue = (value, returnRaw = false) => { - let color = null; - if (value && (value.startsWith('palette') || value.includes('headings-color'))) { - color = 'var(--responsive-global-' + value + ')'; + if (value && (value.startsWith('palette') || value.includes('headings-color') || value.startsWith('title-above-content'))) { + const varName = value.startsWith('title-above-content') ? `--responsive-${value}` : `--responsive-global-${value}`; if (returnRaw) { - const raw = getComputedStyle(document.documentElement) - .getPropertyValue('--responsive-global-' + value) + return getComputedStyle(document.documentElement) + .getPropertyValue(varName) .trim(); - return raw; } - } else { - color = value; + return `var(${varName})`; } - return color; + return value; }; onColorChange = (color) => { diff --git a/core/includes/customizer/extend-controls/src/color-with-devices/color-picker-control.js b/core/includes/customizer/extend-controls/src/color-with-devices/color-picker-control.js index 67d6fd17b..115a620ec 100644 --- a/core/includes/customizer/extend-controls/src/color-with-devices/color-picker-control.js +++ b/core/includes/customizer/extend-controls/src/color-with-devices/color-picker-control.js @@ -102,6 +102,19 @@ class ColorPickerControlWithDevices extends Component { htmlLink = splited_values[1].replace(/"/g, ""); } } + const getColorPreviewValue = (value, wantRawValue = false) => { + if ( value && ( value.startsWith('palette') || value.includes('headings-color') || value.startsWith('title-above-content') ) ) { + const varName = value.startsWith('title-above-content') ? `--responsive-${value}` : `--responsive-global-${value}`; + if (wantRawValue) { + return getComputedStyle(document.documentElement) + .getPropertyValue(varName) + .trim(); + } + return `var(${varName})`; + } + return value; + }; + return ( <> @@ -109,14 +122,14 @@ class ColorPickerControlWithDevices extends Component { {this.props.swatchTitle ? (
    {this.props.swatchTitle}
    ) : ( )} @@ -126,7 +139,7 @@ class ColorPickerControlWithDevices extends Component { { refresh && ( <> this.onChangeComplete( color ) } /> @@ -134,7 +147,7 @@ class ColorPickerControlWithDevices extends Component { { ! refresh && ( <> this.onChangeComplete( color ) } /> diff --git a/core/includes/customizer/extend-controls/src/color/responsive-color-picker-control.js b/core/includes/customizer/extend-controls/src/color/responsive-color-picker-control.js index f3ea460b3..ae63f9129 100644 --- a/core/includes/customizer/extend-controls/src/color/responsive-color-picker-control.js +++ b/core/includes/customizer/extend-controls/src/color/responsive-color-picker-control.js @@ -123,20 +123,17 @@ class ResponsiveColorPickerControl extends Component { } = this.state; const getColorPreviewValue = (value, wantRawValue = false) => { - let color = null; - if( value && ( value.startsWith('palette') || value.includes('headings-color') ) ) { - color = 'var(--responsive-global-' + value + ')'; + if ( value && ( value.startsWith('palette') || value.includes('headings-color') || value.startsWith('title-above-content') ) ) { + const varName = value.startsWith('title-above-content') ? `--responsive-${value}` : `--responsive-global-${value}`; if (wantRawValue) { - const raw = getComputedStyle(document.documentElement) - .getPropertyValue('--responsive-global-' + value) + return getComputedStyle(document.documentElement) + .getPropertyValue(varName) .trim(); - return raw; } - } else { - color = value; + return `var(${varName})`; } - return color; - } + return value; + }; // Determine the background style based on activeTab const buttonBackgroundStyle = activeTab === 'gradient' && is_gradient_available diff --git a/core/includes/customizer/extend-controls/src/color/responsive-color-picker-with-hover-contorl.js b/core/includes/customizer/extend-controls/src/color/responsive-color-picker-with-hover-contorl.js index 9b94f9ff4..b8ad9470e 100644 --- a/core/includes/customizer/extend-controls/src/color/responsive-color-picker-with-hover-contorl.js +++ b/core/includes/customizer/extend-controls/src/color/responsive-color-picker-with-hover-contorl.js @@ -101,20 +101,17 @@ class ResponsiveColorPickerWithHoverControl extends Component { const { inputattr } = this.state; const getColorPreviewValue = (value, wantRawValue = false) => { - let color = null; - if( value && value.includes('palette') ) { - color = 'var(--responsive-global-' + value + ')'; + if ( value && ( value.includes('palette') || value.includes('headings-color') || value.includes('title-above-content') ) ) { + const varName = value.includes('title-above-content') ? `--responsive-${value}` : `--responsive-global-${value}`; if (wantRawValue) { - const raw = getComputedStyle(document.documentElement) - .getPropertyValue('--responsive-global-' + value) + return getComputedStyle(document.documentElement) + .getPropertyValue(varName) .trim(); - return raw; } - } else { - color = value; + return `var(${varName})`; } - return color; - } + return value; + }; return ( <> diff --git a/core/includes/customizer/extend-controls/src/customizer.js b/core/includes/customizer/extend-controls/src/customizer.js index 2e73b9146..413a4cdd9 100644 --- a/core/includes/customizer/extend-controls/src/customizer.js +++ b/core/includes/customizer/extend-controls/src/customizer.js @@ -437,6 +437,9 @@ if (typeof value === 'string' && value.startsWith('palette')) { return `var(--responsive-global-${value})`; } + if (typeof value === 'string' && value.startsWith('title-above-content')) { + return `var(--responsive-${value})`; + } return value; } @@ -460,6 +463,7 @@ } }); cssVars['--responsive-global-headings-color'] = processThemeSettingForCSS('responsive_all_heading_text_color'); + cssVars['--responsive-border-color'] = processThemeSettingForCSS('responsive_border_color'); const root = document.documentElement; Object.entries(cssVars).forEach(([varName, color]) => { @@ -476,6 +480,42 @@ // value.bind(applyPalette); }); + wp.customize( 'responsive_border_color', function( value ) { + value.bind( function( newval ) { + if( newval && newval.startsWith('palette') ) { + newval = `var(--responsive-global-${newval})`; + } + document.documentElement.style.setProperty( + '--responsive-border-color', + newval + ); + }); + }); + + wp.customize( 'responsive_title_above_content_bg_color', function( value ) { + value.bind( function( newval ) { + if( newval && newval.startsWith('palette') ) { + newval = `var(--responsive-global-${newval})`; + } + document.documentElement.style.setProperty( + '--responsive-title-above-content-bg-color', + newval + ); + }); + }); + + wp.customize( 'responsive_title_above_content_overlay_color', function( value ) { + value.bind( function( newval ) { + if( newval && newval.startsWith('palette') ) { + newval = `var(--responsive-global-${newval})`; + } + document.documentElement.style.setProperty( + '--responsive-title-above-content-overlay-color', + newval + ); + }); + }); + wp.customize( 'responsive_all_heading_text_color', function( value ) { value.bind( function( newval ) { if( newval && newval.startsWith('palette') ) { 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/range-with-switchers/range-component.js b/core/includes/customizer/extend-controls/src/range-with-switchers/range-component.js index 2e9dfdee9..fe96a0864 100644 --- a/core/includes/customizer/extend-controls/src/range-with-switchers/range-component.js +++ b/core/includes/customizer/extend-controls/src/range-with-switchers/range-component.js @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import {__} from '@wordpress/i18n'; -import {useState} from 'react'; +import {useState, useEffect} from 'react'; const ResponsiveRangeWithSwitchersComponent = props => { @@ -11,12 +11,39 @@ const ResponsiveRangeWithSwitchersComponent = props => { link, inputAttrs, name, - desktop, + desktop, tablet, mobile, devices = ['desktop', 'tablet', 'mobile'], // Default to all devices for backward compatibility + units = [], } = props.control.params; + const [activeUnits, setActiveUnits] = useState({ + desktop: props_value['desktop_unit'] ? props_value['desktop_unit'].get() : (units[0] || 'px'), + tablet: props_value['tablet_unit'] ? props_value['tablet_unit'].get() : (units[0] || 'px'), + mobile: props_value['mobile_unit'] ? props_value['mobile_unit'].get() : (units[0] || 'px'), + }); + + const [dropdownOpen, setDropdownOpen] = useState({ + desktop: false, + tablet: false, + mobile: false + }); + + useEffect(() => { + const handleOutsideClick = () => { + setDropdownOpen({ + desktop: false, + tablet: false, + mobile: false + }); + }; + document.addEventListener('click', handleOutsideClick); + return () => { + document.removeEventListener('click', handleOutsideClick); + }; + }, []); + let labelHtml = null, inputHtml = null, resetHtml = null, @@ -43,6 +70,8 @@ const ResponsiveRangeWithSwitchersComponent = props => { }); } + + const updateValues = (device, value ) => { let inputValue = Number(value); let updateValue = {...props_value}; @@ -50,7 +79,7 @@ const ResponsiveRangeWithSwitchersComponent = props => { setPropsValue(updateValue); }; - if (label) { + if (label) { // Determine which device should be active by default (first device in the array) const defaultActiveDevice = devices.length > 0 ? devices[0] : 'desktop'; @@ -82,9 +111,9 @@ const ResponsiveRangeWithSwitchersComponent = props => { ; } - const renderInputHtml = (device, active = '') => { + const renderInputHtml = (device, active = '') => { let link = (device === 'desktop') ? desktop.link : (device === 'tablet') ? tablet.link : mobile.link; - if (undefined !== link) { + if (undefined !== link) { let splited_values = link.split("="); if (undefined !== splited_values[1]) { link = splited_values[1].replace(/"/g, ""); @@ -94,29 +123,29 @@ const ResponsiveRangeWithSwitchersComponent = props => { return
    updateValues(device, event.target.value)} style={{ - background: `linear-gradient(to right, #007CBA ${sliderWidth}%, #D9D9D9 ${sliderWidth}%)` + background: `linear-gradient(to right, #007CBA ${sliderWidth}%, #D9D9D9 ${sliderWidth}%)` }} - /> + /> updateValues(device, event.target.value)} - /> + {...inp_array} + type="number" + data-name={name} + data-customize-setting-link={link} + className="responsive-range-switchers-input" + value={props_value[`${device}`].get()} + onChange={(event) => updateValues(device, event.target.value)} + />
    ; }; - const renderResetHtml = (device, active = '') => { + const renderResetHtml = (device, active = '') => { return
    ; - } + }; + + const renderUnitSelector = (device, active = '') => { + if (units.length === 0) return null; + + const currentUnit = activeUnits[device]; - // Determine which device should be active by default (first device in the array) + return ( +
    + + {dropdownOpen[device] && ( +
      + {units.map((unit) => ( +
    • { + e.preventDefault(); + e.stopPropagation(); + setActiveUnits(prev => ({ ...prev, [device]: unit })); + if (props_value[`${device}_unit`]) { + props_value[`${device}_unit`].set(unit); + } + setDropdownOpen(prev => ({ + ...prev, + [device]: false + })); + }} + > + {unit.toLowerCase()} +
    • + ))} +
    + )} +
    + ); + }; + + // Determine which device should be active by default (first device in the array) const defaultActiveDevice = devices.length > 0 ? devices[0] : 'desktop'; inputHtml = <> @@ -147,18 +227,25 @@ const ResponsiveRangeWithSwitchersComponent = props => { {devices.includes('tablet') && renderInputHtml('tablet', defaultActiveDevice === 'tablet' ? 'active' : '')} {devices.includes('mobile') && renderInputHtml('mobile', defaultActiveDevice === 'mobile' ? 'active' : '')} ; - resetHtml = <> - {devices.includes('desktop') && renderResetHtml('desktop', defaultActiveDevice === 'desktop' ? 'active' : '')} - {devices.includes('tablet') && renderResetHtml('tablet', defaultActiveDevice === 'tablet' ? 'active' : '')} - {devices.includes('mobile') && renderResetHtml('mobile', defaultActiveDevice === 'mobile' ? 'active' : '')} - + resetHtml = <> + {devices.includes('desktop') && renderResetHtml('desktop', defaultActiveDevice === 'desktop' ? 'active' : '')} + {devices.includes('tablet') && renderResetHtml('tablet', defaultActiveDevice === 'tablet' ? 'active' : '')} + {devices.includes('mobile') && renderResetHtml('mobile', defaultActiveDevice === 'mobile' ? 'active' : '')} + ; return
    -
    - {labelHtml} - {resetHtml} -
    - {inputHtml} +
    + {labelHtml} + {units.length > 0 && ( +
    + {devices.includes('desktop') && renderUnitSelector('desktop', defaultActiveDevice === 'desktop' ? 'active' : '')} + {devices.includes('tablet') && renderUnitSelector('tablet', defaultActiveDevice === 'tablet' ? 'active' : '')} + {devices.includes('mobile') && renderUnitSelector('mobile', defaultActiveDevice === 'mobile' ? 'active' : '')} +
    + )} + {resetHtml} +
    + {inputHtml}
    ; }; 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 a3d81ed21..2c4b57c9a 100644 --- a/core/includes/customizer/extend-controls/src/tabs/tabs-component.js +++ b/core/includes/customizer/extend-controls/src/tabs/tabs-component.js @@ -517,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'; @@ -741,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) => { @@ -782,8 +862,8 @@ const TabsComponent = props => { let isVisible = false; if (control === 'global' || control === 'default') { - // For global sidebar: only hide when 'no' - isVisible = value !== 'no' && tab === 'general'; + // For global sidebar style: show whenever on general tab + isVisible = tab === 'general'; } else { // For page/blog: hide when 'no' or resolve 'global' if (value === 'global') { @@ -812,8 +892,8 @@ const TabsComponent = props => { element.style.display = 'none'; - // Show only if default sidebar position is not 'no' AND active tab is 'design' - const isVisible = value !== 'no' && tab === 'design'; + // Show whenever active tab is 'design' + const isVisible = tab === 'design'; if (isVisible) { element.style.display = 'block'; } @@ -1038,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 <>
    { 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; 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 846ba6274..e19949de7 100644 --- a/core/includes/customizer/helper.php +++ b/core/includes/customizer/helper.php @@ -120,6 +120,7 @@ function responsive_blog_single_elements() { 'featured_image' => esc_html__( 'Featured Image', 'responsive' ), 'meta' => esc_html__( 'Meta', 'responsive' ), 'content' => esc_html__( 'Content', 'responsive' ), + 'excerpt' => esc_html__( 'Excerpt', 'responsive' ), ) ); @@ -139,7 +140,7 @@ function responsive_blog_single_elements() { function responsive_blog_single_elements_positioning() { // Default sections. - $sections = array( 'categories', '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 ); @@ -149,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 ); @@ -295,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' ), ) ); @@ -863,7 +869,7 @@ function responsive_custom_excerpt_length( $length ) { * * @since 3.17.2 * - * @return html + * @return string */ if ( ! function_exists( 'responsive_post_link' ) ) { @@ -871,7 +877,7 @@ 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 = '' ) { @@ -893,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 . ''; + return '

    ' . $read_more_text . '

    '; } } @@ -911,18 +917,19 @@ function responsive_modify_read_more_link() { * @param integer $left Left paddding/margin. * @return integer */ - function responsive_spacing_css( $top, $right, $bottom, $left ) { + function responsive_spacing_css( $top, $right, $bottom, $left, $unit = 'px' ) { - // Add px and 0 if no value. - $s_top = ( isset( $top ) && '' !== $top ) ? intval( $top ) . 'px ' : '0px '; - $s_right = ( isset( $right ) && '' !== $right ) ? intval( $right ) . 'px ' : '0px '; - $s_bottom = ( isset( $bottom ) && '' !== $bottom ) ? intval( $bottom ) . 'px ' : '0px '; - $s_left = ( isset( $left ) && '' !== $left ) ? intval( $left ) . 'px' : '0px'; + $unit = ! empty( $unit ) ? $unit : 'px'; + + $s_top = ( isset( $top ) && '' !== $top ) ? ( 'px' === $unit ? intval( $top ) : $top ) . $unit . ' ' : '0' . $unit . ' '; + $s_right = ( isset( $right ) && '' !== $right ) ? ( 'px' === $unit ? intval( $right ) : $right ) . $unit . ' ' : '0' . $unit . ' '; + $s_bottom = ( isset( $bottom ) && '' !== $bottom ) ? ( 'px' === $unit ? intval( $bottom ) : $bottom ) . $unit . ' ' : '0' . $unit . ' '; + $s_left = ( isset( $left ) && '' !== $left ) ? ( 'px' === $unit ? intval( $left ) : $left ) . $unit : '0' . $unit; // Return one value if it is the same on every inputs. - if ( ( intval( $s_top ) === intval( $s_right ) ) - && ( intval( $s_right ) === intval( $s_bottom ) ) - && ( intval( $s_bottom ) === intval( $s_left ) ) ) { + if ( ( (string) $top === (string) $right ) + && ( (string) $right === (string) $bottom ) + && ( (string) $bottom === (string) $left ) ) { return $s_left; } @@ -931,6 +938,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. * @@ -1046,8 +1099,35 @@ function responsive_padding_control( $wp_customize, $element, $section, $priorit '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' => 'px', + ) + ); + $wp_customize->add_setting( + 'responsive_' . $element . '_tablet_unit', + array( + 'transport' => $transport, + 'sanitize_callback' => 'sanitize_text_field', + 'default' => 'px', + ) + ); + $wp_customize->add_setting( + 'responsive_' . $element . '_mobile_unit', + array( + 'transport' => $transport, + 'sanitize_callback' => 'sanitize_text_field', + 'default' => 'px', + ) + ); + $wp_customize->add_control( - new Responsive_Customizer_Dimensions_Control( + new Responsive_Customizer_Unit_Dimensions_Control( $wp_customize, 'responsive_' . $element . '_padding', array( @@ -1066,6 +1146,9 @@ function responsive_padding_control( $wp_customize, $element, $section, $priorit '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, @@ -1079,6 +1162,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. * @@ -1194,8 +1442,35 @@ function responsive_borderwidth_control( $wp_customize, $element, $section, $pri 'default' => $default_values_x, ) ); + + // Unit settings + $wp_customize->add_setting( + 'responsive_' . $element . '_desktop_unit', + array( + 'transport' => $transport, + 'sanitize_callback' => 'sanitize_text_field', + 'default' => 'px', + ) + ); + $wp_customize->add_setting( + 'responsive_' . $element . '_tablet_unit', + array( + 'transport' => $transport, + 'sanitize_callback' => 'sanitize_text_field', + 'default' => 'px', + ) + ); + $wp_customize->add_setting( + 'responsive_' . $element . '_mobile_unit', + array( + 'transport' => $transport, + 'sanitize_callback' => 'sanitize_text_field', + 'default' => 'px', + ) + ); + $wp_customize->add_control( - new Responsive_Customizer_Dimensions_Control( + new Responsive_Customizer_Unit_Dimensions_Control( $wp_customize, 'responsive_' . $element . '_border', array( @@ -1214,6 +1489,9 @@ function responsive_borderwidth_control( $wp_customize, $element, $section, $pri 'mobile_right' => 'responsive_' . $element . '_mobile_right_border', 'mobile_bottom' => 'responsive_' . $element . '_mobile_bottom_border', 'mobile_left' => 'responsive_' . $element . '_mobile_left_border', + 'desktop_unit' => 'responsive_' . $element . '_desktop_unit', + 'tablet_unit' => 'responsive_' . $element . '_tablet_unit', + 'mobile_unit' => 'responsive_' . $element . '_mobile_unit', ), 'priority' => $priority, 'active_callback' => $active_call, @@ -1260,7 +1538,7 @@ function responsive_color_control( $wp_customize, $element, $label, $section, $p 'default' => $hover_default, 'type' => 'theme_mod', 'sanitize_callback' => 'responsive_sanitize_background', - 'transport' => 'postMessage', + 'transport' => $transport, ) ); } @@ -1553,7 +1831,7 @@ function responsive_drag_number_control( $wp_customize, $element, $label, $secti * @param [type] $step [description]. * @return void [description]. */ -function responsive_drag_number_control_with_switchers( $wp_customize, $element, $label, $section, $priority, $default, $active_call = null, $max = 4096, $min = 1, $transport = 'refresh', $step = 1, $tablet_default = null, $mobile_default = null, $devices = array( 'desktop', 'tablet', 'mobile' ) ) { +function responsive_drag_number_control_with_switchers( $wp_customize, $element, $label, $section, $priority, $default, $active_call = null, $max = 4096, $min = 1, $transport = 'refresh', $step = 1, $tablet_default = null, $mobile_default = null, $devices = array( 'desktop', 'tablet', 'mobile' ), $units = array() ) { // Conditionally register settings based on devices parameter $settings = array(); @@ -1568,6 +1846,18 @@ function responsive_drag_number_control_with_switchers( $wp_customize, $element, ) ); $settings['desktop'] = 'responsive_' . $element; + + if ( ! empty( $units ) ) { + $wp_customize->add_setting( + 'responsive_' . $element . '_unit', + array( + 'transport' => $transport, + 'default' => $units[0], + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + $settings['desktop_unit'] = 'responsive_' . $element . '_unit'; + } } if ( in_array( 'tablet', $devices ) ) { @@ -1580,6 +1870,18 @@ function responsive_drag_number_control_with_switchers( $wp_customize, $element, ) ); $settings['tablet'] = 'responsive_' . $element . '_tablet'; + + if ( ! empty( $units ) ) { + $wp_customize->add_setting( + 'responsive_' . $element . '_tablet_unit', + array( + 'transport' => $transport, + 'default' => $units[0], + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + $settings['tablet_unit'] = 'responsive_' . $element . '_tablet_unit'; + } } if ( in_array( 'mobile', $devices ) ) { @@ -1592,6 +1894,18 @@ function responsive_drag_number_control_with_switchers( $wp_customize, $element, ) ); $settings['mobile'] = 'responsive_' . $element . '_mobile'; + + if ( ! empty( $units ) ) { + $wp_customize->add_setting( + 'responsive_' . $element . '_mobile_unit', + array( + 'transport' => $transport, + 'default' => $units[0], + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + $settings['mobile_unit'] = 'responsive_' . $element . '_mobile_unit'; + } } $wp_customize->add_control( @@ -1603,6 +1917,7 @@ function responsive_drag_number_control_with_switchers( $wp_customize, $element, 'section' => $section, 'settings' => $settings, 'devices' => $devices, + 'units' => $units, 'priority' => $priority, 'active_callback' => $active_call, 'input_attrs' => array( @@ -2076,13 +2391,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' ), @@ -2517,8 +2832,35 @@ function responsive_radius_control( $wp_customize, $element, $section, $priority 'default' => $default_values_x, ) ); + + // Unit settings + $wp_customize->add_setting( + 'responsive_' . $element . '_desktop_unit', + array( + 'transport' => $transport, + 'sanitize_callback' => 'sanitize_text_field', + 'default' => 'px', + ) + ); + $wp_customize->add_setting( + 'responsive_' . $element . '_tablet_unit', + array( + 'transport' => $transport, + 'sanitize_callback' => 'sanitize_text_field', + 'default' => 'px', + ) + ); + $wp_customize->add_setting( + 'responsive_' . $element . '_mobile_unit', + array( + 'transport' => $transport, + 'sanitize_callback' => 'sanitize_text_field', + 'default' => 'px', + ) + ); + $wp_customize->add_control( - new Responsive_Customizer_Dimensions_Control( + new Responsive_Customizer_Unit_Dimensions_Control( $wp_customize, 'responsive_border_' . $element, array( @@ -2537,6 +2879,9 @@ function responsive_radius_control( $wp_customize, $element, $section, $priority 'mobile_right' => 'responsive_' . $element . '_mobile_top_right_radius', 'mobile_bottom' => 'responsive_' . $element . '_mobile_bottom_right_radius', 'mobile_left' => 'responsive_' . $element . '_mobile_bottom_left_radius', + 'desktop_unit' => 'responsive_' . $element . '_desktop_unit', + 'tablet_unit' => 'responsive_' . $element . '_tablet_unit', + 'mobile_unit' => 'responsive_' . $element . '_mobile_unit', ), 'priority' => $priority, 'active_callback' => $active_call, @@ -4278,3 +4623,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 497bb5b91..eb2e89e15 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, Responsive\Core\get_responsive_customizer_defaults( 'responsive_blog_banner_background_color' ) ); + + // 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,10 +553,97 @@ 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. @@ -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-buttons-customizer.php b/core/includes/customizer/settings/class-responsive-buttons-customizer.php index 868c93ed9..e55e37f4d 100644 --- a/core/includes/customizer/settings/class-responsive-buttons-customizer.php +++ b/core/includes/customizer/settings/class-responsive-buttons-customizer.php @@ -72,17 +72,79 @@ public function customizer_options( $wp_customize ) { responsive_color_control( $wp_customize, 'button_border', $button_border_color_label, 'responsive_button', 198, Responsive\Core\get_responsive_customizer_defaults( 'button_border' ), null, '', true, Responsive\Core\get_responsive_customizer_defaults( 'button_hover_border' ), 'button_hover_border' ); // Buttons Border Width. - $buttons_border_width_label = __( 'Border Width (px)', 'responsive' ); + $buttons_border_width_label = __( 'Border Width', 'responsive' ); responsive_borderwidth_control( $wp_customize, 'buttons_border_width', 'responsive_button', 200, 0, 0, null, $buttons_border_width_label, 'postMessage' ); // Buttons Radius. - $buttons_radius_label = __( 'Radius (px)', 'responsive' ); + $buttons_radius_label = __( 'Radius', 'responsive' ); responsive_radius_control( $wp_customize, 'buttons_radius', 'responsive_button', 210, 0, 0, null, $buttons_radius_label ); - // Buttons Padding (px). - $buttons_padding_label = __( 'Padding (px)', 'responsive' ); + // Buttons Padding. + $buttons_padding_label = __( 'Padding', 'responsive' ); responsive_padding_control( $wp_customize, 'buttons', 'responsive_button', 240, 10, 10, null, $buttons_padding_label ); + // Separator. + responsive_horizontal_separator_control( $wp_customize, 'button_shadow_separator', 1, 'responsive_button', 245, 1 ); + + // Button Shadow. + responsive_shadow_control( + $wp_customize, + 'button_shadow', + __( 'Button Shadow', 'responsive' ), + 'responsive_button', + 250, + Responsive\Core\get_responsive_customizer_defaults( 'responsive_button_shadow_x' ), + Responsive\Core\get_responsive_customizer_defaults( 'responsive_button_shadow_y' ), + Responsive\Core\get_responsive_customizer_defaults( 'responsive_button_shadow_blur' ), + Responsive\Core\get_responsive_customizer_defaults( 'responsive_button_shadow_spread' ), + Responsive\Core\get_responsive_customizer_defaults( 'responsive_button_shadow_inset' ), + null + ); + + // Button Shadow Color. + responsive_color_control( + $wp_customize, + 'button_shadow', + __( 'Button Shadow Color', 'responsive' ), + 'responsive_button', + 252, + Responsive\Core\get_responsive_customizer_defaults( 'responsive_button_shadow_color' ), + null, + '', + false + ); + + // Separator. + responsive_horizontal_separator_control( $wp_customize, 'button_hover_shadow_separator', 1, 'responsive_button', 255, 1 ); + + // Button Hover Shadow. + responsive_shadow_control( + $wp_customize, + 'button_hover_shadow', + __( 'Button Hover Shadow', 'responsive' ), + 'responsive_button', + 260, + Responsive\Core\get_responsive_customizer_defaults( 'responsive_button_hover_shadow_x' ), + Responsive\Core\get_responsive_customizer_defaults( 'responsive_button_hover_shadow_y' ), + Responsive\Core\get_responsive_customizer_defaults( 'responsive_button_hover_shadow_blur' ), + Responsive\Core\get_responsive_customizer_defaults( 'responsive_button_hover_shadow_spread' ), + Responsive\Core\get_responsive_customizer_defaults( 'responsive_button_hover_shadow_inset' ), + null + ); + + // Button Hover Shadow Color. + responsive_color_control( + $wp_customize, + 'button_hover_shadow', + __( 'Button Hover Shadow Color', 'responsive' ), + 'responsive_button', + 262, + Responsive\Core\get_responsive_customizer_defaults( 'responsive_button_hover_shadow_color' ), + null, + '', + false + ); + } 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 6ad430d38..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,6 +36,36 @@ 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' ), 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 d4199e541..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,14 +35,14 @@ 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' ); @@ -51,20 +51,18 @@ public function customizer_options( $wp_customize ) { $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..be100c8a1 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, Responsive\Core\get_responsive_customizer_defaults( 'responsive_page_title_banner_background_color' ) ); + + + // 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, Responsive\Core\get_responsive_customizer_defaults( 'responsive_page_featured_image_overlay_color' ) ); // 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 b1fd43278..c60aa611f 100644 --- a/core/includes/customizer/settings/class-responsive-sidebar-layout-customizer.php +++ b/core/includes/customizer/settings/class-responsive-sidebar-layout-customizer.php @@ -41,7 +41,8 @@ public function customizer_options($wp_customize) $general_tab_ids_prefix . 'responsive_sidebar_separator', $general_tab_ids_prefix . 'responsive_default_sidebar_position', $general_tab_ids_prefix . 'responsive_sidebar_style', - $general_tab_ids_prefix . 'responsive_default_sidebar_width' + $general_tab_ids_prefix . 'responsive_default_sidebar_width', + $general_tab_ids_prefix . 'responsive_sidebar_sticky' ); $design_tab_ids_prefix = 'customize-control-'; @@ -57,9 +58,17 @@ public function customizer_options($wp_customize) $design_tab_ids_prefix . 'responsive_sidebar_text_separator', $design_tab_ids_prefix . 'responsive_sidebar_link_separator', $design_tab_ids_prefix . 'responsive_sidebar_typography_separator', + $design_tab_ids_prefix . 'responsive_sidebar_link_style_before_separator', + $design_tab_ids_prefix . 'responsive_sidebar_link_style', + $design_tab_ids_prefix . 'responsive_sidebar_link_style_after_separator', $design_tab_ids_prefix . 'responsive_sidebar_spacing', $design_tab_ids_prefix . 'responsive_sidebar_outside_container_padding', - $design_tab_ids_prefix . 'responsive_sidebar_inside_container_padding' + $design_tab_ids_prefix . 'responsive_sidebar_inside_container_padding', + $design_tab_ids_prefix . 'responsive_widget_bottom_spacing', + $design_tab_ids_prefix . 'responsive_sidebar_border_divider_separator', + $design_tab_ids_prefix . 'responsive_sidebar_border_divider_style', + $design_tab_ids_prefix . 'responsive_sidebar_border_divider_width', + $design_tab_ids_prefix . 'responsive_sidebar_border_divider_color' ); $tabs_label = esc_html__( 'Tabs', 'responsive' ); @@ -90,10 +99,21 @@ public function customizer_options($wp_customize) 'unboxed' => esc_html__( 'Unboxed', 'responsive' ), 'boxed' => esc_html__( 'Boxed', 'responsive' ), ); - responsive_select_button_control( $wp_customize, 'sidebar_style', $sidebar_style_label, 'responsive_sidebar', 15, $sidebar_style_choice, Responsive\Core\get_responsive_customizer_defaults( 'responsive_sidebar_style' ), 'responsive_active_default_sidebar_position', 'postMessage' ); + responsive_select_button_control( $wp_customize, 'sidebar_style', $sidebar_style_label, 'responsive_sidebar', 15, $sidebar_style_choice, Responsive\Core\get_responsive_customizer_defaults( 'responsive_sidebar_style' ), null, 'postMessage' ); $default_sidebar_width_label = esc_html__('Sidebar Width (%)', 'responsive'); - responsive_drag_number_control( $wp_customize, 'default_sidebar_width',$default_sidebar_width_label, 'responsive_sidebar', 45, 30, 'responsive_active_default_sidebar_position' , 50, 15,'postMessage'); + responsive_drag_number_control( $wp_customize, 'default_sidebar_width',$default_sidebar_width_label, 'responsive_sidebar', 45, 30, null , 50, 15,'postMessage'); + + responsive_toggle_control( + $wp_customize, + 'sidebar_sticky', + esc_html__( 'Sticky Sidebar', 'responsive' ), + 'responsive_sidebar', + 48, + Responsive\Core\get_responsive_customizer_defaults( 'responsive_sidebar_sticky' ), + null, + 'postMessage' + ); responsive_horizontal_separator_control($wp_customize, 'sidebar_typography_separator', 1, 'responsive_sidebar', 58, 1, ); @@ -104,6 +124,103 @@ public function customizer_options($wp_customize) $sidebar_typography_label = esc_html__('Sidebar Font', 'responsive'); responsive_typography_group_control($wp_customize, 'sidebar_typography_group', $sidebar_typography_label, 'responsive_sidebar', 60, 'sidebar_typography'); + responsive_horizontal_separator_control($wp_customize, 'sidebar_link_style_before_separator', 1, 'responsive_sidebar', 61, 1); + + $sidebar_link_style_label = __( 'Link Style', 'responsive' ); + $sidebar_link_style_choices = array( + 'hover' => esc_html__( 'Underline on Hover', 'responsive' ), + 'underline' => esc_html__( 'Underline', 'responsive' ), + 'none' => esc_html__( 'No Underline', 'responsive' ), + ); + responsive_select_control( + $wp_customize, + 'sidebar_link_style', + $sidebar_link_style_label, + 'responsive_sidebar', + 62, + $sidebar_link_style_choices, + Responsive\Core\get_responsive_customizer_defaults( 'responsive_sidebar_link_style' ), + null, + 'postMessage' + ); + + responsive_horizontal_separator_control($wp_customize, 'sidebar_link_style_after_separator', 1, 'responsive_sidebar', 63, 1); + + responsive_drag_number_control_with_switchers( + $wp_customize, + 'widget_bottom_spacing', + esc_html__('Widget Bottom Spacing', 'responsive'), + 'responsive_sidebar', + 65, + 30, + null, + 200, + 0, + 'postMessage', + 1, + '', + '', + array( 'desktop', 'tablet', 'mobile' ), + array( 'px', 'em', 'rem' ) + ); + + responsive_horizontal_separator_control( + $wp_customize, + 'sidebar_border_divider_separator', + 1, + 'responsive_sidebar', + 65.5, + 1, + null + ); + + $border_divider_styles = array( + 'none' => esc_html__( 'None', 'responsive' ), + 'solid' => esc_html__( 'Solid', 'responsive' ), + 'dashed' => esc_html__( 'Dashed', 'responsive' ), + 'dotted' => esc_html__( 'Dotted', 'responsive' ), + 'double' => esc_html__( 'Double', 'responsive' ), + ); + responsive_select_button_control( + $wp_customize, + 'sidebar_border_divider_style', + __( 'Divider Style', 'responsive' ), + 'responsive_sidebar', + 66, + $border_divider_styles, + Responsive\Core\get_responsive_customizer_defaults( 'responsive_sidebar_border_divider_style' ), + null, + 'postMessage' + ); + + responsive_drag_number_control_with_switchers( + $wp_customize, + 'sidebar_border_divider_width', + esc_html__( 'Divider Width', 'responsive' ), + 'responsive_sidebar', + 67, + 0, + null, + 20, + 0, + 'postMessage', + 1, + '', + '', + array( 'desktop', 'tablet', 'mobile' ), + array( 'px', 'em', 'rem' ) + ); + + responsive_color_control( + $wp_customize, + 'sidebar_border_divider', + __( 'Divider Color', 'responsive' ), + 'responsive_sidebar', + 68, + Responsive\Core\get_responsive_customizer_defaults( 'responsive_sidebar_border_divider_color' ), + null + ); + // 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_active_page_sidebar_section'); 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 2da865485..3077b2420 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, Responsive\Core\get_responsive_customizer_defaults( 'responsive_single_blog_banner_background_color' ) ); + + // 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, Responsive\Core\get_responsive_customizer_defaults( 'responsive_single_blog_featured_image_overlay_color' ) ); // 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,8 +562,6 @@ 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', @@ -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-colors-customizer.php b/core/includes/customizer/settings/class-responsive-site-colors-customizer.php index 4743f0c34..ff49342f1 100644 --- a/core/includes/customizer/settings/class-responsive-site-colors-customizer.php +++ b/core/includes/customizer/settings/class-responsive-site-colors-customizer.php @@ -66,7 +66,7 @@ public function customizer_options( $wp_customize ) { // Link Color. $link_color_label = __( 'Links', 'responsive' ); - responsive_color_control( $wp_customize, 'link', $link_color_label, 'responsive_colors', 35, Responsive\Core\get_responsive_customizer_defaults( 'responsive_link_color' ),null, '', true, Responsive\Core\get_responsive_customizer_defaults( 'responsive_link_hover_color' ), 'link_hover' ); + responsive_color_control( $wp_customize, 'link', $link_color_label, 'responsive_colors', 35, Responsive\Core\get_responsive_customizer_defaults( 'responsive_link_color' ),null, '', true, Responsive\Core\get_responsive_customizer_defaults( 'responsive_link_hover_color' ), 'link_hover', false, null, null, 'color', 'refresh' ); // Meta Color. $meta_text_color_label = __( 'Meta Color', 'responsive' ); @@ -104,6 +104,15 @@ public function customizer_options( $wp_customize ) { responsive_horizontal_separator_control( $wp_customize, 'h6_text_separator', 1, 'responsive_colors',85, 1 ); + + // Title Above Content Background. + $title_above_content_bg_color_label = __( 'Title Above Content Background', 'responsive' ); + responsive_color_control( $wp_customize, 'title_above_content_bg', $title_above_content_bg_color_label, 'responsive_colors', 88, Responsive\Core\get_responsive_customizer_defaults( 'responsive_title_above_content_bg_color' ), null ); + + // Title Above Content Overlay Color. + $title_above_content_overlay_color_label = __( 'Title Above Content Overlay Color', 'responsive' ); + responsive_color_control( $wp_customize, 'title_above_content_overlay', $title_above_content_overlay_color_label, 'responsive_colors', 89, Responsive\Core\get_responsive_customizer_defaults( 'responsive_title_above_content_overlay_color' ), null ); + // Site Background Color. $site_background_color_label = __( 'Site Background', 'responsive' ); responsive_color_control( @@ -196,6 +205,21 @@ public function customizer_options( $wp_customize ) { responsive_horizontal_separator_control( $wp_customize, 'content_bg_image_separator', 1, 'responsive_colors',112, 1 ); + // Content Links Section. + $content_links_label = esc_html__( 'Content Links', 'responsive' ); + responsive_separator_control( $wp_customize, 'content_links_heading', $content_links_label, 'responsive_colors', 120 ); + + // Link Style Control. + $link_style_label = esc_html__( 'Link Style', 'responsive' ); + $link_style_choices = array( + 'standard' => esc_html__( 'Standard (underline)', 'responsive' ), + 'color-underline' => esc_html__( 'Highlight Underline', 'responsive' ), + 'no-underline' => esc_html__( 'No Underline', 'responsive' ), + 'hover-background' => esc_html__( 'Background on hover', 'responsive' ), + 'offset-background' => esc_html__( 'Offset Background', 'responsive' ), + ); + responsive_select_control( $wp_customize, 'link_style', $link_style_label, 'responsive_colors', 125, $link_style_choices, 'standard', null, 'refresh' ); + // Buttons. // $general_buttons_label = esc_html__( 'Buttons', 'responsive' ); // responsive_separator_control( $wp_customize, 'responsive_general_buttons_separator', $general_buttons_label, 'responsive_colors', 130 ); 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 481c2d4ce..56fd0fc57 100644 --- a/core/includes/customizer/settings/class-responsive-site-layouts-customizer.php +++ b/core/includes/customizer/settings/class-responsive-site-layouts-customizer.php @@ -138,6 +138,7 @@ public function customizer_options( $wp_customize ) { ); 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. @@ -160,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' ); @@ -172,6 +173,26 @@ public function customizer_options( $wp_customize ) { $box_radius_label = __( 'Box Radius (px)', 'responsive' ); responsive_radius_control( $wp_customize, 'box', 'responsive_layout', 50, 4, 4, 'responsive_not_active_site_style_flat', $box_radius_label ); + // Content Left/Right Edge Spacing. + $content_edge_spacing_label = __( 'Content Left/Right Edge Spacing', 'responsive' ); + responsive_drag_number_control_with_switchers( + $wp_customize, + 'content_edge_spacing', + $content_edge_spacing_label, + 'responsive_layout', + 51, + Responsive\Core\get_responsive_customizer_defaults( 'content_edge_spacing' ), + null, + 100, + 0, + 'postMessage', + 1, + null, + null, + array( 'desktop', 'tablet', 'mobile' ), + array( 'px', 'em', 'rem', 'vh' ) + ); + // responsive_number_control( $wp_customize, 'box_radius', $box_radius_label, 'responsive_layout', 50, 0, 'responsive_not_active_site_style_flat' ); // Redirect to site title and logo. @@ -195,6 +216,108 @@ public function customizer_options( $wp_customize ) { // Site Tagline Visibility control $site_tagline_visibility_label = __( 'Site Tagline Visibility', 'responsive' ); responsive_multi_select_button_control($wp_customize, 'site_tagline_visibility', $site_tagline_visibility_label, 'responsive_header_site_logo_title', 16, $site_tagline_visibility_choices, array('desktop','tablet','mobile'), null, 'refresh'); + + // Single Post Boxed Shadow controls. + responsive_separator_control( + $wp_customize, + 'single_post_boxed_separator', + __( 'Single Post Boxed', 'responsive' ), + 'responsive_layout', + 200 + ); + + responsive_drag_number_control_with_switchers( + $wp_customize, + 'single_post_boxed_radius', + __( 'Border Radius', 'responsive' ), + 'responsive_layout', + 205, + Responsive\Core\get_responsive_customizer_defaults( 'responsive_single_post_boxed_radius' ), + null, + 100, + 0, + 'refresh', + 1, + null, + null, + array( 'desktop', 'tablet', 'mobile' ), + array( 'px', 'em', 'rem' ) + ); + + responsive_shadow_control( + $wp_customize, + 'single_post_boxed_shadow', + __( 'Box Shadow', 'responsive' ), + 'responsive_layout', + 210, + Responsive\Core\get_responsive_customizer_defaults( 'responsive_single_post_boxed_shadow_x' ), + Responsive\Core\get_responsive_customizer_defaults( 'responsive_single_post_boxed_shadow_y' ), + Responsive\Core\get_responsive_customizer_defaults( 'responsive_single_post_boxed_shadow_blur' ), + Responsive\Core\get_responsive_customizer_defaults( 'responsive_single_post_boxed_shadow_spread' ), + Responsive\Core\get_responsive_customizer_defaults( 'responsive_single_post_boxed_shadow_inset' ), + null + ); + + responsive_color_control( + $wp_customize, + 'single_post_boxed_shadow', + __( 'Box Shadow Color', 'responsive' ), + 'responsive_layout', + 220, + Responsive\Core\get_responsive_customizer_defaults( 'responsive_single_post_boxed_shadow_color' ), + null, + '', + false, + null, + null, + false, + null, + null, + 'color', + 'refresh' + ); + + // Archive Grid Boxed Shadow controls. + responsive_separator_control( + $wp_customize, + 'archive_grid_boxed_separator', + __( 'Archive Grid Boxed', 'responsive' ), + 'responsive_layout', + 230 + ); + + responsive_shadow_control( + $wp_customize, + 'archive_grid_boxed_shadow', + __( 'Box Shadow', 'responsive' ), + 'responsive_layout', + 240, + Responsive\Core\get_responsive_customizer_defaults( 'responsive_archive_grid_boxed_shadow_x' ), + Responsive\Core\get_responsive_customizer_defaults( 'responsive_archive_grid_boxed_shadow_y' ), + Responsive\Core\get_responsive_customizer_defaults( 'responsive_archive_grid_boxed_shadow_blur' ), + Responsive\Core\get_responsive_customizer_defaults( 'responsive_archive_grid_boxed_shadow_spread' ), + Responsive\Core\get_responsive_customizer_defaults( 'responsive_archive_grid_boxed_shadow_inset' ), + null + ); + + responsive_color_control( + $wp_customize, + 'archive_grid_boxed_shadow', + __( 'Box Shadow Color', 'responsive' ), + 'responsive_layout', + 250, + Responsive\Core\get_responsive_customizer_defaults( 'responsive_archive_grid_boxed_shadow_color' ), + null, + '', + false, + null, + null, + false, + null, + null, + 'color', + 'refresh' + ); } diff --git a/core/includes/customizer/settings/class-responsive-typography-customizer.php b/core/includes/customizer/settings/class-responsive-typography-customizer.php index dfbbab905..11ecf664c 100644 --- a/core/includes/customizer/settings/class-responsive-typography-customizer.php +++ b/core/includes/customizer/settings/class-responsive-typography-customizer.php @@ -121,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', ), @@ -169,9 +169,81 @@ public function elements() { 'exclude' => array( 'font-color' ), 'defaults' => array( 'font-family' => 'System Font', - 'font-size' => '12px', + '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( @@ -183,6 +255,8 @@ public function elements() { 'defaults' => array( 'font-size' => '16px', 'line-height' => '1', + 'text-transform' => 'capitalize', + 'font-weight' => '400', ), ), 'input' => array( @@ -296,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( @@ -380,7 +455,7 @@ public function elements() { 'exclude' => array( 'font-color' ), 'priority' => 80, 'defaults' => array( - 'font-size' => '13px', + 'font-size' => '16px', 'line-height' => '1.75', ), ), @@ -471,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++ ) { @@ -557,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() ) { @@ -798,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' : '', ) ); diff --git a/core/includes/functions-extras.php b/core/includes/functions-extras.php index 438da04ad..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 ''; + return ''; } } } diff --git a/core/includes/functions.php b/core/includes/functions.php index bf4e5810e..06e1fae5f 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'] ); } @@ -625,6 +632,7 @@ function responsive_add_custom_body_classes( $classes ) { } $classes[] = 'responsive-site-' . get_theme_mod( 'responsive_width', 'contained' ); + $classes[] = 'link-style-' . get_theme_mod( 'responsive_link_style', 'standard' ); if ( is_page() ) { $site_style = get_post_meta( get_the_ID(), 'responsive_page_meta_layout_style', true ); @@ -745,12 +753,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' ); @@ -984,7 +997,7 @@ function responsive_post_meta_data() { 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( @@ -1227,25 +1240,38 @@ function defaults() { 'responsive_theme_defaults', array( 'entry_columns' => 3, - 'buttons_radius' => 0, + 'responsive_buttons_radius' => 4, + 'buttons_radius' => 4, 'responsive_border_box' => 4, 'shop_content_width' => 100, 'blog_content_width' => 100, 'responsive_container_width' => 1340, - 'responsive_narrow_container_width' => 750, 'single_blog_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( 'featured_image', 'categories', 'title', 'meta', 'content' ), - 'blog_single_elements_positioning' => array( 'title', 'meta', 'featured_image', 'content' ), + 'blog_single_elements_positioning' => array( 'categories', 'title', 'meta', 'featured_image', 'content' ), // alignment. 'blog_entry_title_alignment' => 'left', 'blog_entry_meta_alignment' => 'left', - // Padding. + // Padding & Spacing. 'box_padding' => 30, 'logo_padding' => 28, + 'content_edge_spacing' => 12, + 'content_edge_spacing_unit' => 'px', // Colors. 'responsive_site_background_color' => 'palette5', 'background_gradient_color' => 'linear-gradient(135deg, #12c2e9 0%, #c471ed 50%, #f64f59 100%)', @@ -1260,7 +1286,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', @@ -1269,7 +1295,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', @@ -1333,18 +1359,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', @@ -1356,17 +1382,41 @@ function defaults() { 'button_border' => '#10659C', 'button_hover_border' => '#0066CC', 'inputs_background' => '#ffffff', - 'inputs_text' => '#333333', + 'inputs_text' => '#404040', 'inputs_border' => '#cccccc', - 'label' => '#333333', + 'responsive_title_above_content_bg_color' => '', + 'responsive_title_above_content_overlay_color' => '', + 'responsive_blog_banner_background_color' => 'title-above-content-bg-color', + 'responsive_single_blog_banner_background_color' => 'title-above-content-bg-color', + 'responsive_page_title_banner_background_color' => 'title-above-content-bg-color', + 'responsive_single_blog_featured_image_overlay_color' => 'title-above-content-overlay-color', + 'responsive_page_featured_image_overlay_color' => 'title-above-content-overlay-color', + 'responsive_link_style' => 'standard', + 'label' => '#404040', 'responsive_style' => 'boxed', 'responsive_sidebar_style' => 'boxed', + 'responsive_sidebar_link_style' => 'none', 'responsive_page_sidebar_style' => 'default', 'responsive_blog_sidebar_style' => 'default', 'responsive_single_blog_sidebar_style'=> 'default', 'responsive_shop_sidebar_style' => 'default', 'responsive_single_product_sidebar_style' => 'default', + 'responsive_widget_bottom_spacing' => 30, + 'responsive_widget_bottom_spacing_unit' => 'px', + 'responsive_widget_bottom_spacing_tablet' => '', + 'responsive_widget_bottom_spacing_tablet_unit' => 'px', + 'responsive_widget_bottom_spacing_mobile' => '', + 'responsive_widget_bottom_spacing_mobile_unit' => 'px', + 'responsive_sidebar_border_divider_style' => 'none', + 'responsive_sidebar_border_divider_width' => 0, + 'responsive_sidebar_border_divider_width_unit' => 'px', + 'responsive_sidebar_border_divider_width_tablet' => '', + 'responsive_sidebar_border_divider_width_tablet_unit' => 'px', + 'responsive_sidebar_border_divider_width_mobile' => '', + 'responsive_sidebar_border_divider_width_mobile_unit' => 'px', + 'responsive_sidebar_border_divider_color' => '#cccccc', + 'responsive_sidebar_sticky' => 0, // 'responsive_header_layout' => 'horizontal', // 'responsive_header_alignment' => 'center', 'header_menu_full_width' => 1, @@ -1465,8 +1515,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', @@ -1480,7 +1530,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', @@ -1514,6 +1564,18 @@ function defaults() { 'responsive_header_button_shadow_blur' => 0, 'responsive_header_button_shadow_spread' => 0, 'responsive_header_button_shadow_inset' => false, + 'responsive_button_shadow_color' => '#FFFFFF', + 'responsive_button_shadow_x' => 0, + 'responsive_button_shadow_y' => 0, + 'responsive_button_shadow_blur' => 0, + 'responsive_button_shadow_spread' => 0, + 'responsive_button_shadow_inset' => false, + 'responsive_button_hover_shadow_color' => '#FFFFFF', + 'responsive_button_hover_shadow_x' => 0, + 'responsive_button_hover_shadow_y' => 0, + 'responsive_button_hover_shadow_blur' => 0, + 'responsive_button_hover_shadow_spread' => 0, + 'responsive_button_hover_shadow_inset' => false, 'responsive_header_button_padding_x' => 0, 'responsive_header_button_radius_y' => 0, 'responsive_header_button_radius_x' => 0, @@ -1816,6 +1878,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' => '', @@ -1823,6 +1888,22 @@ function defaults() { 'responsive_comments_padding' => 30, 'responsive_comments_margin_y' => 28, 'responsive_comments_margin_x' => 0, + 'responsive_single_post_boxed_shadow_x' => 0, + 'responsive_single_post_boxed_shadow_y' => 0, + 'responsive_single_post_boxed_shadow_blur' => 0, + 'responsive_single_post_boxed_shadow_spread' => 0, + 'responsive_single_post_boxed_shadow_inset' => false, + 'responsive_single_post_boxed_shadow_color' => '#FFFFFF', + 'responsive_archive_grid_boxed_shadow_x' => 0, + 'responsive_archive_grid_boxed_shadow_y' => 0, + 'responsive_archive_grid_boxed_shadow_blur' => 0, + 'responsive_archive_grid_boxed_shadow_spread' => 0, + 'responsive_archive_grid_boxed_shadow_inset' => false, + 'responsive_archive_grid_boxed_shadow_color' => '#FFFFFF', + 'responsive_single_post_boxed_radius' => '', + 'responsive_single_post_boxed_radius_unit' => 'px', + 'responsive_archive_grid_boxed_radius' => '', + 'responsive_archive_grid_boxed_radius_unit' => 'px', ), ); return $theme_options; @@ -2052,7 +2133,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 ); @@ -2916,6 +2997,80 @@ function responsive_prepare_css_value( $key, $default = '' ) { return 'var(--responsive-global-' . $value . ')'; } + if ( 'title-above-content-bg-color' === $value ) { + return 'var(--responsive-title-above-content-bg-color)'; + } + + if ( 'title-above-content-overlay-color' === $value ) { + return 'var(--responsive-title-above-content-overlay-color)'; + } + 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 876e3b858..3064762de 100644 --- a/core/includes/modules/related-posts/class-responsive-related-posts.php +++ b/core/includes/modules/related-posts/class-responsive-related-posts.php @@ -360,7 +360,7 @@ public function responsive_get_related_single_post_meta_data($current_post_id) 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 ed2e4c3a3..aa8053b04 100644 --- a/core/sass/_blog.scss +++ b/core/sass/_blog.scss @@ -1,11 +1,30 @@ /* Loader */ -.blog.responsive-site-style-boxed .site-content .container, .blog.responsive-site-style-content-boxed .site-content .container, .blog.responsive-site-style-flat .site-content .container { - margin: 52px auto auto; +.site-content .container { + margin: 52px auto; } -/* For Category page , title alignment - */ -body.category .page-header .page-title { - text-align: left; + +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 e6558d555..ad55361ca 100644 --- a/core/sass/_content.scss +++ b/core/sass/_content.scss @@ -111,11 +111,6 @@ border-radius: none !important; } - .entry-title { - margin-top: $base-line-height-px / 2; - margin-bottom: $base-line-height-px / 2; - } - .thumbnail { margin-top: $base-line-height-px / 2; margin-bottom: $base-line-height-px / 2; @@ -125,22 +120,11 @@ } } - .entry-category, - .entry-category a, - .blog-entry-category, - .blog-entry-category a, - .posted-in, - .posted-in a, - .cat-links, - .cat-links a { - text-transform: capitalize; - } - .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); @@ -225,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; } } @@ -252,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; + } + } + } + } } @@ -313,7 +341,7 @@ .blog { &.meta-alignment { &-left { - .hentry { + .hentry, .responsive-blog-single-banner2 .container { .post-data, .post-edit-link, .post-meta { @@ -323,7 +351,7 @@ } &-right { - .hentry { + .hentry, .responsive-blog-single-banner2 .container { .post-data, .post-edit-link, .post-meta { @@ -333,7 +361,7 @@ } &-center { - .hentry { + .hentry, .responsive-blog-single-banner2 .container { .post-data, .post-edit-link, .post-meta { @@ -342,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 { @@ -361,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 & { @@ -398,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 & { @@ -534,12 +638,28 @@ .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 { margin-top: 28px; } +.comment-respond form p.form-submit { + margin-bottom: 0; +} + div.comments-area { @include make-block-element(); padding: $base-line-height-px; @@ -571,29 +691,51 @@ div.comments-area { } .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"); } } 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/_sidebar.scss b/core/sass/_sidebar.scss index b737cb73a..dfc2d60f2 100644 --- a/core/sass/_sidebar.scss +++ b/core/sass/_sidebar.scss @@ -139,3 +139,7 @@ input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } + +#secondary.widget-area .widget-wrapper { + margin-top: 0; +} diff --git a/core/sass/_variables.scss b/core/sass/_variables.scss index b832fbd70..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; @@ -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 47336e348..7eb827765 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' ); @@ -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 */ @@ -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,75 @@ 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' ); @@ -3100,4 +3190,23 @@ function responsive_output_meta_description() { } } -add_action( 'wp_head', 'responsive_output_meta_description', 1 ); \ No newline at end of file +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/loop-header.php b/loop-header.php index 497e05be7..871485d4c 100644 --- a/loop-header.php +++ b/loop-header.php @@ -96,28 +96,96 @@ if ( ! $responsive_page_title && ! $responsive_page_description && ! $responsive_show_breadcrumbs ) { return; } + +$is_blog_archive = ( is_home() || ( is_archive() && ! is_search() ) ); +$blog_layout = get_theme_mod( 'responsive_blog_title_layout', 'post_title_layout1' ); + +if ( $is_blog_archive ) { + if ( 'post_title_layout2' === $blog_layout ) { + // Output is handled in responsive_wrapper_top hook + return; + } + + $elements = get_theme_mod( 'responsive_blog_title_elements_positioning', array( 'title', 'description', 'breadcrumb' ) ); + if ( is_string( $elements ) ) { + $decoded = json_decode( $elements, true ); + $elements = is_array( $decoded ) ? $decoded : explode( ',', $elements ); + } else if ( ! is_array( $elements ) ) { + $elements = array(); + } + + // For layout1: + // Hide everything on the blog page. + if ( is_home() ) { + $responsive_page_title = ''; + $responsive_page_description = ''; + $responsive_show_breadcrumbs = false; + } else { + // For archive pages, conditionally show elements based on their presence in the control. + if ( ! in_array( 'breadcrumb', $elements, true ) ) { + $responsive_show_breadcrumbs = false; + } else { + $responsive_show_breadcrumbs = true; + } + if ( ! in_array( 'title', $elements, true ) ) { + $responsive_page_title = ''; + } + if ( ! in_array( 'description', $elements, true ) ) { + $responsive_page_description = ''; + } + } + + if ( ! $responsive_page_title && ! $responsive_page_description && ! $responsive_show_breadcrumbs ) { + return; + } +} ?>
    - - - - diff --git a/package.json b/package.json index 88c334dec..f94ab7762 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "responsive", - "version": "6.4.0", + "version": "6.4.2", "description": "Responsive theme by CyberChimps", "main": "Gruntfile.js", "sasslintConfig": ".sasslintrc.json", diff --git a/page.php b/page.php index 0099de057..9b73e058f 100644 --- a/page.php +++ b/page.php @@ -26,7 +26,11 @@ while ( have_posts() ) : the_post(); get_template_part( 'partials/page/layout', get_post_type() ); - comments_template(); + if ( get_theme_mod( 'responsive_page_show_comments', false ) && ( comments_open() ) ) { + Responsive\responsive_comments_before(); + comments_template( '', true ); + Responsive\responsive_comments_after(); + } endwhile; get_template_part( 'loop-nav', get_post_type() ); diff --git a/partials/entry/layout.php b/partials/entry/layout.php index ef7c7b887..84ff90bc7 100644 --- a/partials/entry/layout.php +++ b/partials/entry/layout.php @@ -18,7 +18,6 @@ add_filter( 'excerpt_length', 'responsive_custom_excerpt_length' ); add_filter( 'responsive_post_read_more', 'responsive_read_more_text' ); } elseif ( 'content' === $responsive_blog_entry_content_type ) { - add_filter( 'the_content_more_link', 'responsive_modify_read_more_link' ); add_filter( 'responsive_post_read_more', 'responsive_read_more_text' ); } diff --git a/partials/entry/meta.php b/partials/entry/meta.php index 28333709e..a5c8183c3 100644 --- a/partials/entry/meta.php +++ b/partials/entry/meta.php @@ -39,7 +39,7 @@ 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( @@ -72,7 +72,7 @@ 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' ) ) ) ); ?> @@ -93,7 +93,7 @@ esc_url( get_permalink() ), esc_attr( get_the_title() ), esc_html( get_the_modified_date( 'c' ) ), - esc_html( get_the_modified_date() ) + esc_html( get_the_modified_date( 'M j, Y' ) ) ) ); ?> diff --git a/partials/entry/thumbnail-style/date.php b/partials/entry/thumbnail-style/date.php index 8d9ab03f5..2f834412a 100644 --- a/partials/entry/thumbnail-style/date.php +++ b/partials/entry/thumbnail-style/date.php @@ -13,7 +13,7 @@ if ( 'post' == get_post_type() ) { ?> diff --git a/partials/page/breadcrumbs.php b/partials/page/breadcrumbs.php new file mode 100644 index 000000000..1028334c0 --- /dev/null +++ b/partials/page/breadcrumbs.php @@ -0,0 +1,15 @@ + + + diff --git a/partials/page/excerpt.php b/partials/page/excerpt.php new file mode 100644 index 000000000..e2ca9999e --- /dev/null +++ b/partials/page/excerpt.php @@ -0,0 +1,23 @@ + +
    + post_excerpt ) ) { + echo wp_kses_post( wpautop( $page_post->post_excerpt ) ); + } else { + echo wp_kses_post( wpautop( wp_trim_words( get_the_content(), 40, ' […]' ) ) ); + } + ?> +
    diff --git a/partials/page/layout.php b/partials/page/layout.php index a262c0fda..8d5065f16 100644 --- a/partials/page/layout.php +++ b/partials/page/layout.php @@ -14,6 +14,38 @@ $format = get_post_format(); Responsive\responsive_entry_before(); // Add classes to the blog entry post class. + +$page_featured_image_position = get_theme_mod( 'responsive_page_featured_image_position', 'none' ); +$page_title_layout = get_theme_mod( 'responsive_page_title_layout', 'post_title_layout1' ); +$page_featured_image_ratio = get_theme_mod( 'responsive_page_featured_image_ratio', 'original' ); +$page_featured_image_alignment = get_theme_mod( 'responsive_page_featured_image_alignment', 'left' ); + +$ratio_css = ''; +if ( 'predefined' === $page_featured_image_ratio ) { + $predefined_ratio = get_theme_mod( 'responsive_page_featured_image_predefined_ratio', '1:1' ); + $ratio_value = str_replace( ':', '/', $predefined_ratio ); + $ratio_css = 'aspect-ratio: ' . esc_attr( $ratio_value ) . ';'; +} elseif ( 'custom' === $page_featured_image_ratio ) { + $custom_width = get_theme_mod( 'responsive_page_featured_image_custom_width', '' ); + $custom_height = get_theme_mod( 'responsive_page_featured_image_custom_height', '' ); + if ( $custom_width && $custom_height ) { + $ratio_css = 'aspect-ratio: ' . esc_attr( $custom_width ) . '/' . esc_attr( $custom_height ) . ';'; + } +} + +if ( in_array( $page_title_layout, array( 'post_title_layout1', 'post_title_layout2' ) ) && 'outside' === $page_featured_image_position && has_post_thumbnail() && ! post_password_required() && in_array( 'featured_image', responsive_page_single_elements_positioning(), true ) ) { + ?> +
    + .responsive-single-post-featured-section.post-thumb img { ' . $ratio_css . ' object-fit: cover; width: 100%; height: 100%; }'; + } + $page_featured_image_size = get_theme_mod( 'responsive_page_featured_image_size', 'full' ); + the_post_thumbnail( $page_featured_image_size ); + ?> +
    +
    > @@ -22,22 +54,55 @@ // Get posts format. $format = get_post_format(); - // Get elements. - $elements = responsive_page_single_elements_positioning(); - // Loop through elements. - foreach ( $elements as $element ) { + if ( get_theme_mod( 'responsive_page_title_layout', 'post_title_layout1' ) === 'post_title_layout1' ) { + // Get elements. + $elements = responsive_page_single_elements_positioning(); + ?> + +
    > + +
    + + + + diff --git a/partials/page/tags.php b/partials/page/tags.php new file mode 100644 index 000000000..e7113daed --- /dev/null +++ b/partials/page/tags.php @@ -0,0 +1,26 @@ + + + diff --git a/partials/page/thumbnail.php b/partials/page/thumbnail.php index 1e8864ae8..882f6c19d 100644 --- a/partials/page/thumbnail.php +++ b/partials/page/thumbnail.php @@ -5,11 +5,42 @@ * @package responsive */ -?> -
    - +// Exit if accessed directly. +if ( ! defined( 'ABSPATH' ) ) { + exit; +} + +$page_featured_image_size = get_theme_mod( 'responsive_page_featured_image_size', 'full' ); +$page_featured_image_alignment = get_theme_mod( 'responsive_page_featured_image_alignment', 'left' ); +$page_featured_image_ratio = get_theme_mod( 'responsive_page_featured_image_ratio', 'original' ); + +$ratio_css = ''; +if ( 'predefined' === $page_featured_image_ratio ) { + $predefined_ratio = get_theme_mod( 'responsive_page_featured_image_predefined_ratio', '1:1' ); + $ratio_value = str_replace( ':', '/', $predefined_ratio ); + $ratio_css = 'aspect-ratio: ' . esc_attr( $ratio_value ) . ';'; +} elseif ( 'custom' === $page_featured_image_ratio ) { + $custom_width = get_theme_mod( 'responsive_page_featured_image_custom_width', '' ); + $custom_height = get_theme_mod( 'responsive_page_featured_image_custom_height', '' ); + if ( $custom_width && $custom_height ) { + $ratio_css = 'aspect-ratio: ' . esc_attr( $custom_width ) . '/' . esc_attr( $custom_height ) . ';'; + } +} + +// Image args. +$img_args = array(); +if ( responsive_get_schema_markup( 'image' ) ) { + $img_args['itemprop'] = 'thumbnailUrl'; +} + +if ( $ratio_css ) { + $img_args['style'] = $ratio_css . ' object-fit: cover;'; +} + +if ( has_post_thumbnail() ) : ?> +
    > - + - -
    +
    + diff --git a/partials/single/excerpt.php b/partials/single/excerpt.php new file mode 100644 index 000000000..3c1ee9b8f --- /dev/null +++ b/partials/single/excerpt.php @@ -0,0 +1,25 @@ + + +
    + +
    + + \ No newline at end of file diff --git a/partials/single/layout.php b/partials/single/layout.php index d9cf6b46f..368a4409d 100644 --- a/partials/single/layout.php +++ b/partials/single/layout.php @@ -10,8 +10,39 @@ exit; } Responsive\responsive_entry_before(); -?> +$single_featured_image_position = get_theme_mod( 'responsive_single_blog_featured_image_position', 'none' ); +$single_title_layout = get_theme_mod( 'responsive_single_blog_post_title_layout', 'post_title_layout1' ); +$single_featured_image_ratio = get_theme_mod( 'responsive_single_blog_featured_image_ratio', 'original' ); +$single_featured_image_alignment = get_theme_mod( 'responsive_single_blog_featured_image_alignment', 'left' ); + +$ratio_css = ''; +if ( 'predefined' === $single_featured_image_ratio ) { + $predefined_ratio = get_theme_mod( 'responsive_single_blog_featured_image_predefined_ratio', '1:1' ); + $ratio_value = str_replace( ':', '/', $predefined_ratio ); + $ratio_css = 'aspect-ratio: ' . esc_attr( $ratio_value ) . ';'; +} elseif ( 'custom' === $single_featured_image_ratio ) { + $custom_width = get_theme_mod( 'responsive_single_blog_featured_image_custom_width', '' ); + $custom_height = get_theme_mod( 'responsive_single_blog_featured_image_custom_height', '' ); + if ( $custom_width && $custom_height ) { + $ratio_css = 'aspect-ratio: ' . esc_attr( $custom_width ) . '/' . esc_attr( $custom_height ) . ';'; + } +} + +if ( in_array( $single_title_layout, array( 'post_title_layout1', 'post_title_layout2' ) ) && 'outside' === $single_featured_image_position && has_post_thumbnail() && ! post_password_required() ) { + ?> +
    + .responsive-single-post-featured-section.post-thumb img { ' . $ratio_css . ' object-fit: cover; width: 100%; height: 100%; }'; + } + $single_featured_image_size = get_theme_mod( 'responsive_single_blog_featured_image_size', 'full' ); + the_post_thumbnail( $single_featured_image_size ); + ?> +
    +
    > @@ -22,23 +53,52 @@ // Get posts format. $format = get_post_format(); - // Get elements. - $elements = responsive_blog_single_elements_positioning(); - // Loop through elements. - foreach ( $elements as $element ) { - - // Featured Image. - if ( 'featured_image' === $element - && ! post_password_required() ) { - - $format = $format ? $format : 'thumbnail'; - - get_template_part( 'partials/single/media/blog-single', $format ); - - } else { - get_template_part( 'partials/single/' . $element ); + if ( get_theme_mod( 'responsive_single_blog_post_title_layout', 'post_title_layout1' ) === 'post_title_layout1' ) { + // Get elements. + $elements = responsive_blog_single_elements_positioning(); + ?> + +
    > + +
    + @@ -74,12 +134,14 @@
    '' . esc_html__( 'Previous Post is ', 'responsive' ) . ' ‹ %title', - 'next_text' => '' . esc_html__( 'Next Post is', 'responsive' ) . ' %title ›', - 'excluded_terms' => get_theme_mod( 'exclude_post_cat' ), - ) -); +if ( 1 === (int) get_theme_mod( 'responsive_single_blog_navigation', 0 ) ) { + the_post_navigation( + array( + 'prev_text' => '' . esc_html__( 'Previous Post is ', 'responsive' ) . ' ‹ %title', + 'next_text' => '' . esc_html__( 'Next Post is', 'responsive' ) . ' %title ›', + 'excluded_terms' => get_theme_mod( 'exclude_post_cat' ), + ) + ); +} Responsive\responsive_single_blog_related_posts_entry(); ?> diff --git a/partials/single/media/blog-single.php b/partials/single/media/blog-single.php index b94b16855..fb0aa235d 100644 --- a/partials/single/media/blog-single.php +++ b/partials/single/media/blog-single.php @@ -15,6 +15,24 @@ return; } +// Fetch Customizer Settings +$single_featured_image_size = get_theme_mod( 'responsive_single_blog_featured_image_size', 'full' ); +$single_featured_image_alignment = get_theme_mod( 'responsive_single_blog_featured_image_alignment', 'left' ); +$single_featured_image_ratio = get_theme_mod( 'responsive_single_blog_featured_image_ratio', 'original' ); + +$ratio_css = ''; +if ( 'predefined' === $single_featured_image_ratio ) { + $predefined_ratio = get_theme_mod( 'responsive_single_blog_featured_image_predefined_ratio', '1:1' ); + $ratio_value = str_replace( ':', '/', $predefined_ratio ); + $ratio_css = 'aspect-ratio: ' . esc_attr( $ratio_value ) . ';'; +} elseif ( 'custom' === $single_featured_image_ratio ) { + $custom_width = get_theme_mod( 'responsive_single_blog_featured_image_custom_width', '' ); + $custom_height = get_theme_mod( 'responsive_single_blog_featured_image_custom_height', '' ); + if ( $custom_width && $custom_height ) { + $ratio_css = 'aspect-ratio: ' . esc_attr( $custom_width ) . '/' . esc_attr( $custom_height ) . ';'; + } +} + // Image args. $img_args = array( 'alt' => get_the_title(), @@ -23,14 +41,18 @@ $img_args['itemprop'] = 'thumbnailUrl'; } +if ( $ratio_css ) { + $img_args['style'] = $ratio_css . ' object-fit: cover;'; +} + // Caption. $caption = get_the_post_thumbnail_caption(); ?> -
    +
    @@ -87,7 +87,7 @@ esc_url( get_permalink() ), esc_attr( get_the_title() ), esc_html( get_the_modified_date( 'c' ) ), - esc_html( get_the_modified_date() ) + esc_html( get_the_modified_date( 'M j, Y' ) ) ) ); ?> @@ -109,8 +109,8 @@ } if ( 'tag' === $section ) { + if ( has_tag() ) { ?> - - diff --git a/readme.txt b/readme.txt index 0d006887f..7e7797aac 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: cyberchimps Requires at least: 5.0 Tested up to: 7.0 Requires PHP: 5.6 -Stable tag: 6.4.0 +Stable tag: 6.4.2 License: GPLv3 or later License URI: https://www.gnu.org/licenses/gpl-3.0.html diff --git a/style.css b/style.css index 91883db3c..b19bb19e4 100644 --- a/style.css +++ b/style.css @@ -1,6 +1,6 @@ /** * Theme name: Responsive - * Version: 6.4.0 + * Version: 6.4.2 * Theme URI: https://cyberchimps.com/responsive/ * Author: CyberChimps * Author URI: https://cyberchimps.com