Search
 
SCRIPT & CODE EXAMPLE
 

PHP

wc get product image

<?php global $product; ?>
<img src="<?php echo wp_get_attachment_url( $product->get_image_id() ); ?>" />
Comment

wc get product category image

    <?php
        if ( is_product_category() ){

            global $wp_query;
            $cat = $wp_query->get_queried_object();    
            $thumbnail_id = get_woocommerce_term_meta( $cat->term_id, 'thumbnail_id', true ); 
            $image = wp_get_attachment_url( $thumbnail_id ); 
            echo "<img src='{$image}' alt='' />";
        }
    ?>
Comment

PREVIOUS NEXT
Code Example
Php :: how to get ip address of client using php 
Php :: wordpress get domain 
Php :: header cros orgin using php 
Php :: : Unable to locate package php7.4-fpm 
Php :: wp is user admin 
Php :: how to install php curl (linux) apache2 
Php :: php storage link 
Php :: laravel print executed query 
Php :: Call to undefined method JeroenNotenLaravelAdminLteHelpersMenuItemHelper::isSearchBar( 
Php :: install php-mbstring in ubuntu 
Php :: php store object in session 
Php :: BCMath PHP Extension 
Php :: storage image not showing in laravel 
Php :: php error reporting all 
Php :: how to make validate error when password doesnt match with password confirm laravel 
Php :: wordpress if thumbnail show else 
Php :: php check how much time each instruction takes to complete 
Php :: array to string php 
Php :: php unset session variable 
Php :: laravel pagination bootstrap 5 
Php :: php ucfirst all words 
Php :: link acf 
Php :: +1 month php 
Php :: php go to another page 
Php :: php remove quotes 
Php :: wordpress if admin 
Php :: php time limit 
Php :: get last 30 days records in laravel 
Php :: laravel doesNotHave in model 
Php :: how to open server in php 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =