I have these requirements:
If the child page has
featured_product
and the value equals to1
then it's featured. This works.If the child page has
featured_product
and the value does not equal to1
, or if it doesn't even have the fieldfeatured_product
then it's not featured product. This doesn't work at the moment.
For featured products (it works):
<?php
query_posts(
array(
'showposts' => -1,
'post_parent' => $post->ID,
'post_type' => 'page',
'orderby' => 'title',
'order' => 'ASC',
'meta_key' => 'featured_product',
'meta_value' => 1
)
);
?>
For normal product (it doesn't work):
<?php
query_posts(
array(
'showposts' => -1,
'post_parent' => $post->ID,
'post_type' => 'page',
'orderby' => 'title',
'order' => 'ASC',
'meta_key' => 'featured_product',
'meta_compare' => '!=',
'meta_value' => 1
)
);
?>