Post meta is a data set containing additional core as well as custom post information.

learn more… | top users | synonyms

2
votes
1answer
100 views

Exporting Data from WordPress into a flat table

I need to be able to export the data within WordPress so that each object is contained in a single row, like a flat table. Imagine each post type as it's own database table, containing columns that ...
2
votes
1answer
300 views

How to update/delete array in post meta value?

I using post meta like.. $meta = get_post_meta(99,'_mymeta',true); $value = $meta['somekey']; echo $value; But how to update $meta['somekey'] to some another value ? How to use update_post_meta to ...
2
votes
3answers
43 views

Custom fields: In what order are they saved into the DB?

If I insert multiple custom fields to my article, they get sorted in "I don't know what" way. So when I insert some multiple fields in an article and call those via $cf = get_post_custom(); foreach ...
2
votes
3answers
269 views

Function to change meta value in database for each post

I have a meta key called 'prijs' in each post. The value of this meta key consist of numbers in the follow structure: 2,100.00 I want to remove the comma in the meta value to get this output: 2100.00 ...
2
votes
2answers
78 views

Identifying Importer Posts

Given a site with 100 posts, where an unspecified number of posts are manually written, and the rest are created using the WordPress importer, how would I programmatically identify the posts imported ...
2
votes
2answers
3k views

Properly add an upload media button in a meta box field

i have a custom post which has a meta tag that needs to be using a file upload (for video files). I am wondering, what is the correct way of adding an Upload button that points to the wordpress media ...
2
votes
1answer
1k views

passing argument to get_template_part() or a better way to code

I have this include … event-list.php <?php /** * The loop that displays upcoming events */ ?> <ul class="event-items"> <?php $yesterday = time() - 24*60*60; $args = array( ...
2
votes
1answer
233 views

Create meta boxes that don't show in custom fields

I used the code below to create a metabox for posts. These meta boxes are also seen in the custom fields. I do not want these meta boxes to show in custom fields. Is there any way to not show meta ...
2
votes
1answer
1k views

order by numeric value for meta value

I have read countless posts on ordering data by numeric value ( as opposed to string - it i have a numeric meta value and it gets ordered like this 1 11 12 2 233 etc as opposed to the way i want it I ...
2
votes
1answer
390 views

Meta keywords and descriptions plugin for manually editing meta for each page/post

Can anyone recommend a simple plugin that allows me to add/edit meta tags for keywords and description on each page of my wordpress site? Just something that adds the fields to the page editor would ...
2
votes
2answers
3k views

Query between two meta values?

How do I limit the query by two custom meta fields, a start date and an end date? This is what my data looks like: meta_key | meta_value | ------------------------| start_date | 20100131 | //Jan ...
2
votes
1answer
156 views

Save default value for empty or missing post meta

I am using WordPress and I am using a custom field that has the name ecpt_carprice for each post I am publishing, the field is saved in wp_postmeta the same as the attached image: Some of my cars ...
2
votes
1answer
154 views

unable to save post meta on single field with multiple selects

I set up two select boxes in one meta field by putting two arrays inside the 'options' array of my callback. The HTML is outputting fine, but the meta is not being saved to the database... Here is a ...
2
votes
3answers
510 views

metabox upload file

I have a custom meta filed with upload file functionality but the problem is I can't get the fileurl button value when hit "insert into Post" below are my jQuery code window.send_to_editor = ...
2
votes
3answers
1k views

Search everything (posts, pages, tags, cpt, meta)

I would like to know how to use the built in wordpress search to return results from all content on my site. Specifically, I want to search; posts pages tags custom post type (portfolio) custom ...
2
votes
2answers
989 views

Custom field values deleted when trashing custom post type

I've created a custom post type with 2 custom fields attached to it... When I create a post of this type and fill in the custom fields, the data is, in fact, saved to the db... However, if I trash one ...
2
votes
1answer
356 views

Metabox Data not being saved [closed]

My meta box won't save data. It's a select form field and when I select and update the post, there's nothing selected on refresh. So here it is on PasteBin. http://pastebin.com/tfrgasQC Can anyone ...
2
votes
1answer
1k views

meta_query: using BETWEEN with floats and/or casting to DECIMAL

Each post has a lat/lng value attached to it via postmeta. I'm trying to grab all posts within a bounding lat/lng value. Here's the get_posts query: $posts = get_posts(array( 'posts_per_page' ...
2
votes
2answers
678 views

Using date stored as custom field to filter posts displayed in admin

This seems like a fairly common problem, but I'm posting this as I've yet to find a solution to my problem here on WP Answers - any help is HUGELY appreciated! Ok - so I have a custom post type of ...
2
votes
1answer
213 views

Convert User ID's to User Names in a single.php file

I have a post_meta "thevoters" that store users ids like: 1,2,20 ...etc, How i can turn this id's to User Names to list them in a single page? This will echo the numbers as text, echo ...
2
votes
2answers
723 views

Conditionally Query Custom Post Types by Post Meta for Blog Home Page?

(Moderator's note: The question's original title was: "Custom query: Show custom post types plus custom post type with post meta on blog homepage") I'm in need of help with a custom query. I have ...
2
votes
2answers
506 views

Meta query with boolean true/false value

I'm trying to show all rental properties, first by all properties that have not been rented, and then by all properties that are currently rented. There is a custom post type 'rent' with custom post ...
2
votes
1answer
28 views

Set attached to state

In the media library every attachment post has an "Attached to" column. I've developed a plugin that adds author profile and a facebook like banner image. I now discovered that the attachment posts, ...
2
votes
2answers
236 views

What is an efficient way to query based on post_meta?

The problem I am having is when I allow users to filter posts it overpowers the database and things run extremely slow. I am unsure what the best way to query posts using meta values is. My site has a ...
2
votes
2answers
171 views

Millions of Rows — Possible Solutions?

I have a custom CMS, that we're looking to port over into Wordpress. (I can see you asking yourself, why not just stick with the custom CMS? Well, it's outdated, clunky, and getting to be too much of ...
2
votes
1answer
247 views

How to set author for post AND post attachments

I have multiple author accounts on one of my WordPress installs. Often I will create a post, and set the author to be a different account. However, when I upload images into that post, their ...
2
votes
2answers
599 views

Display info from custom fields in all images' HTML

Okay, I've been working on this all day and can't find the solution anywhere. I've created a custom field within the image upload screen (info first found here). The field stores the name of a ...
2
votes
1answer
815 views

wp_handle_upload error “Specified file failed upload test” but still creates attachment?

Having a bit of trouble with an image upload custom meta box. What happens is the uploaded image is created as an attachment but the wp_handle_upload seems to kick back the error "Specified file ...
2
votes
2answers
356 views

Wordpress Action Hooks and Post ID?

I'm creating a very basic Wordpress plugin whose purpose is to display a numerical value beside each post. My Logic for the plugin function (plugin.php) is this: <?php function foo($post_id){ ...
2
votes
1answer
155 views

Multi-line captions on attachments

How can I change the 'Caption' text input to text area, to allow for multi line captions on media uploads?
2
votes
1answer
162 views

Post IDs missing on delete_postmeta action hook

I'm using metadata in pages to store variables and do server side caching for dynamic generated PayPal buttons and other variables about the pages (page specific). I'm trying to hook the page meta ...
2
votes
1answer
468 views

List posts under meta_value heading

I need to list completed (meta_value) projects for each year (meta_value), like this: 2006 - Project 1 - Project 2 ... 2005 - Project 3 ... I found (here) a great piece of code to deal with I'm ...
2
votes
0answers
66 views

Content hooks vs User hooks

This is more of a theory question than a question with a direct answer. I've been working with different actions for firing functions when a post is updated or deleted and when users are updated or ...
2
votes
1answer
347 views

Admin Area Custom Type Search By Meta Fields Without Title & Content

I have a custom post type that uses several meta fields. In the admin area I would like to be able to search by those meta fields. I have implemented this currently in my functions.php with this code: ...
2
votes
0answers
217 views

Copying Custom Meta Values from existing post to a duplicate post

I'm trying to revise an existing WP plugin BU Versions to accept different custom meta field values from items I've set-up using the Advanced Custom Fields (ACF) plugin. BU Versions will copy over ...
2
votes
1answer
190 views

Save HTML formatted data to post meta using add_post_meta()

Array ( [post] => Array ( [jw_objective] => Exposure to e<b>nd to end development</b> of various applications; right from requirement analysis to system ...
2
votes
2answers
248 views

Grouping related postmeta data via SQL query

I am using someone else's WP plugin which stores lots of related data in wp_postmeta using an "artificial key". So effectively we hijack wp_postmeta to create a nested relational database. So one row ...
2
votes
0answers
236 views

Change post format using custom field

I'm creating a theme using the CF Post Formats plugin. But I've run into some trouble I don't know how to solve. Here's what I want to be able to do: Create a new standard-format post Enter a url ...
2
votes
2answers
143 views

Author Page Custom Query WHERE author OR [post meta value] OR [post meta value]

I am currently trying to perform a custom query on the authors page (author.php). I have two custom fields for posts that I want to query against (post_photographer and post_videographer). What I am ...
2
votes
1answer
216 views

Create a Metabox that behaves Like a Taxonomy Box

I need to show all my custom articles on an archive page but grouped/sorted by subject. So that the result is somewhat like Subject A: A Sample Post Another Sample Post Subject B: List item ...
2
votes
2answers
298 views

Single reusable value for post meta: Custom Taxonomy or Post Meta?

Suppose I have a post meta like "Region" it will contain values like "Region 1", "Region 2" etc. But it should only contain ONE value. Also I would like it to have an archive page. If I use custom ...
2
votes
2answers
741 views

Display all custom post type posts and order them by an optional meta_key

I have a custom post type (CPT) called property. I have registered a featured property metaboxfor it as explained in this question "How do I create a featured post within a custom post type?". So a ...
1
vote
3answers
595 views

Custom post type category not displaying in custom post type

I've created a new custom post type (lets call it "Reviews") on the backend of my Wordpress. It works fine for the most part but the Categories I create within that Custom Post Type are not displaying ...
1
vote
2answers
671 views

WP_Query not working as expected for attachments and custom meta_query

If I use get_posts() like so I get a number of results with the value 1 for the my_key meta_key: $posts = get_posts( array( 'post_type' => 'attachment', 'meta_key' => ...
1
vote
2answers
885 views

Wordpress Menu Disappears when $query->query_vars['meta_key'] is set

I've set some meta variables on my WP posts. I want to be able to sort by these variables, and everything is working great except when I sort by either "views" or "likes". When I sort by either of ...
1
vote
3answers
308 views

Transients vs CRON +Custom Fields: Caching Data Per Post

Wanted some opinions on a solution I'm trying to come up with: I have a fan/enthusiast plugin I'm working on for fans of TV shows. One of the custom post types attached to the plugin is a release ...
1
vote
1answer
5k 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" ...
1
vote
2answers
3k views

Query 2 meta key values and a category

I have a wp query that works great - it returns a list of featured posts. WP_Query("category_name=office&meta_key=featured_post&meta_value=Yes&posts_per_page=3"); However I want to add ...
1
vote
1answer
911 views

Views count with time limit per IP

I've been looking for function about post views count. I found this simple functions using update and get post meta. function setPostViews($postID) { $count_key = 'views'; $count = ...
1
vote
1answer
1k views

Redirect blog page to latest post?

How can I make it so when the blog link in the nav bar is clicked it redirects to the most recent post? I know how to display just the latest post on the blog page, but I want it to actually redirect ...