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

learn more… | top users | synonyms

0
votes
0answers
9 views

Wordpress User Meta Open Graph and WPSEO Yoast different in production and staging environments

When using Facebook share to share a link I have been using WPSEO and custom hooks to update the Open Graph meta information based on custom parameters in the url in the theme's function.php file. /* ...
0
votes
1answer
28 views

WP_Query - Accessing MetaValue from Query Result

Have this code. In doing a var_dump the meta_value is being retrieved under public object meta_value. I'm trying to access this data in a "WordPress" away instead of a more traditional PHP way. What ...
0
votes
1answer
66 views

Complex strcuture as CPT or taxonomy for use in woocommerce product variations

In woocommerce, I've got a bunch of products, which all have a certain material assigned. My current implementation of a material is a CPT (with about 20 fields (color, transparancy, reflection, ...
0
votes
1answer
18 views

Disable Facebook Comments Automatically On CPT

I am working with the Facebook comments plugin. I have a custom post type that never uses Facebook comments. I am trying to create a function to automatically turn these off when the custom post ...
0
votes
0answers
16 views

WP-API : post_meta not updated… but have another entry

When creating a post, I put some post_meta here is the code for the creation edition and deletion of a post https://gist.github.com/eduplessis/dc530523f0b98ae233dc and here is the result of the ...
1
vote
1answer
49 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 ...
1
vote
1answer
46 views

Sorting and limitation with pre_get_posts

This is my third question regarding WP queries and pre_get_posts (sorry about that) but I cant give up one step before the full success :) So the story - my query is limiting front page posts to ...
4
votes
4answers
182 views

get registered metaboxes by post type or post ID

I am looking for a method to get the registered metaboxes for a specific post type (or post ID) when on a separate, unrelated post type. I am working on making a custom "editing" post type for a ...
4
votes
1answer
91 views

How can merge two arrays values in one array and save in database

I am working on WordPress upload meta fields. When user upload images the images are sized in two dimension one is "thumb" and one is "big" and they re sized very perfectly. I save both of images ...
0
votes
0answers
17 views

Dynamic CSS for CPT that requires post meta data

I have an, admittedly weird, CPT structure. I have two CPT's, one is 'section' - which is basically meant to represent a tag in HTML - and the other is 'sectioned_page' - which displays user chosen ...
-1
votes
0answers
29 views

Woocommerce add new variable product

I have already referred to: http://stackoverflow.com/questions/21667292/how-to-set-attribute-as-variation-in-woocommerce ...
0
votes
1answer
27 views

Why is get_post_meta returning an array when I specify it as single?

The documentation from get_post_meta makes it sound as if the single argument will determine whether or not meta values are returned in an array or not. For example: // If I set single to false, or ...
0
votes
1answer
19 views

Display post meta conditionally based on it's value

I have a custom field that's a radio button with 3 choices (yes, no, other). What I'd like to do is the following: [If custom field value is yes] Display something here [elseIf custom field value ...
0
votes
1answer
23 views

Can't get post ID using wp_insert_post_data

I have 3 custom fields as shown below. I want to use them to generate the title when I save/publish... etc The code works if I insert the post id as a number but not like this... function ...
0
votes
0answers
16 views

How to manipulate Wordpress custom fields to implement OG Tags on individual Posts

Hello my name is Erin and I have just started sharing my website content onto Facebook. The problem I've run into is that I can not control the description, image or title of the post. After doing ...
0
votes
1answer
16 views

How to add post reference field to a plugin?

I am trying to add a field to a custom post type through a plugin I am creating. One of the fields I need is a post reference / link to field. Any ideas on how to do this? In the WYSIWYG when you ...
0
votes
1answer
19 views

Filter query posts by the count of metas for a meta key

I know it is possible to filter queries to order posts by the numeric value of a meta. For example, I store the number of total likes for a post in a single meta key : ...
0
votes
0answers
14 views

Detect DOM Changes in Custom Metabox

I have a scenario where I use a custom metabox that contains two tables. One table contains a select list which a user can then add details about the selection. When complete, they click a button to ...
1
vote
0answers
26 views

How to compare two posts including their meta fields on a scalable base?

I have set up a wordpress in a way that posts can be cloned and be altered by a different author. whenever this is the case, i want the administrator to be notified via an additional tab in the ...
0
votes
0answers
13 views

help with wordpress post_meta saving and updating

i have this code which works fine, i can input information, save information, retrieve information no problem but if i want to erase an existing information to leave the field blank it will not erase, ...
0
votes
0answers
34 views

set s3 image as a featured image in wordpress post while posting the post programatically from an external source

I am pretty much new to wordpress. My requirement is that i need to make a post from an external source using ajax to wordpress site. The post data merely contain "posttitle,description,etc..." and an ...
0
votes
1answer
19 views

Save values generated via API as custom meta fields

I'm using the IMDB Connecter plugin to grab meta data for movies and I'm wondering if I can save some of the information it generates as custom meta data. Basically, I want to be able to save the ...
1
vote
3answers
54 views

Orderby meta_value only returns posts that have existing meta_key

I have the following wp_query: $args = array( 'post_type' => 'news', 'orderby' => 'meta_key', 'order' => 'ASC', 'meta_key'=>'custom_author_name', ...
0
votes
0answers
51 views

Undefined index error in custom post metabox

I'm getting this error with my custom post metabox. The custom post and metabox works fine, but if i have debug on and when i try to save any other page or post, i will get an error: Notice: ...
0
votes
1answer
50 views

Get $post->ID from a URL

I have a custom post type called music. I have created a custom template as a normal page to show some stats for the musicians. I have a page where they can see all there songs and have added a ...
0
votes
0answers
36 views

Meta query compare timestamp if exists

I have a custom post type with a start and end date timestamp. These fields are not required so they may not exist. What I want to do is query and show all posts that don't have the end date set or ...
1
vote
1answer
32 views

Safe to delete blank postmeta?

We have a lot of rogue custom fields. I feel that we can clear significant space in the DB if we remove the blank values. If I query my database with the following: select * from wp_postmeta where ...
1
vote
1answer
35 views

Custom post meta values reset by autosave [duplicate]

I have created a post view counter plugin that increments a count each time a post is viewed/refreshed. The count is working fine however if editing a live post the autosave functionality appears to ...
0
votes
1answer
53 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
49 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 ...
0
votes
0answers
19 views

Define meta fields in a page template

I had an idea for managing fields for page templates and I thought I'd post it here to see if (1) this is terrible and (2) if there's a better way to define the fields in the template. Here's the ...
0
votes
0answers
35 views

Custom post type term names with ampersand in the term name

Every time I think I've got a handle on WordPress it finds a way to baffle me. Recently we've been having an issue with not being able to attach term names with an & (ampersand) character in the ...
1
vote
0answers
35 views

Custom filter function not working with Custom post type

I have custom post type "soto_property". I have made a custom filter to filter post listing according to used meta data named "operations". Here is my code- <?php add_filter( 'parse_query', ...
0
votes
1answer
26 views

use post meta in add_meta_boxes action

Is there any way to use get_post_meta within a function called by the add_meta_boxes action hook? I only want to display the meta box if a specific post meta matches a regex, but so far, I have not ...
1
vote
0answers
43 views

Storing revisions of metadata for custom post type

Storing metadata for custom post types is easy, you just need to add an action for 'save_post' with your method that handles this. In which you have then something like the following for a field that ...
0
votes
1answer
46 views

Read post meta values, only if posts are public

I want to retrieve meta_values applied to posts. Currently I execute the following query global $wpdb; $table = $wpdb->prefix.'postmeta'; $values = $wpdb->get_results( "SELECT meta_value ...
0
votes
0answers
7 views

Moving WordPress Featured Image Box Below Title [duplicate]

I would like to move the featured image box just below the title field in the New Post admin. I tried the following code, but that just places it below the text editor. function ...
0
votes
0answers
25 views

Update post_meta field only when present

Present update_post_meta internally calls add_post_meta if the value is not present. What i want is to avoid calling add_meta if the value is not present and the value passed is '' (blank). I do ...
0
votes
2answers
59 views

Get a post_id where meta_value equals something in a serialized meta_value field

I'm storing CPT products' post IDs into CPT companies' post meta (meta_key = prefix_products). As a company can have multiple products, so I'm storing them into a PHP serialized array value. ...
0
votes
2answers
50 views

How to selected which tags to print, instead of printing the whole tag list?

When having this: $tag_list = get_the_tag_list( '', ', ' ); I substituted the meta print: printf( $tag_list, $category:list, etc ); by this: $printArray_tag_list = explode(', ', $tag_list); ...
0
votes
1answer
32 views

wordpress custom loop ascending descending posts by custom field

I am developing wordpress site that is depend upon price so i add custom filed named 'price' <?php while ( have_posts() ) : the_post(); echo $price = get_post_meta($post->ID, 'price', TRUE); ...
1
vote
1answer
37 views

Difference between meta keys with _ and without _ [duplicate]

In wp_postmeta table I noticed that some of the keys are with '_' (underscore) prefix and and some are without _ What is the major difference between these fields and how they can be used while ...
5
votes
3answers
581 views

Why WordPress choose data serialization over json_encode?

In my little age with WordPress, I've seen WordPress itself and its friendly plugins are using PHP serialize() in storing data into db in many cases. But in a recent search I found a serious community ...
0
votes
2answers
116 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
0answers
12 views

Displaying meta via shortcode

So i added a custom post type and tax to my child themes function file and then added this for some meta i would like to know how i can get this info to display via shortcode? function ...
0
votes
0answers
32 views

I am trying to add custom-fields to a post carousel plugin

I have a post carousel on my website.I am trying to add an option to display custom fields. I looked at the code for the carousel and I tried to add my custom-fields option. I am not getting a display ...
0
votes
1answer
37 views

meta field search too restrictive in pre_get_post() for custom search

I'm trying to figure out how to loosen up a custom meta field matching string search in a custom search. Basically, if the meta field of a custom post has "Whistler Bike Park, Canada" and I enter ...
0
votes
0answers
39 views

Calculate top authors on the basis of Post Views

I wanted to calculate the Top authors on the single.php page according to the average of the posts views. I have created a function which is calculating the average of the total post views of a ...
0
votes
1answer
33 views

Assign postmeta in bulk

I have meta paramteres for my pages, which i would like to change in bulk (about 300 pages). I know that meta name is "header-settings" and values can be "no-data", "site-data" and "page-data" I also ...
0
votes
0answers
19 views

meta query always fails even if data is correct

I've following query - $query = array( 'post_type' => 'accessory', 'posts_per_page' => -1, 'meta_query' => array( array( 'key' => 'accessory-bike', ...