Server IP : 15.235.198.142 / Your IP : 216.73.216.114 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ballsack 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/craft/wp-content/themes/oceanwp/woocommerce/loop/thumbnail/ |
Upload File : |
<?php /** * Image Swap style thumbnail * * @package OceanWP WordPress theme */ // Exit if accessed directly. if ( ! defined( 'ABSPATH' ) ) { exit; } // Return placeholder if there isn't a thumbnail defined. if ( ! has_post_thumbnail() ) { oceanwp_woo_placeholder_img(); return; } // Get global product data. global $product; // Get links conditional mod. $ocean_woo_disable_links = get_theme_mod( 'ocean_shop_woo_disable_links', false ); $ocean_woo_disable_links_cond = get_theme_mod( 'ocean_shop_woo_disable_links_cond', 'no' ); $disable_links = ''; $disable_links = ( true === $ocean_woo_disable_links && 'yes' === $ocean_woo_disable_links_cond ); // Get featured image. $attachment = $product->get_image_id(); // Image args. $img_args = array( 'class' => 'woo-entry-image-main', 'alt' => get_the_title(), ); if ( oceanwp_get_schema_markup( 'image' ) ) { $img_args['itemprop'] = 'image'; } // Define filter for thumbnail size. $image_size = apply_filters( 'oceanwp_woo_thumbnail_size', 'woocommerce_thumbnail' ); // Display featured image if defined. if ( $attachment ) { ?> <div class="woo-entry-image clr"> <?php do_action( 'ocean_before_product_entry_image' ); if ( false === $ocean_woo_disable_links || ( $disable_links && is_user_logged_in() ) ) { ocean_woo_img_link_open(); // Single Image. echo wp_get_attachment_image( $attachment, $image_size, '', $img_args ); ocean_woo_img_link_close(); } else { // Single Image. echo wp_get_attachment_image( $attachment, $image_size, '', $img_args ); } do_action( 'ocean_after_product_entry_image' ); ?> </div><!-- .woo-entry-image --> <?php } else { // Display placeholder. ?> <div class="woo-entry-image clr"> <?php do_action( 'ocean_before_product_entry_image' ); if ( false === $ocean_woo_disable_links || ( $disable_links && is_user_logged_in() ) ) { ocean_woo_img_link_open(); echo '<img src="' . esc_url( wc_placeholder_img_src() ) . '" alt="' . esc_html__( 'Placeholder Image', 'oceanwp' ) . '" class="woo-entry-image-main" />'; ocean_woo_img_link_close(); } else { echo '<img src="' . esc_url( wc_placeholder_img_src() ) . '" alt="' . esc_html__( 'Placeholder Image', 'oceanwp' ) . '" class="woo-entry-image-main" />'; } do_action( 'ocean_after_product_entry_image' ); ?> </div><!-- .woo-entry-image --> <?php } ?>