Roger
Roger

Reputation: 597

Add multiple classes name to post thumbnail in 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.

Upvotes: 3

Views: 2312

Answers (1)

user8230352
user8230352

Reputation: 1783

You could try it simply like this:

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

Upvotes: 6

Related Questions