Hello.
I am very new to WordPress so be easy on me.
I am using the JigoShop e-commerce plugin (which I think is irrelevant to this issue but I thought I should mention it).
My posts, show each of the products on my site. Each post has some additional meta properties one of which is the stock level 'stock.
What I want to do is to modify my post loop so that it only shows items with sock.
I started off with (basically) this:
if (have_posts()) : while (have_posts()) : the_post();
$stockLevel = get_post_meta($post->ID, 'stock', true);
if ($stockLevel > 0)
{
...display post
}
endwhile; else :
Now this sort of works as it shows only my posts that have a stock level > 0, but this means I don't get a full list of items. For instance, if I have it set up to show 10 items per page and 9 have 0 stock, then I will only but showing 1 item on this page.
So the real question is, how do I wrap the meta property stock check up in a query that I can then display posts from?
Many thanks.