/* 
Theme Name: Custom Gaskets LTD. Child-Theme
Theme URI: https://github.com/elementor/hello-theme-child/
Description: Hello Elementor Child is a child theme of Hello Elementor, created by Elementor team
Author: Elementor Team
Author URI: https://elementor.com/
Template: hello-elementor
Version: 2.0.0
Text Domain: hello-elementor-child
License: GNU General Public License v3 or later.
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Tags: flexible-header, custom-colors, custom-menu, custom-logo, editor-style, featured-images, rtl-language-support, threaded-comments, translation-ready
*/

/* Add your custom styles here */

/**
Adding file size Column to Media Library
 **/

add_filter( 'manage_upload_columns', 'wpse_237131_add_column_file_size' );
add_action( 'manage_media_custom_column', 'wpse_237131_column_file_size', 10, 2 );

function wpse_237131_add_column_file_size( $columns ) { // Create the column
    $columns['filesize'] = 'File Size';
    return $columns;
}
function wpse_237131_column_file_size( $column_name, $media_item ) { // Display the file size
    if ( 'filesize' != $column_name || !wp_attachment_is_image( $media_item ) ) {
      return;
    }
    $filesize = filesize( get_attached_file( $media_item ) );
    $filesize = size_format($filesize, 2);
    echo $filesize;
}

/**
Adding Temperature Range and Product Child-Category to Product-Grid-pages
 **/
add_action('woocommerce_shop_loop_item_title', 'display_attributes_after_product_loop_title', 10);

function display_attributes_after_product_loop_title()
{
  global $product;
  $range = $product->get_attribute('pa_temperature-range');

if(!empty($range)){
    display : none ;
	
if(isset($range)){
    echo '<div><p style="font-size:12px">Temperature '. $range . '</p></div>';
 }
}
}