Как в коде (где именно) изменить расположение миниатюры в записи в WordPress? Чтобы получилось как на картинке?
Как в коде (где именно) изменить расположение миниатюры в записи в WordPress? Чтобы получилось как на картинке
<?php cryout_before_inner_hook(); $mode = 'excerpt'; // default if ( $options['fluida_excerptarchive'] == "full" ) { $mode = 'content'; } if ( is_sticky() && $options['fluida_excerptsticky'] == "full" ) { $mode = 'content'; } if ( $options['fluida_excerpthome'] == "full" && ! is_archive() && ! is_search() ) { $mode = 'content'; } if ( false != get_post_format() ) { $mode = 'content'; } switch ( $mode ) { case 'content': ?> <div class="entry-content" <?php cryout_schema_microdata( 'entry-content' ); ?>> <?php the_content(); ?> <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'fluida' ), 'after' => '</div>' ) ); ?> </div><!-- .entry-content --> <?php break; case 'excerpt': default: ?> <div class="entry-summary" <?php cryout_schema_microdata( 'entry-summary' ); ?>> <?php the_excerpt(); ?> </div><!-- .entry-summary --> <footer class="post-continue-container"> <?php cryout_post_excerpt_hook(); ?> </footer> <?php break; }; ?> <?php cryout_after_inner_hook(); ?> </div><!-- .article-inner --> </article><!-- #post-<?php the_ID(); ?> --> <?php cryout_after_article_hook(); ?>
Функция эта всего лишь возвращает экшен на который повешен только вывод миниатюры, он задается тут fluida_set_featured_srcset_picture()
function fluida_set_featured_srcset_picture() { global $post; $options = cryout_get_option( array( 'fluida_fpost', 'fluida_fauto', 'fluida_falign', 'fluida_magazinelayout', 'fluida_landingpage' ) ); switch ( apply_filters( 'fluida_lppostslayout_filter', $options['fluida_magazinelayout'] ) ) { case 3: $featured = 'fluida-featured-third'; break; case 2: $featured = 'fluida-featured-half'; break; case 1: default: $featured = 'fluida-featured'; break; }; // filter to disable srcset if so desired $use_srcset = apply_filters( 'fluida_featured_srcset', true ); if ( function_exists('has_post_thumbnail') && has_post_thumbnail() && $options['fluida_fpost']) { // has featured image $featured_image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'fluida-featured' ); $fimage_id = get_post_thumbnail_id( $post->ID ); } elseif ( $options['fluida_fpost'] && $options['fluida_fauto'] && empty($featured_image) ) { // get the first image from post $featured_image = cryout_post_first_image( $post->ID, 'fluida-featured' ); $fimage_id = $featured_image['id']; } else { // featured image not enabled or not obtainable $featured_image[0] = apply_filters('fluida_preview_img_src', ''); $featured_image[1] = apply_filters('fluida_preview_img_w', ''); $featured_image[2] = apply_filters('fluida_preview_img_h', ''); $fimage_id = FALSE; }; if ( ! empty( $featured_image[0] ) ) { $featured_width = fluida_featured_width(); ?> <div class="post-thumbnail-container" <?php cryout_schema_microdata( 'image' ); ?>> <a href="<?php echo esc_url( get_permalink( $post->ID ) ) ?>" title="<?php echo esc_attr( get_post_field( 'post_title', $post->ID ) ) ?>" <?php cryout_echo_bgimage( $featured_image[0], 'post-featured-image' ) ?>> </a> <a class="responsive-featured-image" href="<?php echo esc_url( get_permalink( $post->ID ) ) ?>" title="<?php echo esc_attr( get_post_field( 'post_title', $post->ID ) ) ?>"> <picture> <source media="(max-width: 1152px)" sizes="<?php echo cryout_gen_featured_sizes($featured_width, $options['fluida_magazinelayout'], $options['fluida_landingpage'] ) ?>" srcset="<?php echo cryout_get_picture_src( $fimage_id, 'fluida-featured-third' ); ?> 512w"> <source media="(max-width: 800px)" sizes="<?php echo cryout_gen_featured_sizes($featured_width, $options['fluida_magazinelayout'], $options['fluida_landingpage'] ) ?>" srcset="<?php echo cryout_get_picture_src( $fimage_id, 'fluida-featured-half' ); ?> 800w"> <?php if ( cryout_on_landingpage() ) { ?><source sizes="<?php echo cryout_gen_featured_sizes( $featured_width, $options['fluida_magazinelayout'], $options['fluida_landingpage'] ) ?>" srcset="<?php echo cryout_get_picture_src( $fimage_id, 'fluida-featured-lp' ); ?> <?php printf( '%sw', $featured_width ) ?>"> <?php } ?> <img alt="<?php the_title_attribute();?>" <?php cryout_schema_microdata( 'url' ); ?> src="<?php echo cryout_get_picture_src( $fimage_id, 'fluida-featured' ); ?>" /> </picture> </a> <meta itemprop="width" content="<?php echo $featured_image[1]; // width ?>"> <meta itemprop="height" content="<?php echo $featured_image[2]; // height ?>"> </div> <?php } } // fluida_set_featured_srcset_picture() endif; if ( cryout_get_option( 'fluida_fpost' ) ) add_action( 'cryout_featured_hook', 'fluida_set_featured_srcset_picture' ); /* FIN */