Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Blogging Forum


You are currently viewing our Blogging Forum as a guest. Please register to participate.
Login



Reply
Duplicate post meta in Wordpress
Old 11-20-2010, 06:54 AM Duplicate post meta in Wordpress
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
I'm using the Custom Field Template plugin which I am using to turn custom fields into checkboxes.


The problem is, it now means that I've got post meta with duplicate meta keys, like so:
Quote:
meta_id = 381
post_id = 469
meta_key = Grape
meta_value = Malbec


meta_id = 382
post_id = 469
meta_key = Grape
meta_value = Mosacatoolo


meta_id = 380
post_id = 469
meta_key = Grape
meta_value = Colombard
If I try to output the value of the postmeta; 'Grape' in my WordPress loop then it only gives me one value, not all three.


Does anyone know how I can do to pull in all 3 values in my loop?
__________________

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
 
Register now for full access!
Old 11-20-2010, 10:49 AM Re: Duplicate post meta in Wordpress
Extreme Talker

Posts: 156
Trades: 0
In this case you would have to view the source code in the admin area and edit it
dagaul101 is offline
Reply With Quote
View Public Profile
 
Old 11-20-2010, 12:29 PM Re: Duplicate post meta in Wordpress
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
Quote:
Originally Posted by dagaul101 View Post
In this case you would have to view the source code in the admin area and edit it
The admin area? My problem is outputting all 3 values of the same key in the frontend
__________________

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Old 11-22-2010, 10:42 AM Re: Duplicate post meta in Wordpress
racer x's Avatar
Ultra Talker

Posts: 457
Name: Randy
Location: Northern Wisconsin
Trades: 0
You can't have 3 different values for the same key?
Custom fields are stored in the database as key-value pairs. Therefore, the meta-key "grape" can only have one value for that post ID.
You would need pairs like:
"Choice 1=Malbec",
"Choice 2=Mosacatoolo",
etc...
(meta-key/meta-value)
racer x is offline
Reply With Quote
View Public Profile Visit racer x's homepage!
 
Old 11-22-2010, 10:51 AM Re: Duplicate post meta in Wordpress
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
Quote:
Originally Posted by racer x View Post
You can't have 3 different values for the same key?
Custom fields are stored in the database as key-value pairs. Therefore, the meta-key "grape" can only have one value for that post ID.
You would need pairs like:
"Choice 1=Malbec",
"Choice 2=Mosacatoolo",
etc...
(meta-key/meta-value)
Ahh right I see what you mean! So I would need a separate custom field for each type of grape?
__________________

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Old 11-22-2010, 12:57 PM Re: Duplicate post meta in Wordpress
racer x's Avatar
Ultra Talker

Posts: 457
Name: Randy
Location: Northern Wisconsin
Trades: 0
Yep. That is correct.
racer x is offline
Reply With Quote
View Public Profile Visit racer x's homepage!
 
Reply     « Reply to Duplicate post meta in Wordpress
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.23740 seconds with 12 queries