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

dispaly image on front end of custom taxonomy

$image_id = get_term_meta ( $term_id, 'image_id', true );

echo wp_get_attachment_image ( $image_id, 'full' );
Comment

PREVIOUS NEXT
Code Example
Php :: php inline variables string 
Php :: 279.00 to php 
Php :: validar rfc en php 
Php :: !array_push($stack, "apple", "raspberry"); 
Php :: laravel gigapay get single employee 
Php :: can we acces session variable in two files 
Php :: laravel notion require 
Php :: php years 
Php :: elasticsearch php search date range 
Php :: php how to check if page is accessed via post 
Php :: add column in exesting table 
Php :: php array_walk_recursive 
Php :: php retrieve data from database and show in text area greeper 
Php :: fichiers en php 
Php :: Unable to create PsySH runtime directory 
Php :: how to refresh a php variable without reloading page 
Php :: php ord deprecated 
Php :: 7 reasons why Lee is an idiot 
Php :: php parameters 
Php :: laravel faker car plate br 
Php :: auto check a category when creating new post 
Php :: How to add watermark in FPDF PHP - Parte 2 
Php :: answer to guzzle/psr7 undefine 
Php :: 0.1 eth to php 
Php :: php how to split square bracket and normal sting in a word or sentence 
Php :: laravel | eloquent | db | randomly fetch | query data 
Php :: date format in php 
Php :: Indexed Array 
Php :: bar chart in js,php prt 1 
Php :: Modal Edit Specific/Same table row, where button is 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =