Search
 
SCRIPT & CODE EXAMPLE
 

PHP

wp php category page count products

<h1><?php woocommerce_page_title(); 



global $wp_query;
// get the query object
$cat_obj = $wp_query->get_queried_object();


if($cat_obj)    {
    $category_name = $cat_obj->name;
    $category_desc = $cat_obj->description;
    $category_ID  = $cat_obj->term_id;
}


$term = get_term( $category_ID, 'product_cat' ); 
echo '('. $term->count . ')';


?>      
        </h1>
Comment

PREVIOUS NEXT
Code Example
Php :: laravel response json status 500 
Php :: how to write orderby in join query with where clause in codeigniter 
Php :: laravel local scope 
Php :: parsing html in php 
Php :: compact example in php 
Php :: maatwebsite/excel package 5.2 laravel 
Php :: php url parameters 
Php :: The media must not be greater than 12288 kilobytes in laravel 
Php :: update column type laravel migration 
Php :: php array_push in foreach duplicate 
Php :: setcookie in php 
Php :: woocommerce product hooks 
Php :: laravel trim string blade 
Php :: cut the first character in php 
Php :: the uploaded file exceeds the upload_max_filesize directive in php.ini. wordpress 
Php :: job with queue name 
Php :: codeigniter how to know update failed 
Php :: integrate fontawesome in blade laravel 
Php :: php dirpath multiple file extensions 
Php :: convert array to IlluminateHttpRequest 
Php :: picture on picture php 
Php :: IlluminateContractsContainerBindingResolutionException 
Php :: php combine 2 arrays keep duplicates 
Php :: session forget laravel 
Php :: php regex format number with commas and decimal 
Php :: PHP array_merge() Function 
Php :: two column date compare in php 
Php :: php get user county 
Php :: laravel permission 
Php :: php date 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =