Howdy, I hope someone will see this and possibly know a solution to what I’m trying to do…
So, I’m trying to pull a custom field and setting the result as $sortingTag I’m then trying to query_posts looking in a particular category and by a certain tag.
Here is the code I’m using:
<?php if ( (is_page('web')) or (is_page('print')) or (is_page('identity')) ) {
$sortingTag = get_post_meta($post->ID, 'sorting-tag', true);
query_posts(array(
'cat'=>17,
'showposts'=>15,
'tag'=>"$sortingTag",
));
?>
Here is how I’m trying to implement it:
I’ve set up child pages ‘web’, ‘identity’, & ‘print’ under the parent ‘Portfolio’. On each page I’ve set a custom field with the key ‘sorting-tag’ with it’s respective page name (i.e. web for web).
And I’m using posts to hold my portfolio pieces, depending on the project each could have one or more of the tags ‘web’, ‘identity’, or ‘print’ (spelled the same, with same case).
Now my problem, I figure I’d be able to pass the custom field and search by that value for the post tags. But it isn’t populating the loop at all, I do get a populated loop when I change ‘tag’ to ‘tag_slug’ but it still isn’t changing the query results, it is as if they are still unfiltered..
Anyone have any help or run into this before? I’d love to sort this out… lol sort. Get it?!? Haha, sorry, couldn’t help myself…
But seriously, little help… and if you could pass this on to your wordpress guru’s that’d be sweet too.