How to get image data according to Post ID in WordPress
How to get image data according to page id in WordPress:-
Get the image data in Page according to ID .
Use the following Code:-
<?php
query_posts();
while (have_posts()) : the_post();
$featuredImage = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); ?>
<div style="background:url(<?php echo $featuredImage; ?>) no-repeat;">Background Image</div>
<?php endwhile; wp_reset_query(); ?>
Enjoy the content.
Related posts:-
Total Page Visits: 5376 - Today Page Visits: 1