There is a Portfolio page; you need to display the first image from the Project_page page (the Portfolio is the parent page for the Project_page). The text turns out to get, but with the image or how.

<?php // параметры по умолчанию $posts = get_posts( array( 'numberposts' => 10, // 'category' => 8, 'post_parent' => "14", 'orderby' => 'date', 'order' => 'DESC', 'include' => array(), 'exclude' => array(), 'meta_key' => '', 'meta_value' =>'', // 'post_type' => 'post', 'post_type' => 'page', 'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса ) ); foreach( $posts as $post ){ setup_postdata($post); $img_url = wp_get_attachment_image_url($post->ID, full); ?> <div class="row mix portfolio_item"> <div class="col-12 col-sm-6"> <div class="portfolio_discription"> <h2><?php the_title(); ?></h2> <?php the_excerpt(); ?> <a href="<?php the_permalink(); ?>">Смотреть весь проект</a> </div> </div> <div class="col-12 col-sm-6"> <div class="portfolio_title_img"> <!-- <?php the_post_thumbnail(); ?> --> <img src="<?php echo $img_url; ?>" alt=""/> </div> </div> </div> <?php } wp_reset_postdata(); // сброс?> 
  • Where do you define the variable `$ img_url`? If it is not defined, then it is empty, and you are most likely trying to bring it to the screen "empty." Try uncommenting the line <?php the_post_thumbnail(); ?> <?php the_post_thumbnail(); ?> , then you should display a thumbnail of the post. - Nik Horse

0