Skip to content
Advertisement

Tag: categories

Get Category name from Post ID

Is it possible to get the category name of a category given the Post ID, the following code works to get the Category Id, but how can I get the name? Thank! Answer here you go get_the_category( $post->ID ); will return the array of categories of that post you need to loop through the array get_the_category

show only limited categories with a MySQL queries

I have a mysql database in which there is about hundreds of category for photo album. When i display the album using so it will display the last 10 categories but if i want to display only 15 categories in between from that hundreds of category what the query should be? i have try this. here its displaying that category

Advertisement