How to add Array in called function

In this article you will know to add array in function, When you use any function on index.php, single.php or any where and you want to add some attributes in array, So you can easily add array in function.

How to Do

  • Open your php file.
  • Find out <?php the_post_thumbnail(); ?> .
  • Then add array in function.

My Website’s code for better explanation.

<?php the_post_thumbnail( 'small-thumbnail',
array(
'title' => get_the_title(),
'alt' => esc_html ( get_the_title() )
)
);
?>

If you want to more useful code, So contact us. Thanks for visiting.