astra_get_responsive_background_obj( $content_bg_obj, 'desktop' ), ); // Container Layout Colors. $container_css_tablet = array( '.ast-separate-container .ast-article-single:not(.ast-related-post), .woocommerce.ast-separate-container .ast-woocommerce-container, .ast-separate-container .error-404, .ast-separate-container .no-results, .single.ast-separate-container ' . esc_attr( $author_box_extra_selector ) . ' .ast-author-meta, .ast-separate-container .related-posts-title-wrapper,.ast-separate-container .comments-count-wrapper, .ast-box-layout.ast-plain-container .site-content,.ast-padded-layout.ast-plain-container .site-content, .ast-separate-container .ast-archive-description' . $narrow_dynamic_selector => astra_get_responsive_background_obj( $content_bg_obj, 'tablet' ), ); // Container Layout Colors. $container_css_mobile = array( '.ast-separate-container .ast-article-single:not(.ast-related-post), .woocommerce.ast-separate-container .ast-woocommerce-container, .ast-separate-container .error-404, .ast-separate-container .no-results, .single.ast-separate-container ' . esc_attr( $author_box_extra_selector ) . ' .ast-author-meta, .ast-separate-container .related-posts-title-wrapper,.ast-separate-container .comments-count-wrapper, .ast-box-layout.ast-plain-container .site-content,.ast-padded-layout.ast-plain-container .site-content, .ast-separate-container .ast-archive-description' . $narrow_dynamic_selector => astra_get_responsive_background_obj( $content_bg_obj, 'mobile' ), ); // Sidebar specific css. $sidebar_css = array( '.ast-separate-container.ast-two-container #secondary .widget' => astra_get_responsive_background_obj( $sidebar_default_css, 'desktop' ), ); // Sidebar specific css. $sidebar_css_tablet = array( '.ast-separate-container.ast-two-container #secondary .widget' => astra_get_responsive_background_obj( $sidebar_default_css, 'tablet' ), ); // Sidebar specific css. $sidebar_css_mobile = array( '.ast-separate-container.ast-two-container #secondary .widget' => astra_get_responsive_background_obj( $sidebar_default_css, 'mobile' ), ); // Apply Content BG Color for Narrow Unboxed Container. if ( ! astra_is_content_style_boxed() && 'narrow-container' === $current_layout ) { $container_css = array_merge( $container_css, array( '.ast-narrow-container .site-content' => astra_get_responsive_background_obj( $content_bg_obj, 'desktop' ) ) ); $container_css_tablet = array_merge( $container_css_tablet, array( '.ast-narrow-container .site-content' => astra_get_responsive_background_obj( $content_bg_obj, 'tablet' ) ) ); $container_css_mobile = array_merge( $container_css_mobile, array( '.ast-narrow-container .site-content' => astra_get_responsive_background_obj( $content_bg_obj, 'mobile' ) ) ); } // Blog Pro Layout Colors. if ( ( 'blog-layout-1' === $blog_layout || 'blog-layout-4' === $blog_layout || 'blog-layout-6' === $blog_layout ) || ( defined( 'ASTRA_EXT_VER' ) && ( 'blog-layout-1' === $blog_layout || 'blog-layout-4' === $blog_layout || 'blog-layout-6' === $blog_layout ) && 1 !== $blog_grid ) ) { $blog_layouts = array( '.ast-separate-container .ast-article-inner' => astra_get_responsive_background_obj( $content_bg_obj, 'desktop' ), ); $blog_layouts_tablet = array( '.ast-separate-container .ast-article-inner' => astra_get_responsive_background_obj( $content_bg_obj, 'tablet' ), ); $blog_layouts_mobile = array( '.ast-separate-container .ast-article-inner' => astra_get_responsive_background_obj( $content_bg_obj, 'mobile' ), ); } else { $blog_layouts = array( '.ast-separate-container .ast-article-post' => astra_get_responsive_background_obj( $content_bg_obj, 'desktop' ), ); $blog_layouts_tablet = array( '.ast-separate-container .ast-article-post' => astra_get_responsive_background_obj( $content_bg_obj, 'tablet' ), ); $blog_layouts_mobile = array( '.ast-separate-container .ast-article-post' => astra_get_responsive_background_obj( $content_bg_obj, 'mobile' ), ); $inner_layout = array( '.ast-separate-container .ast-article-inner' => array( 'background-color' => 'transparent', 'background-image' => 'none', ), ); $dynamic_css .= astra_parse_css( $inner_layout ); } $dynamic_css .= astra_parse_css( $blog_layouts ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $dynamic_css .= astra_parse_css( $blog_layouts_tablet, '', astra_get_tablet_breakpoint() ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $dynamic_css .= astra_parse_css( $blog_layouts_mobile, '', astra_get_mobile_breakpoint() ); $dynamic_css .= astra_parse_css( $container_css ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $dynamic_css .= astra_parse_css( $container_css_tablet, '', astra_get_tablet_breakpoint() ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $dynamic_css .= astra_parse_css( $container_css_mobile, '', astra_get_mobile_breakpoint() ); $dynamic_css .= astra_parse_css( $sidebar_css ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $dynamic_css .= astra_parse_css( $sidebar_css_tablet, '', astra_get_tablet_breakpoint() ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $dynamic_css .= astra_parse_css( $sidebar_css_mobile, '', astra_get_mobile_breakpoint() ); if ( astra_apply_content_background_fullwidth_layouts() ) { $fullwidth_layout = array( '.ast-plain-container, .ast-page-builder-template' => astra_get_responsive_background_obj( $content_bg_obj, 'desktop' ), ); $fullwidth_layout_tablet = array( '.ast-plain-container, .ast-page-builder-template' => astra_get_responsive_background_obj( $content_bg_obj, 'tablet' ), ); $fullwidth_layout_mobile = array( '.ast-plain-container, .ast-page-builder-template' => astra_get_responsive_background_obj( $content_bg_obj, 'mobile' ), ); $dynamic_css .= astra_parse_css( $fullwidth_layout ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $dynamic_css .= astra_parse_css( $fullwidth_layout_tablet, '', astra_get_tablet_breakpoint() ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $dynamic_css .= astra_parse_css( $fullwidth_layout_mobile, '', astra_get_mobile_breakpoint() ); } return $dynamic_css; } /** * Applies an unboxed container to the content. * * @since 4.2.0 * @param array $content_bg_obj The background object for the content. * @param bool $is_boxed Container style is boxed or not. * @param bool $is_sidebar_boxed Sidebar style is boxed or not. * @param mixed $current_layout The current container layout applied. * @return array $content_bg_obj The updated background object for the content. */ function astra_apply_unboxed_container( $content_bg_obj, $is_boxed, $is_sidebar_boxed, $current_layout ) { $site_bg_obj = astra_get_option( 'site-layout-outside-bg-obj-responsive' ); $meta_background_enabled = astra_get_option_meta( 'ast-page-background-enabled' ); // Check for third party pages meta. if ( '' === $meta_background_enabled && astra_with_third_party() ) { $meta_background_enabled = astra_third_party_archive_meta( 'ast-page-background-enabled' ); if ( isset( $meta_background_enabled ) && 'enabled' === $meta_background_enabled ) { $site_bg_obj = astra_third_party_archive_meta( 'ast-page-background-meta' ); } } elseif ( isset( $meta_background_enabled ) && 'enabled' === $meta_background_enabled ) { $site_bg_obj = astra_get_option_meta( 'ast-page-background-meta' ); } if ( 'plain-container' === $current_layout && ! $is_boxed && $is_sidebar_boxed && 'no-sidebar' !== astra_page_layout() ) { $content_bg_obj = $site_bg_obj; } return $content_bg_obj; }