isDark() ) { $dark = true; // If it's a vertical gradient. } elseif ( 'to bottom' === pen_option_get( 'color_header_background_angle' ) ) { $color = new \Pen_Theme\Color( pen_option_get( 'color_header_background_secondary' ) ); if ( $color->isDark() ) { $dark = true; } } if ( $dark ) { /** * Although we can analyze images to determine whether they * are dark or light but it is very resource intensive, * so we just ignore the light-colored logo when there is * a background image. * In later versions we may let the user choose this, especially * if we decide to add it to the plugin. */ $header_image = get_header_image(); if ( $header_image ) { $dark = false; } else { $background_dynamic = get_post_meta( $content_id, 'pen_content_background_image_header_dynamic_override', true ); if ( ! $background_dynamic || 'default' === $background_dynamic ) { $background_dynamic = pen_option_get( 'background_image_header_dynamic' ); } if ( 'featured_image' === $background_dynamic && $content_id ) { $image_dynamic = get_the_post_thumbnail_url(); if ( $image_dynamic ) { $dark = false; } } } } if ( $dark ) { $logo_url = $logo_url_light; } } if ( ! $logo_url ) { if ( function_exists( 'get_custom_logo' ) ) { $logo = trim( get_custom_logo() ); } else { return; } } else { $id = attachment_url_to_postid( $logo_url ); $attributes = array( 'class' => 'custom-logo', 'itemprop' => 'logo', ); $alt = get_post_meta( $id, '_wp_attachment_image_alt', true ); if ( ! $alt ) { $attributes['alt'] = get_bloginfo( 'name', 'display' ); } $logo = sprintf( '%2$s', esc_url( home_url( '/' ) ), wp_get_attachment_image( $id, 'full', false, $attributes ) ); } if ( $logo ) { $classes = array( 'pen_logo', pen_class_animation( $location . '_logo', false, $content_id ), ); $classes = implode( ' ', array_filter( $classes ) ); ob_start(); ?>