I am using the following piece of code in wordpress to retrieve the name of the categorys however it is capitalising the category names.
<?php foreach ($categories as $category):?>
<button data-filter=".<?php echo $category->name;?>">Button</button>
<?php endforeach; ?>
The output I am getting is be this
<button data-filter=".Category">Button</button>
But I need it to output as
<button data-filter=".category">Button</button>
Thanks and hopefully I find a solution.
This should work:
strtolower()
is a php function that