Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add multiple classes name to post thumbnail in Wordpress

Tags:

php

wordpress

this is a wordpress problem. I know I can add a class to a wordpress featured image via this:

<?php the_post_thumbnail('post-thumbnail', ['class' => 'img-responsive']); ?>

However how do I add multiple? I tried using an array but it just displays array in inspecter and I am not sure if it worked. Please help. Thanks.

like image 294
Roger Avatar asked Nov 02 '25 00:11

Roger


1 Answers

You could try it simply like this:

<?php the_post_thumbnail('post-thumbnail', ['class' => 'img-responsive my-other-class']); ?>
like image 83
user8230352 Avatar answered Nov 03 '25 14:11

user8230352