-5
<? php post_class('col-md-4 col-md-6 grid grid_2_column grid_3_column'); ?> 

i have this code in wordpress them I don't know how this function works and what it is doing please explain what this function is doing, so i can modify it according to me needs.

Asad Khan
  • 1
  • 1
  • Have you tried googling it? It is probably in the wordpress documentation – rosengrenen Aug 18 '16 at 00:23
  • yes, it is probably in the docs. Yet if you are going to ask on Stack Overflow, you need to include the code you are asking about instead of expecting others either already know what it looks like, or googling online and hunt it down so that they can help you. – HolyMoly Aug 18 '16 at 00:31
  • @RasmusRosengren yes, but I understand nothing from documentation – Asad Khan Aug 18 '16 at 00:31
  • @HolyMoly I have added the code that i need to understand – Asad Khan Aug 18 '16 at 00:33
  • from the docs: `it will print out and add various post-related classes to the div tag` so what it is doing is adding those classes you see to div that the post lives inside. if it is inside a loop, it is adding it to each post – HolyMoly Aug 18 '16 at 00:36
  • in this case, it is using bootstrap classes. if you want to change it just change it, however make a backup of the original code so that if you mess up you can restore it - or create a child theme. – HolyMoly Aug 18 '16 at 00:39

1 Answers1

0

post_class() function is used to print out default post-related classes to the div tag and you can add various finer CSS classes for their post styling.

In your example, you are adding various classes for your post styling.

A Wahab
  • 41
  • 1
  • 8