I”m trying to filter an archive page by custom meta query.
I’ve tried using query_posts($args)
prior to the loop, but it returns nothing.
Any ideas?
Here’s what I have so far:
<?php
//$wolfName = $_GET['wolfName'];
$archiveArgs = array(
'meta_key' => 'wolf',
'meta_value' => 'boltz'
);
query_posts($archiveArgs);
?>
<?php if (have_posts()) : ?>
It returns no posts… any ideas?
Use
pre_get_posts
action hookthanks for ur code Strik3r ..this helped me a lot..I finally got sorting by custom field to work…in functions.php