Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other WordPress Exclude Category (not working?) Re: WordPress Exclude Category (not working?)

#120410
Minnow990
Member

That’s because what I posted was the original code. I’ve tried adding in the exclusion for the category, but the result is the same. It’s like wordpress is ignoring the argument for excluding the category. I updated my code and if you look at the site now, you’ll still find items in the “more products” section that are plain. (Refresh a few times and you’ll eventually find the word “plain” in at least one of the products)

This is my code for that part now:

$args = array( ‘orderby’ => ‘rand’, ‘post_type’ => ‘product’, ‘posts_per_page’ => $settings, ‘cat’ => ‘-234’ );