mirror of
https://github.com/10h30/display-featured-image-genesis.git
synced 2026-07-18 05:53:23 +09:00
Remove unnecessary image div
This commit is contained in:
@@ -88,7 +88,7 @@ class Display_Featured_Image_Genesis_Output {
|
||||
* @since 2.6.0
|
||||
*/
|
||||
public function add_inline_style() {
|
||||
$css = sprintf( '.big-leader, .big-leader__image img { max-height: %spx; }', $this->setting['max_height'] );
|
||||
$css = sprintf( '.big-leader, .big-leader--scriptless img { max-height: %spx; }', $this->setting['max_height'] );
|
||||
wp_add_inline_style( 'displayfeaturedimage-style', wp_strip_all_tags( $css ) );
|
||||
}
|
||||
|
||||
@@ -208,6 +208,10 @@ class Display_Featured_Image_Genesis_Output {
|
||||
$class .= ' big-leader--scriptless';
|
||||
}
|
||||
echo '<div class="' . esc_attr( $class ) . '">';
|
||||
$image = $this->get_banner_image();
|
||||
if ( $setting['scriptless'] ) {
|
||||
echo $image;
|
||||
}
|
||||
echo '<div class="wrap">';
|
||||
|
||||
do_action( 'display_featured_image_genesis_before_title' );
|
||||
@@ -229,10 +233,7 @@ class Display_Featured_Image_Genesis_Output {
|
||||
// close wrap
|
||||
echo '</div>';
|
||||
|
||||
$image = $this->get_banner_image();
|
||||
if ( $setting['scriptless'] ) {
|
||||
printf( '<div class="big-leader__image">%s</div>', $image );
|
||||
} else {
|
||||
if ( ! $setting['scriptless'] ) {
|
||||
printf( '<noscript><div class="backstretch no-js">%s</div></noscript>', $image );
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
.has-leader .site-inner{margin-top:0}.big-leader{overflow:hidden;max-height:600px;position:relative}.big-leader.--scriptless{height:auto}.big-leader__image img{-o-object-fit:cover;object-fit:cover}.big-leader .wrap{position:absolute;right:0;bottom:0;left:0;width:100%;z-index:1}.big-leader .entry-title.featured-image-overlay,.big-leader .archive-title.featured-image-overlay{color:#fff;text-align:center}.big-leader .excerpt,.big-leader .archive-description{margin-bottom:24px;padding:24px;background:rgba(255,255,255,.85)}.big-leader p{margin-top:18px;margin-bottom:0}.home .big-leader p{margin-top:0}.home .big-leader p:last-child{margin-bottom:0}.big-leader .excerpt .entry-title,.big-leader .archive-description .archive-title{margin-bottom:0}.backstretch.no-js{max-height:600px}img.featured{max-width:100%}@media only screen and (max-width: 768px){.big-leader,.backstretch.no-js{max-height:300px}.big-leader--scriptless,.backstretch.no-js--scriptless{height:auto}}
|
||||
.has-leader .site-inner{margin-top:0}.big-leader{overflow:hidden;max-height:600px;position:relative}.big-leader .wrap{position:absolute;right:0;bottom:0;left:0;width:100%;z-index:1}.big-leader--scriptless{height:auto}.big-leader--scriptless img{display:block;-o-object-fit:cover;object-fit:cover}.big-leader .entry-title.featured-image-overlay,.big-leader .archive-title.featured-image-overlay{color:#fff;text-align:center}.big-leader .excerpt,.big-leader .archive-description{margin-bottom:24px;padding:24px;background:rgba(255,255,255,.85)}.big-leader p{margin-top:18px;margin-bottom:0}.home .big-leader p{margin-top:0}.home .big-leader p:last-child{margin-bottom:0}.big-leader .excerpt .entry-title,.big-leader .archive-description .archive-title{margin-bottom:0}.backstretch.no-js{max-height:600px}img.featured{max-width:100%}@media only screen and (max-width: 768px){.big-leader,.big-leader--scriptless,.backstretch.no-js{max-height:300px}}
|
||||
@@ -7,14 +7,6 @@
|
||||
max-height: 600px;
|
||||
position: relative;
|
||||
|
||||
&.--scriptless {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
&__image img {
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.wrap {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
@@ -24,10 +16,21 @@
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.entry-title.featured-image-overlay,
|
||||
.archive-title.featured-image-overlay {
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
&--scriptless {
|
||||
height: auto;
|
||||
|
||||
img {
|
||||
display: block;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
|
||||
.entry-title,
|
||||
.archive-title {
|
||||
&.featured-image-overlay {
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.excerpt,
|
||||
@@ -69,11 +72,8 @@ img.featured {
|
||||
@media only screen and (max-width: 768px) {
|
||||
|
||||
.big-leader,
|
||||
.big-leader--scriptless,
|
||||
.backstretch.no-js {
|
||||
max-height: 300px;
|
||||
|
||||
&--scriptless {
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user