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

learn more… | top users | synonyms

1
vote
6answers
695 views

trying to do if post meta !=0

im trying to do a simple if function on my code but for some reason it just isnt working correctly, ive gone over it several times to see if there is anything im missing but no luck, im trying to say ...
1
vote
3answers
300 views

Grossly inefficient wordpress loops!

I'm working on a site at the moment for an orchestra. The various members need to be listed, according to their instrument. The members have a custom post type of biography and I'm capturing the ...
1
vote
2answers
202 views

How to keep a check box in custom meta box for custom post type checked by default for add new post?

In my custom plugin, I have a custom post type and have a custom meta box for it. I have few fields in it, one of it is a check box. I want this check box to be checked by default when I go for a add ...
1
vote
5answers
717 views

Get meta_id along with meta_key and meta_value

Is it somehow possible to get_post_meta or get_post_custom and have meta_id returned along with the meta_value? For example: $data = get_post_meta( $post_id, 'my_key' ); // returns this: array( 0 ...
1
vote
1answer
78 views

Is it possible to store visitors IPs in wp_postmeta table?

Or in any of the other 11 Wordpress tables. I also need to store: submission date, name, contact number in the same table. What approach would be best? A custom table or using a standard table?
1
vote
2answers
391 views

order by multiple meta_keys?

Hi i'd like to order by multiple meta_keys want to make it order using these keys adminscore + user_like + _count-views_all + comment_count combine these keys how should i array order it?? i try ...
1
vote
1answer
344 views

Use a function to update post meta based on other post meta

No idea how to title this so feel free to edit. I set out to create a "hotness" for my posts and to do this I used the $ratings_score which is stored as post_meta as a number +/- and the days ago of ...
1
vote
4answers
1k views

WordPress is stripping escape backslashes from JSON strings in post_meta

I thought I was making my life easy and being future-conscious by saving some content as bits of JSON in custom post_meta fields. Unfortunately, WordPress doesn't agree and is making my life ...
1
vote
2answers
853 views

get_template_part() - post-meta not working?

Maybe I simply do not understand what get_template_part() is doing … I have a file called event-list.php that should work as template for other pages and files so all my events (a custom post type) ...
1
vote
3answers
1k views

MySQL query to set wp_postmeta using term_taxonomy_id value

I have a need to set the wp_postmeta value (in table: wp_postmeta) on every post that has a specific term_taxonomy_id (in table: wp_term_relationships): Specifically: run a query against every ...
1
vote
2answers
72 views

need advice on how to do a lists using custom post types - taxonomy vs postmeta

i am building a lists plugin .... i want to have a custom post type "lists" and then obviously also there would be a number of list items for each list .... i have read a fair bit of stuff about ...
1
vote
2answers
324 views

conditional function to change post-meta background image

I have this CSS setup for my blog posts meta information. But there are certain categories where I would like to use another image in the same spot and not display the meta information. I'm not quite ...
1
vote
2answers
6k views

WordPress how to sort by meta value?

how in WordPress can I sort by meta value? In meta value I have "price" (float). I make this query, but always get "Sorry, no posts matched your criteria". $posts = query_posts( $query_string . ...
1
vote
2answers
1k views

post meta data clearing on autosave

For starters I am using this GREAT answer to achieve custom post types as well as a custom way to insert those post types into other pages, you can view that answer here: Custom field/meta populated ...
1
vote
2answers
3k views

How to store multiple input values with same meta_key

is there a way to store the input value from multiple custom meta box fields with the same meta_key? I use the following code to store ONE value for the meta_key 'startdate': function startdate() { ...
1
vote
2answers
659 views

display specific custom fields

I have few custom field assigned for each post, like: "Club" with value "club1" "Date" with value "date1" and so on... Now, I want to display from all the custom fields just those 2 " club" and ...
1
vote
1answer
226 views

One post carries 30 postmeta values, is this too much?

I have some data saved as post meta, occasionally some plugins may save an extra piece. Now I installed bbpress, it saves at least 10 pieces of post meta. Adding them together, there are nearly 35 ...
1
vote
1answer
285 views

How to update Post Meta values through the comment system

I'm working on allowing users to rate posts - through the comment meta. Storing and displaying individual ratings is working, however, I would like to be able to store the average rating in the post ...
1
vote
1answer
378 views

How to Display Image Meta underneath EVERY image in EVERY post

First off, I want to say thank you for taking the time to even read this, I really do appreciate the help this site and it's community has given me thus far. i have looked forever to be able to ...
1
vote
2answers
1k views

Export entries and multiple custom field meta to .csv?

First time poster. I'm trying to export a bunch of custom posts out to a csv file so I can easily import them into a new database. I've ran the native export to xml, but it's not the correct format I ...
1
vote
1answer
372 views

Save both current and new version of post meta

I want to save two versions of my custom meta box data called "sidebar". I want to compare a new and old version of this data later on, so that is why I want to save a copy of the current "sidebar" to ...
1
vote
1answer
142 views

how to interconnect custom post types?

I'd like to make a site about choirs, composers, conductors and singers. And so far I decided that I need to make a custom post type for "piece" -- any piece can be associated with choir[s], composer, ...
1
vote
1answer
800 views

I can't set meta_key in my custom post type query

I've created a custom post, events, and saved the meta data event_year to each event. I'm trying to get a year's event archive. When I go the the following URL, the meta_key and meta_value are not ...
1
vote
1answer
151 views

How to use post_id with a Class?

I made a plugin for some calculation. Class Math { var $id; // I want to map this id to post_id var $a; var $b; var $c; function calculate{ $this->a = $value_from_post_meta_input_box; ...
1
vote
2answers
2k views

Wordpress Orderby Numeric Value Not Working

I am trying to get all products from the wpsc-product post type and then display them by a custom meta field called release_date_year. However, it doesn't appear to be ordering my posts by this custom ...
1
vote
2answers
1k views

Filtering multiple meta_values

I'm trying to create a filter using two meta_values. Example. If the current page has meta values red and blue, only display queried pages that have both red and blue and none that have just red or ...
1
vote
1answer
326 views

Set Expiration Date of a Post from the Frontend with wp_insert_post

i try to build a form that users posts from frontend, everything works fine but i need to know if it's possible, if i play with the 'post_date' => date('Y-m-d H:i:s')? if i add a hidden field that ...
1
vote
1answer
8k views

using multiple meta_key and meta_value in query_posts

how can i use multiple meta_key and meta_value in query_posts? For example, I want to find multiple content with two different meta_key and meta_value. How do I do this? i using this code but not ...
1
vote
3answers
118 views

Searching by meta values showing inappropriate result

I am working on a custom search by meta value and using this: print_r($_REQUEST); $args = array( 'post_type' => 'property_post', 'posts_per_page' => 10, 'order' => 'ASC', ...
1
vote
1answer
284 views

Combine multiple custom field values into single value

I'm sure this is a fairly basic question but I can't seem to get it right. I have multiple custom field values for addresses in my custom post type and I want to save them as a single value or array ...
1
vote
1answer
45 views

How can I sort homepage by a meta value?

I am trying to sort my home page posts by a custom meta value. I've been told I should use pre_get_posts but I seem to not be implementing it correctly. This is what I am doing: ...
1
vote
1answer
83 views

Maintaining two permalink structures

How can I create two different permalink structures for a Wordpress blog, determined by an addition to the post meta? On the old site, articles were available through the following structure: ...
1
vote
1answer
388 views

WP_query posts closest to todays date

I have written an wp query which I would like to order in a bit of a complicated way. Some posts have a meta value 'the_date' which is an end date for the post. I would like to order posts in date and ...
1
vote
1answer
55 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 ...
1
vote
1answer
209 views

Better post meta efficiency?

I work with websites which require using Post Meta for Post Objects within a particular Post Type. I often add a Meta Box to a particular Post Type, to provide additional settings for the new Post ...
1
vote
1answer
170 views

Retrieving an alt tag from a custom field

I have a theme that uses TimThumb to generate thumbnail images on a gallery page. The problem is that image alt tags are not showing for each image on the main gallery pages, see here: ...
1
vote
1answer
134 views

How to stop wp_postmeta from being called on archive and search pages?

Currently, when I load a search or result page, it queries the wp_postmeta table which is leading to the page taking ages to load. I realise this is a result of this table being huge (70k rows), and ...
1
vote
3answers
286 views

How to access the post meta of a post that has just been published?

I am using the hook publish_post to run my code where I need the post meta of the just published post. But the post meta value I am looking for is somehow not available at this point of execution. On ...
1
vote
2answers
438 views

List all images from a single post meta value

I have created a custom post type with an image gallery upload. Now I am trying to display the gallery on the front end. This is what I have so far that works to display 1 image, but if multiple ...
1
vote
1answer
472 views

Does WordPress limit the length of slug names for Post Meta or Terms?

The WordPress Codex states the the Post Type Names and Taxonomy Names have a limit to the slug name. Register Post Type -- max. 20 characters, can not contain capital letters or spaces Register ...
1
vote
2answers
329 views

special characters after saving draft interpreted as �

I am trying to create posts in hindi language. These characters UÉeÉMÑüqÉÉU after saving/publishing are interpreted as U�e�M��q��U. Though, the special characters are stored with no change in the ...
1
vote
1answer
220 views

Pull post meta with post_query?

I'm building a custom index loop that just uses query_posts at the moment. The issue is that inside The Loop, I have to then query for the post meta data (with get_post_meta), which I believe has ...
1
vote
1answer
418 views

Removing Post Meta from Category Pages?

This should be an easy one for everyone here. I am trying to remove the post meta function from my category pages only and keep it everywhere else. I currently have a function: /** Customize the post ...
1
vote
1answer
35 views

I would like to give special promotion for the first 100 posts in my blog? Can anyone tell me how to do that?

My website is a multi author blog. I would like to give special promotion for the first 100 published posts in my blog? What is the proper way to implement it? I mean should i add some meta value ...
1
vote
1answer
414 views

How to query posts with certain custom meta data, and output Post data

I've been working on modifying the Thesography plugin to include the Google Maps API. So far I've had success doing so. I'm looking to take this one step further and have 1 large Google Map that ...
1
vote
3answers
799 views

Remove Wordpress.org Meta link

In my footer, I have a set of links labeled Meta, it has... Register Log in Entries RSS Comments RSS Wordpress.org How can I remove just the wordpress.org and and comments rss link from the meta ...
1
vote
3answers
494 views

Why am I getting an infinite loop with have_posts?

I have the following code, which causes an infinite loop for some reason. Can anybody explain what's going on please? Thanks! <?php $flagged_stores = new WP_Query( array ( 'post_type' => ...
1
vote
1answer
441 views

IF.. post meta show… Conditional Tag Help…?

I have the following conditional tag, which a friend helped me with... Currently it works doing.. 1) If a featured image just show that. 2) If images attached show featured image wrapped in a link ...
1
vote
1answer
322 views

orderby in custom WP Query does not work

I have this query: $new = new WP_Query(array('post_type'=>'support','order'=>'DESC', 'meta_key'=>'post_views_count', 'orderby'=> 'meta_value_num', 'posts_per_page'=>'20')); the ...
1
vote
1answer
523 views

Custom Post Type: Set post_title equal to a custom post type field

I’ve created a custom post type for employees in a company with some fields they have to fill (like E-mail, phone, etc.) and a select box which takes some values from another custom post type called ...