List unique value of custom field
Can you tell me how this will help? Already checked this functions.
My custom field name is “judge”
There are lots posts. And when in I put custom field code in loop it show same value multiple times
What I want is JUST A CODE. Which display unique values just not duplicate
So just list one post with this meta value in your loop.
Esmi.. There will be lots post and each post will have different judges
if i will list just one post.. i will get just one judge.
I want to list all unique Judge names 🙂
<?php echo get_post_meta($post->ID,'judge',true); ?>
if that does not work, you need to paste the full code of your template into a http://pastebin.com/and post the link to it here, so somenone can have a look at it to see where to add the meta value output.
it might help if you can post a link to your site to illustrate what is hapening right now.
Then list all posts that have the custom field – irrespective of the field’s value.
Esmi here is the code you suggested its still not working
this paste has both my code and yours
Let me clear once again I just want to list “UNIQUE VALUE” of a custom field called “judge”
I dont want to list post title or post content.. Just unique value of custom field called “Judge”
Check online http://wpguru.in/test/judges/
it did same thing. Duplicate values
Regardless of what I did can you paste your own code for listing unique values of custom field “judge”?
It did list posts with that custom field only but the problem is that custom field will have duplicate values. But i want to list only unique values.
Then we’re back to just listing one post for each meta value, yes?
Humm how do I explain? Let me try again
(1) I want to list ONLY unique values
(2) I want to list ALL values of that custom field
(3) I DONT WANT to list any post data like title or post text.
Use a query to grab all posts with a value entered for your chosen field. Loop through those posts building up an array of values for the custom field. Display the final array in any manner that suits your needs
As i told there will be multiple values for that field and I just want list unique ones. What you suggest is just to use a value myself
Let me also explain when I say unique I mean value that list only once.
Post 1 has value “esmi”
Post 2 has value ” Rakesh”
Post 3 has value ” Esmi”
So what i want is to list unique values like “rakesh” and “esmi”
What I am getting now is
- The topic ‘List unique value of custom field’ is closed to new replies.