Tagged Questions

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

learn more… | top users | synonyms

0
votes
1answer
92 views

delete_post_meta() for whole CPT / multiple posts?

I'm cleaning up a theme and one of Custom Post Types has some odd, long gone custom fields. I want to delete them, unfortunately delete_post_meta() takes post->ID for an argument, while I want to ...
0
votes
1answer
64 views

Meta box values are displayed on Custom Fields list. Is it possible to hide them?

I have multiple meta boxes for my Custom Post Type posts. I want my users to add new fields using Custom Fields. The problem is - Custom Fields display all the garbage from my metaboxes and it might ...
0
votes
1answer
75 views

Wordpress postmeta: Store data as an array or single item?

I know it could be difficult to query a single item that saved in an array in wordpress postmeta table, but I have lots of metadata for a single post which may create too many rows for the postmeta ...
0
votes
1answer
389 views

wordpress update multiple posts post meta

I am trying to update multiple posts post meta at the same time. I have the following query: <form action="" method="post"> <?php $variations = new WP_Query(); ...
0
votes
3answers
582 views

shortcode in a custom metabox

I am trying to add a shortcode from a plugin to my custom metabox. I have read it isn't the done thing but in this case i do need it to work. The client might not add a video but might add an image ...
1
vote
2answers
619 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
2answers
177 views

Custom Post Types. Are there any disadvantages/advantages in using a plugin to develop them?

There are a few plugins which can assist you in building your CPT's, and these can usually handle your taxonomies and sometimes postmeta also. Some even take it further than that. I know that as with ...
0
votes
1answer
449 views

WooCommerce custom taxonomy as meta?

I have created two custom taxonomies: (slug) = language (slug) = location On the single product page I would like to display these two as meta below the "Categories" and "Tags." Example: I found ...
0
votes
2answers
277 views

Trying to get property of non-object error using get_post_meta()

I made a simple function for post_meta, in functions.php: // Top Sub Heading (top_sub) FROM CUSTOM FIELD function topSub( $Trunckvalue = null ) { global $post; $TopSub = get_post_meta( ...
0
votes
1answer
64 views

How to query post ids liked by the Author

I'm using wti_like plugin and this is how i get the number(count) of post liked by the author // Get the author object $author = get_user_by( 'slug', get_query_var( 'author_name' ) ); // Get the ...
0
votes
1answer
3k views

How to add multiple featured image in meta box in post editor?

I would like to add multiple featured image in meta box in post editor area apart from default available featured image. I have added the meta box but i have no idea on adding the featured image ...
0
votes
1answer
134 views

Why does get_transient() always return string even if integer set?

I've been trying to bug fix the following method for hours now, and don't have an idea why it always returns a string, instead of an integer. The idea is to return a class property, if exists, or a ...
0
votes
1answer
135 views

Sorting meta box values by start- and enddate and all dates in between

What I've been attempting to write is a function that will allow me to sort a list of WordPress posts by their meta values start date, end date and all dates in between. I've set up a custom metabox ...
0
votes
1answer
306 views

Unique Post Meta Values

I want to use Unique IDs like YouTube video IDs and WordPress post IDs in a custom field 'youtube_id'. I just created a front-end add post page and want to check if 'youtube_id' used or not used in a ...
0
votes
1answer
85 views

Retrieve user_meta and copy to post_meta

As geo mashup only retrieves post_meta, I am trying to copy over the geo_location from a custom registration field into the meta for page containing the map. The code I am using is: <?php ...
0
votes
1answer
120 views

How to retrive Custom Post Type Meta Fields in Custom WP_Query

Can some one let me know How I can render the Custom Post Type Meta Fields (Meta-boxes). I have a Custom Post Type Called "News" and I successfully added a Metabox to my Custom Post Type called "News ...
0
votes
1answer
449 views

Gravity Forms Update post meta from template [closed]

I created a form called 'Books' which has the fields: Title (Post Title) Author Genre (Dropdown - fantasy, horror, drama... etc) ISBN Number Status (Dropdown - Default Option - Published, additional ...
2
votes
1answer
929 views

Get all posts from custom post type and insert in select input as metabox

I would like to know if its possible to do something like this. I have Slider custom post type and Services custom post type. For slider posts I have created a metabox for URL value to display next ...
2
votes
1answer
248 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 ...
0
votes
3answers
2k views

Check if meta key value already exists

Let's say that I have few posts with meta key "videoid". Value of that meta key is different for every post (and has to be different). When adding new post, how can I check if videoid with that exact ...
0
votes
1answer
138 views

Storing values in Post Meta vs new tables

I want to store list of user IDs in the post meta who have rated a post . So, for each post I will need to check the post meta to see if the user id exists in it or not. So my question is that, is it ...
0
votes
1answer
54 views

how to show this part only in the single post page?

I have this part in my index-meta.php file : <ul> <li class="Source"><a>source:</a></li> ...
0
votes
1answer
104 views

Display Post Meta in Header

I'm trying to get page post meta in my header so I can set some meta tags. I tried to get the global post variable but it only return true. <?php global $post; global $wp_query; echo ...
0
votes
1answer
29 views

When importing posts to a new site if XML file has postmeta not setup on new server what happens?

I have a few XML exports from one domain, and all the posts have postmeta which no longer exists on the new domain. An example is <wp:post_parent>70</wp:post_parent> The new domain has no ...
0
votes
1answer
88 views

get_template_part() isn't loading author information

Using get_template_part() I parted some of my theme's common post templates. My post template is content-general.php. Without parting thing is going fine. But just after parting the template — ...
0
votes
0answers
30 views

How to create a link for wordpress meta datas?

I would like to create a link for "Leave a comment", which name "quick comment" (here come a ajax comment form on div). How can I do this? I have attached a picture where I'd like to put this link: ...
0
votes
1answer
282 views

get meta value from database by post id

I am just really confused how to do this, becouse I am newbie in wordpress. So what am trying to do: I have a custom form on home page and posting form value by post method. Now I want to fetch meta ...
0
votes
1answer
259 views

Any way to update_post_meta with html content? It gets stripped and becomes empty

So I am cloning some divs created from an array using jQuery. Here is an example. I have a drop down list that contains items to add to the meta box. The add button clones a hidden div based on the ...
0
votes
0answers
98 views

Custom Field: Display only if a specific key is selected outside the loop

I might be doing this all wrong. I have a custom field called "enable_adsense" and the value can be either "yes" or "no" What I'm trying to do is display something if the value is "yes" and something ...
0
votes
1answer
154 views

How to get specific post meta by title or id

I have register bellow custom post type in function.php and I am using Advanced Custom Fields. Using advance custom field type I have added one image field and assigned to my Release custom post type. ...
0
votes
2answers
2k views

Add a meta description to home page?

I have the theme Hatch and I can't figure out how to change the meta-description of the home-page. It is not an actual page, it is the default view for posts. Have searched everywhere for an answer ...
1
vote
1answer
543 views

Create digital-virtual-downloadable WooCommerce products from the frontend using Gravity Forms? [closed]

A little background about my issue: I'm running WP + WooCommerce + Gravity Forms and want to enable users to create WC digital-virtual-downloadable products from the frontend using GF. Essentially, ...
1
vote
1answer
585 views

Create Multiple File Upload Metabox in Wordpress

I am trying to create a metabox to upload multiple files (can be images or files). Currently I have the upload field and its working fine until the time we press upload and save the data. The only ...
0
votes
1answer
360 views

Cannot Save MetaBox Data in Custom Post Type

I've been working on this issue for quite a while and am truly stumped. Below is all of the code for my custom post type: /* Services Post Type */ function services_post_type() { $labels = array( ...
2
votes
2answers
182 views

How to allow hidden custom fields to be added from wp-admin/post.php?

I know that using an underscore in front of a custom field name hides it from display on the front-end, e.g. _custom_field_name. In my experience, WordPress also prevents one from adding such a custom ...
0
votes
1answer
288 views

add unique string as custom-field to every post

I need to assign a unique identifier string eg. 524bbc5a3771d to each and all posts (unique string for each post) in my site. So I tried to put together a code by picking up bits and pieces from here ...
0
votes
1answer
289 views

Can't sort order of wp_query with 2 meta keys

I'm trying to display custom post types by excluding the sold ones but also by displaying them in alphabetical order from the county meta_key. I'm trying to use pre_get_posts but I'm not sure that ...
0
votes
1answer
181 views

delete duplicate meta_value with same post_id

I've trying to cut down on the time to query a custom post type. After looking at the database and the wp_postmeta table, for some reason, there is some duplicate meta values for the same post_id and ...
0
votes
1answer
677 views

delete post meta by AJAX

I make meta box to delete a specific post meta key for the post by AJAX i make a button when click , delete the key from DB by AJAX add_meta_box('delete_test_key', 'delete test key', 'testdel', ...
0
votes
3answers
242 views

Using preg_replace to filter custom textarea

I am developing a custom post type, which, among others includes the possibility of sending an email from within the post editor. The email body textarea is populated through a custom settings page ...
0
votes
1answer
115 views

How do I insert a new meta key / value pair, but only if another meta key is present?

I need to add a new meta key and value part only on posts where another key is present (regardless of its value). I tried to use a query to automate it, but my SQL is quite limited Here's what I ...
2
votes
1answer
149 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 ...
0
votes
1answer
152 views

Exclude a category from the filed under list

I have a site where I have a category that I'm using for some backend functionality. However, when I'm viewing a post that is in that category and other categories, I don't want to see that category ...
0
votes
2answers
158 views

HM CMB: Post Select Field for CPT ID

'm using human made's custom meta boxes framework (https://github.com/humanmade/Custom-Meta-Boxes). Using the post select: array( 'id' => 'example-field-post-select', 'name' ...
0
votes
1answer
34 views

Media library orphans

I have this conditional statement that checks if an image has been added to a custom post type and if it hasn't it inserts a default image. if ( get_post_meta( get_the_ID(), ...
0
votes
0answers
84 views

when saveing $meta_box i get Undefined index error

I need help to fix these Notices: PHP Notice: Undefined index: person-name in testimonials.php on line 112 PHP Notice: Undefined index: position in testimonials.php on line 112 PHP Notice: Undefined ...
1
vote
0answers
73 views

Add Embed.ly API objects to post_meta on update

I created a new post type fr_news for adding news to a site. The user inputs a URL, and what I want it to do is use the Embed.ly API to display the news. I've got the API side figured out. Here's the ...
0
votes
1answer
692 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 ...
0
votes
1answer
108 views

how to fire join query with post_meta

I have print sql query that runs within 'posts_where' filter and its like: SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'shop_order' AND post_date >= '2013-08-26' AND ...
0
votes
1answer
299 views

saving/reading custom field value does not work - no value gets POSTed

I am trying to add a custom field to all my posts and of course saving/reading the value. As a starting point I took the example from the Wordpress Codex and stripped it down to bare bones. I know it ...