как убрать миниатюру в полной странице (записи).?
-
Здравствуйте, помогите пожалуйста, нужно отключить миниатюру записи в полной странице (записи). но при этом где вывод миниатюр на главной (их не трогать.)
-
content.php (template-parts/content.php)
<?php /** * Template part for displaying posts. * * @link https://codex.wordpress.org/Template_Hierarchy * * @package Mystery Themes * @subpackage Editorial * @since 1.0.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php if( has_post_thumbnail() ) { ?> <div class="post-image"> <a href="<?php the_permalink();?>" title="<?php the_title();?>"> <figure><?php the_post_thumbnail( 'editorial-single-large' ); ?></figure> </a> </div> <?php } ?> <div class="archive-desc-wrapper clearfix"> <header class="entry-header"> <?php do_action( 'editorial_post_categories' ); if ( is_single() ) { the_title( '<h1 class="entry-title">', '</h1>' ); } else { the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); } ?> </header><!-- .entry-header --> <div class="entry-content"> <?php the_excerpt(); ?> </div><!-- .entry-content --> <footer class="entry-footer"> <div class="entry-meta"> <?php editorial_posted_on(); ?> <?php editorial_post_comment(); ?> </div><!-- .entry-meta --> <?php editorial_entry_footer(); ?> </footer><!-- .entry-footer --> </div><!-- .archive-desc-wrapper --> </article><!-- #post-## -->
ПОМОГИТЕ, ДАННЫЙ КОД НЕМНОГО НЕ СОВПАДАЕТ С ОПИСАНИЕМ. ПРИШЛИТЕ ГОТОВЫЙ КОД..
<?php if( has_post_thumbnail() and !is_single() ) { ?> <div class="post-image"> <a href="<?php the_permalink();?>" title="<?php the_title();?>"> <figure><?php the_post_thumbnail( 'editorial-single-large' ); ?></figure> </a> </div> <?php } ?>
ЧТО С ЭТИМ КУСОЧКОМ НУЖНО СДЕЛАТЬ? ПОМОГИТЕ ЯСНЕЕ ПОЖАЛУЙСТА(((
вы привели кусок кода выше — я вам привел кусок кода, которым вы должны заменить свой. то есть надо поменять код:
<?php if( has_post_thumbnail() ) { ?> <div class="post-image"> <a href="<?php the_permalink();?>" title="<?php the_title();?>"> <figure><?php the_post_thumbnail( 'editorial-single-large' ); ?></figure> </a> </div> <?php } ?>
на
<?php if( has_post_thumbnail() and !is_single() ) { ?> <div class="post-image"> <a href="<?php the_permalink();?>" title="<?php the_title();?>"> <figure><?php the_post_thumbnail( 'editorial-single-large' ); ?></figure> </a> </div> <?php } ?>
а если еще точнее, то только одну строчку:
<?php if( has_post_thumbnail() ) { ?>
на
<?php if( has_post_thumbnail() and !is_single() ) { ?>
все абсолютно так, как описано в статье.
А ПО ТАКОМУ ПРИНЦИПУ ЧТО ВЫ ОБЪЯСНИЛИ, НУЖНО БУДЕТ УДАЛЯТЬ СТИЛИ ?
НЕ ПОМОГЛО, ВАШЕ ПРЕДЛОЖЕНИЕ(((
быть того не может.
@ivan2017, не пишите пожалуйста капсом, это никак не поможет решить вашу проблему.
внешний вид — редактор — content-single.php (template-parts/content-single.php)
находим это
<div class="single-post-image"> <figure><?php the_post_thumbnail( 'editorial-single-large' ); ?></figure> </div><!-- .single-post-image -->
и вырезаем из него вот это
<figure><?php the_post_thumbnail( 'editorial-single-large' ); ?></figure>
вырезать плохая идея — тогда и на главной с рубриками миниатюра пропадет.
можно я вам напишу данные от черновика, и вы сами так сделаете как советуете? и посмотрите что это не помогает,…
- Тема «как убрать миниатюру в полной странице (записи).?» закрыта для новых ответов.