Answers for "php find wordpres category id by slug"

PHP
0

wp get post id by slug

url_to_postid( site_url('the_slug') );
Posted by: Guest on June-29-2021
-2

wp get category by id

<?php
$category_id = 21; //use your own category id
$category = get_category( $category_id );
echo $category->name;
echo $category->cat_ID;
//print_r($category);
//to get all the properties of the $category
?>
Posted by: Guest on July-24-2021

Code answers related to "php find wordpres category id by slug"

Browse Popular Code Answers by Language