wordpresswordpress-featured-image

How to dynamically add feature image wordpress


I have many post posts in my WordPress but i need to add dynamically feature images to all of them through SQL

i tried searching in the SQL but no luck where is the feature image row


Solution

  • we can get feature image url dynamically by:

    $img= wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ),'full');
    <?php echo $img[0]; ?>
    

    here full is the image size you can change to any sez that is given by WP