How To Get The Custom Post Type Image URL in Wordpress
How To Get The Custom Post Type Image URL in Wordpress
<?php
$catquery = new WP_Query( 'posts_per_page=8&post_type=homepageimages' );
while($catquery->have_posts()) : $catquery->the_post();
$url = wp_get_attachment_url( get_post_thumbnail_id($post->ID, 'thumbnail') );
?>
<li>
<a href="<?php echo post_permalink($post->ID); ?> "><img src="<?php echo $url; ?>" alt="Banners" class="panelImg" data-src-active="/data/text/promos/banners-vertical.jpg"></a>
<?php
the_content();
?>
</li>
<?php endwhile; ?>
How To Get The Custom Post Type Image URL in Wordpress
<?php
$catquery = new WP_Query( 'posts_per_page=8&post_type=homepageimages' );
while($catquery->have_posts()) : $catquery->the_post();
$url = wp_get_attachment_url( get_post_thumbnail_id($post->ID, 'thumbnail') );
?>
<li>
<a href="<?php echo post_permalink($post->ID); ?> "><img src="<?php echo $url; ?>" alt="Banners" class="panelImg" data-src-active="/data/text/promos/banners-vertical.jpg"></a>
<?php
the_content();
?>
</li>
<?php endwhile; ?>