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

learn more… | top users | synonyms

1
vote
1answer
13 views

How can I create a list of page titles from custom meta values?

I want to associate pages with other pages by using custom meta values. For one page, I want to associate two other pages, so I create a custom meta value with the key Procedure and the value of the ...
0
votes
0answers
14 views

Same Title on two different post type with single custom taxonomy

I have a custom taxonomy "Store" assigned to two post types : default "Post" type and second "Coupons" for all "Post" of ebay : my links is - http://domain.com/store/ebay/ and all "Coupons" of ebay : ...
1
vote
1answer
22 views

Performance when getting post meta for post retrieved by meta value

I have a meta key which I would like to use to get all post meta data for a post where that one meta key matches a specific value, in one go. Example: Post 1 has a meta_key called unique_number. I ...
1
vote
2answers
26 views

post meta getting deleted on save

I'm having an issue saving post meta on all post types, both default and custom. I'm hooking in to save_post to run my function, and what's happening is that the post meta gets added, but then ...
0
votes
1answer
15 views

How to make Meta Query case sensitive?

I have a meta query similar to: $posts = new WP_Query( 'post_type=article&meta_key=kln_aid&meta_value=' . $aid ); where I need aid to be case-sensitive. Is that possible via Meta Query?
2
votes
1answer
20 views

How to update single value in multi dimensional Post Meta?

There are some values in Post Meta Data stored as a multi dimensional array. I want to update some of their data. Here is the Post Meta value displayed using <?php the_meta(); ?> voter: a:1:{s:...
2
votes
2answers
991 views

Execute action after post is saved with all related post_meta records (data)

I have to execute custom PHP code after new post is saved with all it's meta data. My question is how to achieve that? Tried with save_post action, but it executes before meta records are saved, so I ...
0
votes
1answer
1k views

Group posts by meta_key

I have a Problem with grouping meta_values. The Query looks for posts with the meta key "company". I want a unique listing of the colors like: blue red yellow array_unique was not successful and also ...
0
votes
3answers
600 views

Counting number of identical meta keys

Im looking to count how many meta keys exist within a post, because each time a specific user action happens, a new meta key is created with a date in it. I have this, which does not return anything (...
0
votes
1answer
410 views

How to set YouTube video as featured image?

I am trying to have all my posts with post_format set as video, have said video as the featured image. Here is what I am working with thus far but I need some help: if($post_format == 'video') { ...
2
votes
1answer
512 views

Restrict post edit/delete based on user ID and custom field

I've been able to prevent deletion and editing of posts based on user ID and page ID however, I need to restrict access to editing and deleting based on a custom field. Not sure how to go about doing ...
1
vote
1answer
18 views

Move value of one custom field to another

I've one custom field named as "video" and I want to copy the custom field value to my another custom field named as "theme2035_embed." I could do it manually, but since I have more than 2500 posts ...
0
votes
3answers
3k views

Hide post meta data on a specific category

I'm using the Canvas theme from Woothemes, and their framework (obviously.) I built a child theme and have my custom CSS segregated in a custom.css file in that directory. I've made some changes to ...
2
votes
1answer
815 views

Reduce or prevent calling of update_meta_cache

My theme calls the update_meta_cache() function 58 times per page! This function appears to run the following query based on the post in question: SELECT post_id, meta_key, meta_value -> FROM ...
0
votes
1answer
21 views

add_post_meta doesn't work

I tried this on localhost and it worked, but then I tried to run this on live server (the same template, everything) and it doesn't work. Any help? add_post_meta('39', 'overall', '4');
0
votes
1answer
33 views

Reset/delete post views meta/custom field after X hours or minutes or seconds

There's lots of snippets and plugins that will count post views but I'm trying to find a way a way to reset the number of views back to zero after X hours(or minutes or seconds or whatevaaaa). I'm ...
0
votes
2answers
958 views

Insert data from custom created PHP page into wp_postmeta table

I am working with a Wordpress site and have created a custom page in /home/planmyme/public_html/php/ with the name response.php. On this page I am getting a value to insert in the wp_postmeta table (...
0
votes
0answers
19 views

Transform post publish date fetching code into i18n format

I'm using Visual composer and I have a grid element which shows post date. The problem is - it is showing in English, while the site is in Bulgarian. I think I need to fetch the date in i18n format: ...
0
votes
1answer
18 views

Can I save post meta programatically without setting metaboxes?

I want to know if is it required to have metaboxes set to save post meta into a custom post type. I have a couple of pages where I save metadata into a post programatically, using add_post_meta, but ...
-1
votes
3answers
649 views

Order by a meta field in query loop

I would like to sort my article from a category by a number added in a meta field. Here is the first step, I get the articles to display on the page. <?php $cat = get_post_meta( get_the_ID(), ...
0
votes
1answer
634 views

Get meta information from post parent

So I am in a single page and I want to get some meta information from a parent page. This code is inside my footer.php: if (is_single()) { global $post; $parent = get_post_achestor ( $post-&...
1
vote
2answers
2k views

Displaying Meta Box Image

I have some problems displaying info from my custom meta box in my custom post type single. I'm using Reusable Custom Wordpress Meta Boxes by Tammy Hart. I'm able to display the textfields using this:...
0
votes
1answer
1k views

Auto save title as custom meta field value

I create a custom post type where I removed the "Title", instead I want to use one of my custom meta value to become the title. This is just to make sure the title look good. Know that the post ...
0
votes
2answers
47 views

Querying Database with wpdb

I am trying to access a single value from my database through my functions.php. I have tried three different ways to get a result using a dynamic ID and none have worked. I always get NULL as the ...
0
votes
0answers
9 views

Save and return input type is text on custom post type

I've got the following problem, and have been looking for way too long to solve it. I've made my custom post type, and custom taxanomies, and those all work great. But now I want a custom fields to ...
0
votes
1answer
433 views

Show value of select dropdown in meta box

I have created a meta box which has a select dropdown list and i want to show it in the post as a user selects a particular option from meta box.I cant figure it out how its done.Here is my meta box ...
0
votes
1answer
435 views

Change meta tags programatically

Is there a way to change the meta tags not in the head but in a template file through code? I would like to change the meta tags <meta property="og:title" content="title" /> <meta ...
2
votes
1answer
945 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: ...
0
votes
2answers
974 views

Up/Down voting system for Wordpress

Looking in all posts with keywords "voting system, upvote, downvote", I can't find a satisfying solution for this issue, except accepting one of the available plugins, spend a lot of time undersanding ...
0
votes
0answers
12 views

Twentysixteen theme single post category display

Our site uses the twentysixteen theme and some posts are listed in more than 1 category, eg. Events (parent) & Skateboarding (sub category) Can anyone help me so the single post displays only the ...
0
votes
0answers
12 views

Add custom field on the page post-new.php

I've made 2 new custom collumns in my MySQL DB in the wp_post table. And i would like to insert there some text which i will take it from a textfield insite post-new.php As far as i can see, i have ...
0
votes
1answer
17 views

Get Post ID within wp_set_comment_status hook

I am trying to update meta_value whenever I manually approve a comment inside the WordPress dashboard. I could not figure out how to do it dynamically, but it is working when I manually add a post ID: ...
0
votes
2answers
491 views

Adding and updating repeating custom field meta data

I've got 20+ hours into this and could really use some help. Here is what I am trying to do.. For each record, add post meta. If the post meta already exists, update each field in the array. Just like ...
0
votes
1answer
537 views

Create action running on trashed_post hook to modify post_meta value

I have a custom post type that always do math operation to its post_meta and other custom post type post_meta. For example: post-type 1 = cpt_product_order post-type 1 post_meta = ...
0
votes
0answers
20 views

How can I get post meta data (custom field) from within a custom wordpress action hook?

I have a custom hook in my theme which is set up like this: do_action('my_custom_hook'); That code is in my header.php file and outside of the main loop. I have a call to this hook like so in my ...
0
votes
2answers
1k views

Why am I getting a “Call to member function format() on a non-object” error?

I am trying to add a hook to post saving using WP Frontend User When the form saves and the post is created within the "save_post" function I am trying to find the value of a custom field "...
0
votes
0answers
5 views

Theme only saving post fields set by the author

I have a theme I'm customizing and every time I try add my own post field (meta data) nothing gets saved yet the fields set by author do. Is there something I'm missing or are there any restrictions ...
2
votes
1answer
33 views

How metadata API works?

Update 2: Check out @NateWr method using add_post_meta with the default post: add_post_meta( 1, 'my_items', 1 ); add_post_meta( 1, 'my_items', 2 ); add_post_meta( 1, 'my_items', new \stdClass ); ...
0
votes
2answers
2k views

Displaying Metabox value (custom post type taxonomy)

I have been stuck on this for days, reading articles and articles and nothing works. I am trying to display the value of my metabox on a template page. I successfully added the metabox, and I see ...
0
votes
0answers
12 views

Delete single meta row from multiple meta rows under same key of a post

I'm storing meta data for my posts using a single key, so it's creating multiple meta data. <?php $data = array( 'user_id' => $user_id, 'message' => $message ); add_post_meta( $post_id, '...
0
votes
1answer
561 views

How to enable revisions for post meta data?

Normally wordpress keeps revision of wp_post table. But for generating a report I need some custom fields to be tracked while any update happens. As custom fields are saved in wp_postmeta table I need ...
0
votes
0answers
605 views

WordPress Admin Panel search posts with custom post meta values along with title

Trying to modify default admin search by including search by custom post type fields, Below is my code, function custom_search_query( $query ) { $custom_fields = array( // put all the ...
1
vote
0answers
35 views

Get registered custom fields or post meta even if empty

I would like to be able to get all registered custom fields or post meta for a given post. The limitation I am facing is that the use of either get_post_meta or get_post_custom returns an array of ...
1
vote
1answer
10 views

Update attachment metadata fails

Updating attachment title and description metadata with wp_ajax breaks all previous datas and structure of attachment, my php code: add_action( 'wp_ajax_update_attachment', '...
0
votes
0answers
22 views

WP Meta Query at depth 2

I'm interested in doing a meta query according to some post data that doesn't exist at the first level of the post meta. In other words, I would need two or more keys to get to the variable I'm ...
0
votes
1answer
484 views

Media Attachment Custom Meta Fields not saving in Media Uploader when using jQuery UI Autocomplete

I am trying to write a plugin that adds a custom meta field to image attachments to give images a credit field. I use the 'attachment_fields_to_edit' and 'attachment_fields_to_save' filters. ...
5
votes
2answers
261 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 ...
0
votes
1answer
483 views

How to add tags to post from frontend?

I am working on a site where visitors will be able to add tags to post from frontend without being able to edit the already assigned tags. It basically will be a add tag button where upon clicking ...
-1
votes
2answers
2k 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 ...
9
votes
2answers
114 views

Wordpress retrieving meta data for all custom post types in list view

Im having an issue in WP where php is dying, ive increased memory but the process jumps to 100% cpu usage then dies and apache throws a 500 error. Ive tried to get apache to log something, or php / ...