How to Add Class to WordPress Post Thumbnail

Mahabubur Rahman
1
To design the output by css class is very useful.  So when you want to design wordpress post thumbnil you have to add class to the post thumbnil. So you can add class to post thumbnil as below.
<?php the_post_thumbnail('post-thumbnail', ['class' => 'CLASS_NAME']); ?>
OR
<?php
the_post_thumbnail( 'thumbnail', array( 'class'=> 'CLASS_NAME') );
?>
Tags

Post a Comment

1Comments
  1. "In this guide, we tell the best way to physically move a current WordPress site to an alternate space name.
    Stage 1 - Verify that your present site is working
    Stage 2 - Download the documents of your site
    Stage 3 - Export your data set
    Stage 4 - Upload documents to your new space
    Stage 5 - Import your data set
    Stage 6 - Go to wp_options
    Stage 7 - Update siteurl and home
    Stage 8 - Update association subtleties in wp-config
    Stage 9 - Check your site on your new space
    Stage 10 - Fix permalinks (Optional)
    Stage 11 - Fix broken pictures (Optional)
    Stage 12 - Check your site once more (Optional)
    for more information click here: HOW TO MOVE WORDPRESS SITE TO THE NEW DOMAIN

    ReplyDelete
Post a Comment