List from custom field
-
Hi
What I am trying to achieve is produce a page with a list taken from a custom field, I then want the list to be clickable to show all the posts linked to that custom fireld.
I can produce the list using
<?php $metakey = 'merchant'; $merchants = $wpdb->get_col($wpdb->prepare("SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE meta_key = %s ORDER BY meta_value ASC", $metakey) ); if ($merchants) { foreach ($merchants as $merchant) { echo "$merchant"; echo "<br />"; } } ?>So far so good, what I can’t work out is how to make them clickable to show the posts. I’ve spent hours looking through the forum and the net but I am no closer. If anybody could point me in the right direction I would appreciate it.
Thanhks
Mike
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘List from custom field’ is closed to new replies.