Поддержка Проблемы и решения Как добавить в темплат парт

  • что бы в постах которые отображаются на главной странице были изображения маленькие как сделать:?

    <?php
    /**
     * Template part for displaying results in search pages
     *
     * @link https://codex.wordpress.org/Template_Hierarchy
     *
     * @package msh
     */
    
    ?>
    
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <header class="entry-header">
    <?php if ( 'post' === get_post_type() ) : ?>
    		<div class="entry-meta">
    			 <?php the_time('j F Y'); ?>
    		</div><!-- .entry-meta -->
    		<?php endif; ?>
        <h4 class="entry-title"><a>" rel="bookmark">
    		<?php echo mb_substr(get_the_title(), 0, 50); ?>
        </a></h4>
    
    		
    	</header><!-- .entry-header -->
    
    	
    
    </article><!-- #post-## -->
    • Тема изменена 6 лет, 6 месяцев назад пользователем SeVlad. Причина: Оформляйте, пож, код как следует
Просмотр 2 ответов — с 1 по 2 (всего 2)
  • Модератор Denis Yanchevskiy

    (@denisco)

    WordPress-разработчик, denisco.pro

    Добавить the_post_thumbnail?

    the_post_thumbnail( 'thumbnail' );     // Thumbnail (150 x 150 hard cropped)
    the_post_thumbnail( 'medium' );        // Medium resolution (300 x 300 max height 300px)
    the_post_thumbnail( 'medium_large' );  // Medium Large (added in WP 4.4) resolution (768 x 0 infinite height)
    the_post_thumbnail( 'large' );         // Large resolution (1024 x 1024 max height 1024px)
    the_post_thumbnail( 'full' );          // Full resolution (original size uploaded)

    Thank you !

Просмотр 2 ответов — с 1 по 2 (всего 2)
  • Тема «Как добавить в темплат парт» закрыта для новых ответов.