Search
 
SCRIPT & CODE EXAMPLE
 

PHP

woocommerce get product category name by id

$id = 42;
if( $term = get_term_by( 'id', $id, 'product_cat' ) ){
    echo $term->name;
}
Comment

wordpress get product category name by termid

// Testing that $_GET['product-cato'] has been requested and that the product category exists.
if( isset( $_GET['product-cato'] ) && term_exists( intval($_GET['product-cato']), 'product_cat' ) ){
    // Get the corresponding WP_Term object
    $term = get_term( intval($_GET['product-cato']), 'product_cat' );
    //Display the term name for the product category
    echo '<p>' . $term->name . '</p>';
}
Comment

PREVIOUS NEXT
Code Example
Php :: custom autoload without composer php psr4 
Php :: laravel echo html 
Php :: laravel database seeder 
Php :: laravel model withCount relationship condition 
Php :: php new PDO timeout 
Php :: php timeout 
Php :: a php session was created by a session_start() 
Php :: laravel model wherein 
Php :: get curl httcode php 
Php :: insertion sort in php 
Php :: php artisan tinker encryption cmd 
Php :: php assign if not null 
Php :: composer dump autoload laravel 
Php :: parsing html in php 
Php :: declare variable in php class 
Php :: get joomla group ids 
Php :: php require 
Php :: php append n time pattern to string 
Php :: php array access by key 
Php :: Notice: Array to string conversion php 
Php :: Session/Session.php error codeigniter 3 
Php :: php webpage to string 
Php :: laravel create session table 
Php :: symfony messenger transport 
Php :: get date to current week last or first day dates 
Php :: IlluminateContractsContainerBindingResolutionException 
Php :: laravel select 
Php :: PHP | Send Attachment With Email 
Php :: php Program to check if a given year is leap year 
Php :: remove blank data in multidimention array in laravel 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =