Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

Markgoessens on "Exclude meta_key from wp_query"

$
0
0

Hi everybody,

I'm struggling for hours now with the following problem. What I'm trying to do is 'exclude reduced items from a wp-query array'

This is the code I allready have:

echo View::render('page-home.twig', array(
 'wp_query' => $wp_query,
 'posts' => aviators_properties_get_most_recent(4),
 'meta_key' => '_property_reduced',
 'meta_compare' => '!=',
 'meta_value' => true
   )
);

I know that the meta_key and meta_value is right. The first three lines is a part of the template which I use. So this is right too. But I'm not sure about the rest.

I tried several alternatives like: meta_compare IN / NOT IN / EXISTS / NOT EXISTS / = / LIKE

I also tried to put the meta things in an extra array. Like this:

echo View::render('page-home.twig', array(
 'wp_query' => $wp_query,
 'posts' => aviators_properties_get_most_recent(4),
 'meta_query' => array(
        array(
        'meta_key' => '_property_reduced',
        'meta_compare' => '!=',
        'meta_value' => true
    )
   )
  )
);

All of this doesn't work. Nothing changes at all.

The page where I'm working on is:http://www.theoquaedackers.nl/test At the bottom of this page you see 'recent toegevoegd' In this array I want to exclude reduced items.

Does anyone know what I'm doing wrong?

Greets Mark


Viewing all articles
Browse latest Browse all 8245

Trending Articles