Removed need to mandatory exclude meta
This commit is contained in:
parent
ef0ce00090
commit
7675fd7ab1
|
@ -17,21 +17,16 @@ global $post, $woocommerce;
|
||||||
'post__not_in' => array($thumb_id),
|
'post__not_in' => array($thumb_id),
|
||||||
'post_mime_type'=> 'image',
|
'post_mime_type'=> 'image',
|
||||||
'orderby' => 'menu_order',
|
'orderby' => 'menu_order',
|
||||||
'order' => 'ASC',
|
'order' => 'ASC'
|
||||||
'meta_query' => array(
|
|
||||||
array(
|
|
||||||
'key' => '_woocommerce_exclude_image',
|
|
||||||
'value' => '1',
|
|
||||||
'compare' => '!='
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
$attachments = get_posts($args);
|
$attachments = get_posts($args);
|
||||||
if ($attachments) :
|
if ($attachments) :
|
||||||
$loop = 0;
|
$loop = 0;
|
||||||
$columns = apply_filters('woocommerce_product_thumbnails_columns', 3);
|
$columns = apply_filters('woocommerce_product_thumbnails_columns', 3);
|
||||||
foreach ( $attachments as $attachment ) :
|
foreach ( $attachments as $attachment ) :
|
||||||
|
|
||||||
|
if (get_post_meta($attachment->ID, '_woocommerce_exclude_image', true)==1) continue;
|
||||||
|
|
||||||
$loop++;
|
$loop++;
|
||||||
|
|
||||||
$_post = & get_post( $attachment->ID );
|
$_post = & get_post( $attachment->ID );
|
||||||
|
|
Loading…
Reference in New Issue