Skip to content

Instantly share code, notes, and snippets.

@ivandoric
Created April 23, 2014 13:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivandoric/11215753 to your computer and use it in GitHub Desktop.
Save ivandoric/11215753 to your computer and use it in GitHub Desktop.
wordpress: Filter posts by comparing meta value
<?php
$trenutnovrijeme = strtotime('now');
query_posts( array(
'post_type' => 'javna-nadmetanja',
'orderby' => 'wpcf-datum-objave',
'meta_key' =>'wpcf-datum-zatvaranja',
'meta_compare'=>'>' ,
'meta_value' => $trenutnovrijeme,
'order' => DESC,
'showposts' => 10,
'paged' => get_query_var('paged') ) ); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment