Hi Esmi
Yes, the custom field holds the slug.
Good news though – change $posts to $post and hey presto! 🙂
$category = get_post_meta($post->ID, 'category', true);
Thank you for your help!
Just in case – the missing ‘<‘ at the opening of that last snippet is a typo – it is there 🙂
Hi Esmi
Thank you for getting back…
It wasn’t working as in it doesn’t restrict the loop to the assigned category.
?php
$category = get_post_meta($posts->ID, 'category', true);
// The Query
$the_query = new WP_Query( 'category_name=' . $category . '&showposts=4' );
// The Loop
while ( $the_query->have_posts() ) : $the_query->the_post();
echo '<li>';
the_title();
echo '</li>';
endwhile;
?>
Hi
Thanks but still no joy :-/
Any other ideas?
Your help is greatly appreciated, thank you 🙂