Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Display the image on the front end from category taxonomy

// Get the current category ID, e.g. if we're on a category archive page
$category = get_category( get_query_var( 'cat' ) );
 $cat_id = $category->cat_ID;
// Get the image ID for the category
$image_id = get_term_meta ( $cat_id, 'category-image-id', true );
// Echo the image
echo wp_get_attachment_image ( $image_id, 'large' );

$image_id = get_term_meta ( $cat->term_id, 'author-taxonomy-image-id', true ); 
                          echo wp_get_attachment_image ( $image_id, 'thumbnail' ); ?>
Comment

PREVIOUS NEXT
Code Example
Php :: laravel loop iteration 
Php :: write test case in react native 
Php :: Update Query in Codeigniter Using Multiple Where Condition 
Php :: laravel where multiple values 
Php :: laravel 7 eloquent on delete set null schema 
Php :: php encrypt decrypt url parameters 
Php :: laravel return view in web.php 
Php :: how to start composer in laravel project on localhost 
Php :: run a php project 
Php :: laravel without global scopes 
Php :: laravel json response 
Php :: laravel invoice number generator 
Php :: php preg match space or start of string 
Php :: Day of Week Using carbon library 
Php :: codeigniter form validation datetime 
Php :: laravel return view with multiple variable 
Php :: SPA and keep some of the Laravel pages you need to have a route like this 
Php :: how to get public folder path in laravel 
Php :: random element in faker 
Php :: prevent SQL injection in PHP? 
Php :: magento 2.3 check if customer is logged in 
Php :: php random 
Php :: smarty foreach 
Php :: php multi condition if 
Php :: return two variables php 
Php :: yesterday php 
Php :: laravel query order by relation 
Php :: Laravel - Query Builder Raw Query selectRaw 
Php :: laravel drop table migration 
Php :: admin-ajax.php 400 (bad request) 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =