I have a query which is used to display posts on a page when a custom field/meta key contains a phrase (in this case "key = sports" and "value = fishing"). How do I use the query on a single post to display some text when the same criteria is met? The loop query is:
<?php
$args = array(
'meta_query' => array(
array(
'key' => 'sports',
'value' => 'fishing',
'compare' => 'LIKE'
),
));
query_posts($args); while (have_posts()) : the_post(); ?>
I imagine the solution contains a php "if" and "echo" but am rather stumped! I am sorry if the question is unclear - let me know and I will try to better explain. Thank you for your help.