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

learn more… | top users | synonyms

0
votes
1answer
12 views

Echo out custom fields in comments

I am trying to figure out how to echo 4 created fields from a plugin in my theme template for the comment form and customize the comments output as well. The plugin I am using lets me add custom ...
0
votes
1answer
21 views

What is the code to get the download link for a product in WooCommerce?

I'm trying to add the direct download link of a product to a button, but I'm stuck. What I tried is this <a href="<?php echo $product->downloadable_files; ?>">Download</a> ...
0
votes
0answers
14 views

Get Meta Values and Count based on Meta Keys

Is there a function or a script to get the distinct meta values given a meta key and post type? I was hoping for a function similar to get_terms() for taxonomy. In addition to each meta value, there ...
0
votes
1answer
9 views

Get meta value when the page is a blog archive

I'm using custom metaboxes on my pages. For example: header icon. I created a page for the news on my site. I selected it as a blog archive page under Settings->Reading page. Unfortunately I can't ...
0
votes
0answers
14 views

how to show the post-meta for particular custom field in my post? [duplicate]

function add_custom_field() { add_meta_box( 'my_field', 'My Field', 'add_input', 'post' ); } add_action( 'add_meta_boxes', 'add_custom_field' ); function add_input( $post ) { $value = ...
0
votes
0answers
12 views

How to update post meta in schedule event action-function?

I want to execute something like this. What I must to change in following code? wp_schedule_event( time(), 'hourly', $string); add_action($string, 'do_this_hourly'); function do_this_hourly() { ...
1
vote
1answer
41 views

Creating terms vs custom post meta to save data?

I am making a news aggregation site on wordpress. I've to save domains of source urls somewhere. Sometimes source url could be same for multiple posts. So I'm confused how should I save the data. ...
0
votes
1answer
11 views

What is the best way to query posts based on live data?

I work on developing plugin for WordPress. In each post, there are rating bar that users can rate 1-5 star to post. I calculate the grow rate based on (Stars in past 7 day from now). I want to show ...
0
votes
0answers
20 views

Problem serializing single quote and double quote into post meta

This is a silly question and I shouldn't have to be spending this much time on this issue. I've been trying all sorts of things without any success. I am trying to serialize a string with single ...
1
vote
2answers
33 views

How to get the total number of meta_values based on a custom post type?

I need to display the total number of votes that have been made for a specific custom post type. Here's an example of how the wp_postmeta table looks for these keys/values: meta_id post_id meta_key ...
-3
votes
0answers
44 views

Post rating without plugins?

Is there any simple post rating snippet which will work when page is cached. There is many functions, for example this: <form method='POST' action=""> <input type=hidden name=rate ...
4
votes
1answer
128 views

So much data in postmeta

Last year started using custom fields and in one year I have 230,540 rows in wp_postmeta table. This year will add more data and new fields and I don't know what to do, to create new table or continue ...
-1
votes
1answer
54 views

Access post meta just after publishing

the following code is supposed to store post meta of the recently published post to the variable $temp. But it doesn't, $temp is always empty. This seems to happen because "transition_post_status" ...
0
votes
0answers
22 views

Adding description to wordpress blog post through wp-admin panel

Is there a way to add a description to my Wordpress blog post through wp-admin panel?
0
votes
1answer
48 views

Search one custom field?

In posts there is in custom field named "color". I have custom search page template, and I would like to show search results only from that one custom field. How to limit search to look just in one ...
0
votes
0answers
11 views

Remove metabox container and header

Is it possible to remove the whole header of my metabox (title+toggle icon) and the container (.postbox) ? I wonder I can use css to remove them, but is it the best solution?
0
votes
1answer
33 views

Use WP_Query in shortcode

I'm trying to get meta information from the first four posts that have a meta key equal to Sedan, then format that posts meta in order to set up gallery type display boxes. I believe it has something ...
0
votes
0answers
24 views

Can't save meta field value if the title not set

I'm using the example from WordPress Codex (https://codex.wordpress.org/Function_Reference/add_meta_box#Procedural) to add and save meta box values. Unfortunately I can't save the value of the meta ...
0
votes
0answers
33 views

Pre_get_posts meta query value serialized array using multiple URL parameters

Using the 'pre_get_posts' action I'm looking to return all posts which match multiple URL parameters by defining the meta_query. For example: example.com/?size=large,small&options=green,blue,red ...
0
votes
0answers
16 views

How To Add Custom Meta Field Select/Radio Box to Post List Bulk Edit Mode

How can you add a radio fieldset to a custom post-types post list bulk edit screen for a custom meta field? Please provide in depth code example and explanation and thanks in advance. The ...
0
votes
1answer
30 views

Structure of postmeta meta_value for woocommerce product download

So I'm working on a monster script to port all of our existing stuff from Joomla/Virtuemart to Wordpress/WooCommerce. So far I've got just about everything done with moving over our product ...
0
votes
0answers
17 views

Need to make a “Meta Box” for Post search

I have a theme, where i can associate post with page there is called ( Hubs ) its part of the actually page. I have figure out so much that when i post a news about something, and it have to go into ...
0
votes
1answer
20 views

Storing post_meta fields in array

I need to have 8 separate post meta fields on each post in wp-admin (shown in a custom meta field box). I'd like the data from these 8 fields to be stored in an array as one post_meta field for easy ...
1
vote
1answer
137 views

How do I add advanced custom fields / meta fields to Elasticsearch? [closed]

I am using the plugin ElasticPress. I'd like it to index some extra (advanced custom) fields. The only info I can find is this comment by one of the developers: [...]if you would like to add ...
0
votes
0answers
28 views

Convert meta description into corresponding excerpts / yoast seo plugin

I m using Yoast SEO plugin on my blog. I never filled excerpts manually, but filled the meta description for each posts. But now for some reasons i need to use get_the_excerpt hook and I have never ...
4
votes
2answers
196 views

What is the different between an attachment in wp_posts and an attachment in wp_postmeta?

After the Woocommerce dummy products are imported, I notice that in the database, there are different records in different tables but point to THE SAME photo attachment. The question is why? What are ...
0
votes
4answers
114 views

Remove href tag from wp_postmeta in 34,000 posts?

I'm using Godaddy Hosting, PHP 5, and Wordpress 4.2.1 I have 34,000 + posts that need outdated href tags removed. I am able to remove tags, one post at a time, by using this code in a page template ...
0
votes
2answers
46 views

WP_Query Posts by Metadata from Option Tree

I am doing a WP_Query trying to filter out the posts by Metadata. $args = array( 'ignore_sticky_posts'=> 1, 'post_type' => 'post_projects', 'post_status' => 'publish', ...
0
votes
0answers
20 views

how to show posts based on meta value for a logged user in admin pannel

I need to show posts in admin panel based on meta value. I have a meta box when logged in user want to add new post, he should checked the users in meta box that can view that post. when that user ...
3
votes
1answer
116 views

Use REGEXP in WP_Query meta_query key

I know I can use REGEXP in WP_Query like this: $query = new WP_Query(array( 'posts_per_page' => -1, 'post_status' => 'publish', 'meta_query' => array( array( ...
0
votes
0answers
25 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
39 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
85 views

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

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
54 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
39 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
62 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
59 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
193 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
217 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
19 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 ...
0
votes
1answer
39 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
31 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
48 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
22 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
22 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
23 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
15 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
42 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
18 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
54 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 ...