0
votes
2answers
264 views

Create Array from custom post type to display a slider

I have created a custom post type in my wordpress theme dedicated to creating slides for a slider displayed on the homepage, It has a title, slide text and slide url and also featured image. I'm now ...
1
vote
0answers
96 views

How to save double quotes in post meta, when the post meta data is an array? [closed]

Ok so I've been scratching my head on this one for a while. I'm making a plugin that adds a custom meta box to a custom post type. I'm using the update_post_meta function to save the data from the ...
-1
votes
1answer
79 views

wp_postmeta store multiple values in one key [closed]

I am currently storing some data in a custom field like this: $get_ref = $_SERVER['HTTP_REFERER']; $ref = get_post_meta($post->ID, 'page_ref', true ); $ref[] = $get_ref; ...
2
votes
2answers
181 views

Automatically adding meta data to posts or multiple query help

I run an events company whose website uses a custom post type system for posts (blog), events and tickets all stored as CPT's in the DB. On the guestlist (which counts 'ticket' custom posts if the ...
1
vote
3answers
68 views

get_*_meta doesn't always return an array

I find it annoying that functions like get_user_meta or get_post_meta will return an array if the meta key exists or false if it doesn't. This means I need to do a check like so: $meta = ...
0
votes
1answer
283 views

Update value of a associative array with update_post_meta

I am trying to change the value of a specific key of an associative array which was saved in my post meta. This is how my array is saved in a custom field: Array ( [0] => Array ( ...
0
votes
1answer
439 views

Build Array from Input Fields question

I have a series of input fields sets: <input type="text" name="people[name]" /> <input type="text" name="people[lastname]" /> <input type="text" name="people[email]" /> <input ...
0
votes
1answer
54 views

Array of user ids to list of user names

I'm outputting an array of user ids from metadata like so: $awaygoalby = unserialize($post_meta_data['report_away-scorers'][0]); and I want to change each user id to the user name. So I was hoping ...
1
vote
1answer
62 views

Get specific custom field keys from a post and put into an array

I have the following code to look up the longitude and latitude based off of a custom field upon saving the post. My address fields (street_1, city and state) are separate. I have searched and thought ...
0
votes
1answer
133 views

My theme saves their custom post type's metadata as a serialized array, how to access the keys?

I've recently bought the WP Directory Portal theme from ThemeForest. Since the theme doesn't do frontend posting of custom post types, I've resulted to using WP User Frontend Pro. There's a problem ...
0
votes
1answer
267 views

Run a check for multiple meta key values

I am having a heck of a time getting wordpress to display all values of a certain meta key correctly. I wonder if I am going about this the wrong way? My end goal is to run a check to see if there ...
0
votes
1answer
3k views

Retrieving multiple values to the Post Meta (using an array)

I'm having a problem retrieving post_meta values that I have stored in an array. I use this for storing the array: add_action( 'comment_post', 'add_food', 1 ); function add_food(){ global $post; ...
0
votes
1answer
757 views

Time & Date on Post - Time Ago Custom Function

I'm using the following custom function to display the timestamp for a post as posted "X minutes ago" or "X days ago" for 14 days and then this changes to the actual date (e.g. 17th December 2010): ...
0
votes
2answers
610 views

Echo 2 values from one key in Array with get_post_custom

Edit 12/15/2011 Added Radio Button print code // Add meta boxes to admin panel only needs to be added once add_action('admin_menu', 'plib_add_box'); //Add meta boxes to post types ...
1
vote
1answer
2k views

Is it possible to store arrays in a custom field?

If I understand correctly, custom fields work like this: key(string/int) => value(string/int) Is it possible to define a custom field like this? key(string/int) => value(array (string/int, ...
0
votes
1answer
458 views

search serialised meta_value for date value?

i've saved and array of 'open days' as a serialised array in a meta value. I was hoping i could then just search this field for the selected dates but i can't seem to create a match. serialised = ...
1
vote
1answer
2k views

How to store post meta in an array?

What is the best way to store post meta in an array (using a custom write box, know how to do that) so that all post meta is in a single custom field?
1
vote
1answer
6k views

How to extract data from a post meta serialized array?

I found an XML to WP decoder script that stores the data as an array in a custom meta field. What is the best way to extract the information? For example how could I display the "Manufactured in" ...
0
votes
2answers
677 views

Remove “%” from strings in serialized arrays in wp_postmeta

In the course of converting a blog from Blogger to WP and running a script to grab hot-linked images for hosting, I ended up with some funky images names like act%252Bapandas-210x290.png These ...