php - Wordpress Post's Category Name without capitalisation -


I am using the following code in WordPress to retrieve the names of the squares, although this is the name of the class Is capitalizing. / P>

  & lt ?? Php foreach ($ categories as category $):? & Gt; & Lt; Button Data-Filters = ". & Lt ;? Php $ echo $ class-> Name;; & gt; & Gt; Button & lt; / Button & gt; & Lt ;? Php endforeach; ? & Gt;  

The output I am getting is

  & lt; Button Data-Filter = ". Category" & gt; Button & lt; / Button & gt;  

but I need it

  & lt; Button Data-Filter = ". Category" & gt; Button & lt; / Button & gt;  

Thank you and hopefully I'm getting the solution.

This should work:

  & lt ;? Php foreach ($ Category as Category $):? & Gt; & Lt; Button data-filter = ".. & Lt ;? php echo strtoolier ($ category-> name) ;? gt; & Gt; Button & lt; / Button & gt; & Lt ;? Php endforeach; ? & Gt;  

strtolower () is a php function

Returns the string with all the alphabet characters converted to lowercase.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -