• Resolved Erfan MHDi

    (@erfanmhd)


    hi,

    i’m trying to exclude Bundle Products from archive page.
    this is my code so far :

    $MusicAlbumArg = array ( 
        'post_type' => 'download',
        'showposts' => -1,
        'meta_query' => array(
           array(
    			'key' 	=> '_edd_product_type',
    			'value' => 'bundle',
    			'compare' => '!='
    		),
        ),
        'tax_query' => array(
            array(
                'taxonomy' => 'download_artist',
                'terms' => '"'.get_the_ID().'"',
                'field' => 'term_id',                
                'compare' => "="
            ),
        ),
    
    );

    but this returns nothing, although if i Change 'compare' => '!=' to 'compare' => '=' i can see a list of ONLY Bundle Products.
    how can i make the reverse way works too ?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @erfanmhd

    Please try this meta query,

    'meta_query' => array(
           array(
    		'key' 	=> '_edd_product_type',
    		'value' => 'bundle',
    		'compare' => 'NOT EXISTS'
    	),
    ),

    Also please confirm your taxonomy query parameters also.

    Thread Starter Erfan MHDi

    (@erfanmhd)

    Hi @pratik-jain,

    'compare' => 'NOT EXISTS' was the key i was trying something like 'compare' => '!='

    Thank you so much!

    Thread Starter Erfan MHDi

    (@erfanmhd)

    if you have a donate link i’ll be more than happy to buy you a Coffee my friend 😉

    Hi @erfanmhd

    Glad to know that your problem is solved.

    I am not sure that I can provide the donate link over here or not but best part is I was able to solve your problem 🙂

    Thread Starter Erfan MHDi

    (@erfanmhd)

    hi @pratik-jain,

    yes you are right, the best part is “YOU HELPED ME” fix the problem,
    so i’ll be more than happy to donate you as a sign of appreciation of your time and answer.

    just please drop an email to me: ErfanMHD@me.com
    or give me your email address so i can contact you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Querying Only Single Downloads’ is closed to new replies.