<?php
//Вывод записей
$args = array(
'post_type' => 'slider',
'posts_per_page' => -1
);
$slider = new WP_Query( $args );
?>
<?php if( $slider->have_posts() ) : while ( $slider->have_posts() ) : $slider->the_post(); ?>
<!-- Записи -->
<div id="slider" class="owl-carousel owl-theme">
<div >
<img src="<?php $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large' ); echo $large_image_url[0]; ?>" alt="<?php the_title(); ?>">
</div>
<div>
<img src="<?php $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large' ); echo $large_image_url[0]; ?>" alt="<?php the_title(); ?>">
</div>
<div>
<img src="<?php $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large' ); echo $large_image_url[0]; ?>" alt="<?php the_title(); ?>">
</div>
<div>
<img src="<?php $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large' ); echo $large_image_url[0]; ?>" alt="<?php the_title(); ?>">
</div>
</div>
<?php endwhile; else: ?>
<h3>Картинок нет</h3>
<?php endif; ?>
<img src="<?php $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large' ); echo $large_image_url[0]; ?>" alt="<?php the_title(); ?>">
<img src="<?php bloginfo('template_directory'); ?>/assets/img/slider/pic1.jpg">
<img src="<?php bloginfo('template_directory'); ?>/assets/img/slider/pic2.jpg">
<img src="<?php bloginfo('template_directory'); ?>/assets/img/slider/pic3.jpg">
<?php
// Получение записей
$args = array(
'post_type' => 'slider',
'posts_per_page' => -1
);
$slider = new WP_Query( $args );
// Вывод результатов
if( $slider->have_posts() ) :
?>
<!-- Записи -->
<div id="slider" class="owl-carousel owl-theme">
<?php
// Цикл!
while ( $slider->have_posts() ) : $slider->the_post();
?>
<div>
<img src="<?php the_post_thumbnail_url( 'medium' ); ?>" alt="<?php the_title(); ?>">
</div>
<?php
// Конец цикла
endwhile;
?>
</div>
<!-- Записи закончились -->
<?php
// Если записи не были обнаружены
else:
?>
<h3>Картинок нет</h3>
<?php endif; ?>