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

learn more… | top users | synonyms

4
votes
0answers
76 views

Get ID of a page containing secondary loop in content

I am trying to get the ID (outside of loop) of a page which have a loop of another CPT within its content using a shortcode. If I do a print_r of get_queried_object(), all I get the args used to ...
2
votes
0answers
128 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 ...
2
votes
0answers
676 views

Copying Custom Meta Values from existing post to a duplicate post

I'm trying to revise an existing WP plugin BU Versions to accept different custom meta field values from items I've set-up using the Advanced Custom Fields (ACF) plugin. BU Versions will copy over ...
1
vote
0answers
24 views

WPDB Multiple site's posts and get featured images

I am using the code below to query 5 Wordpress sites for their posts, merging them into an array, sorting the array by date, and then displaying them: //SITE 1 $mydb = new ...
1
vote
0answers
17 views

Show Custom Post Type meta boxes only on Page Edit

I've went through the laborious process of creating the CPT. I see it on the sidebar of my WP install, I can add new, save data, and on frontend I can output the data. Is it possible with WP to move ...
1
vote
0answers
30 views

Get draggable widgets on Edit Post page

Is it possible to get the widgets with settings (just as widgets.php page) on the Edit post (like attached image) ? There i can define a custom sidebar in post meta. However how to get the list of ...
1
vote
0answers
37 views

Default Custom Field Value Automatically Update

I have created a hidden custom field with a php function as its value. Like so -- $value_rating = get_post_meta($Property_Id, 'vr', true); <input type="hidden" name="vr" class="form-control ...
1
vote
0answers
15 views

Show values of custom post meta on 'Add new post' page?

I am developing a website in which I am giving my users a separate profile. Their profile includes a dynamic slider. I made a custom post type named 'Slider' and added all images using: ...
1
vote
0answers
33 views

How can I create a WP_Query that returns posts where one meta_value <= another meta_value

I have a working, pretty complex SQL query hand-written in a function. For the sake of leveraging WP_Query optimizations, and simplifying my code for maintainability, I'd like to convert it all to ...
1
vote
0answers
92 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 ...
1
vote
0answers
238 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: ...
1
vote
0answers
102 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', ...
1
vote
0answers
412 views

Compare meta_query with a Regular Expression and do a less-than operation on it

I have the problem that my client is using a theme which stores options of items in a serialized way in the post_meta table. I already found out that this is not the best way to save values ...
1
vote
0answers
67 views

Post MetaTable Overload

Anyone run a wp site with a large amount of post meta data? My site uses ACF with several custom post types and at least 20 custom meta fields with each of my custom post types. I have over 1000 ...
1
vote
0answers
109 views

Custom RSS Feeds & Post Meta Data

Rss feeds normally display media files along with post excerpts. I am using post meta to add media files to a post. Unfortunately, since the audio file is not being inserted into the main textarea the ...
1
vote
0answers
109 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 ...
1
vote
0answers
992 views

Custom WP_Query for WordPress Search Results with meta_query

I am using a custom query to generate my search results. The code I am using works perfectly without the meta_query variables in my arguments array. I am trying to compare multiple custom fields with ...
1
vote
0answers
168 views

Attach time/date stamp on add_post_meta

we have an image viewer on our website where admins can tag images thought ajax (new feature on Wordpress 3.0). We are tagging just fine, but we need to filter when they were tagged. We are using ...
1
vote
0answers
103 views

How to increase load time of an archive/search page (WP_Query)

I'm currently looking at why the archive and search pages take so long to use, and have found that the bulk of processing time is spent on the query_posts that is called before the template has even ...
1
vote
0answers
112 views

Function to update post_meta based on existing post_meta

I have a custom post type for addresses on a Google Map. One meta field is for the address, but I want to convert that address to longitude/latitude. So I have a meta field for longitude & one for ...
1
vote
0answers
346 views

Querying posts with meta value that begins with a certain pattern

I am trying to create a search filter using meta_query. The only problem I'm having now is that I can't compare with wildcards. I think that's how you word it? $keyword = 'sos'; $tlds = ...
0
votes
0answers
15 views

Dynamic Custom Fields

I am working on a custom invoicing system for a client. I am looking for the best way to implement adding products dynamically to the invoice in the wordpress admin. There are hundreds of products ...
0
votes
0answers
23 views

Using esc_html for textarea inputs

I am using the following code for a variety of input fields, building a CPT for a theme: function display_meta_box_from_cpt <input type="text" size="80" name="imgurl" ...
0
votes
0answers
8 views

Set all values of given meta_key in postmeta?

I have a custom post type to which I attached several fields of meta data. On a given action in the admin, I need to be able to reset the values of a specific meta_key in that meta data to zero for ...
0
votes
0answers
11 views

Button inside a custom meta box which deletes post meta

I have a custom meta box which allows a file upload. I want to add a button for my users to be able to remove the file (or at least clear the meta data for it). To delete the post meta, I know I can ...
0
votes
0answers
21 views

Filter question list on substring of metavalue

On the admin page I want to filter posts based on meta values. I know using the pre_get_posts hook will allow me to filter based on specific meta values, however I want to filter on a certain ...
0
votes
0answers
21 views

Find page metadata in database

I want to insert metadata to custom fields (from "advanced custom fields" plugin) manually (with wp_update_post_meta). I need to know how the meta value strings look like so I can insert this kind ...
0
votes
0answers
16 views

Edit is changing my custom's post type parent id

I'm having a custom post type (vehicle) and i attached a gallery (post) with image attachments in it. Through my custom frontend form, I set all the post and postmeta details right, as i want to, so ...
0
votes
0answers
14 views

Trying to automatically set woocommerce product dimensions on save if left empty

So I'm trying to automatically set product dimensions & weight on a site if they're left empty, WooThemes told me I can use this as a starting point but the rest is out of their support scope. ...
0
votes
0answers
40 views

Show posts in numeric price order using meta query combining 2 meta keys

I've built a custom estate agency website for a client but I'm stuck on this one last thing before it's good to launch. I'm using custom meta fields to allow for additional meta data such as Price, ...
0
votes
0answers
8 views

Generate meta_value programatically for thumbnail in Ruby

I am inserting posts in wordpress db using ruby. The problem is that adding a post thumbnail, there is a met_value field in post_meta table that has an auto generated hash which looks like ...
0
votes
0answers
30 views

Insert image caption (metadata) in shortcode in functions.php

I've created a shortcode that displays a random image given that certain parameters are filled, like img url and number of images to random through. It looks like this: function randimg_shortcode( ...
0
votes
0answers
96 views

How to find field key name of meta values ?

Using visual composer to create custom grid elements made me wonder: how can I find the field key name of a meta value ? I need these to include in a template of a grid element or for different ...
0
votes
0answers
21 views

Custom Table for custom post type meta data

I'm looking to store the meta data for a post type in a uniquely named table. You see I have a site with a large amount of custom post types with a large a mount of custom fields. I want to clone ...
0
votes
0answers
7 views

How to use Wordpress Functions in php file linked to email piping

I'm writing an plugin to add meta data to a post when I receive an email. So far my plugin receives the email correctly, but I need the WordPress functions to update the metadata. I can already get ...
0
votes
0answers
31 views

WP_cron not updating post meta, instead clearing it

I'm trying to store social media follower count (ex. FB fans, Twitter followers) in post meta daily with wp_cron. If I manually save the post it will save the social media count numbers correctly in ...
0
votes
0answers
16 views

Problem saving meta data

I'm making my first WordPress plugin. I used an example to save text that an administrator enters when submitting a new post, but the meta data is not saving. Can anyone help on that? /** * Adds a ...
0
votes
0answers
41 views

Create a Gallery and update Post Parent of Attachment Images

I need to create a gallery for a custom-post and update the post_patent of every image with the new gallery ID function create_tfuse_gallery_group($post_id) { if ( get_post_type( $post_id ) == ...
0
votes
0answers
25 views

Query all posts sorting first by the ones that match criteria, then the rest

I have two custom post-types 'office' and 'work'. A work is made by one office (I store the office ID in a meta of the work, named OFFICE); Now, in single-office.php, I need to list all the works, ...
0
votes
0answers
26 views

Search on Category and BETWEEN custom meta field

Background I am building simple car theme where I want to review cars, however, I'm really struggling with my search implementation. I have added a couple of custom meta fields to the post including ...
0
votes
0answers
18 views

Ordering results by last login date

I want to order posts by a post meta field and last login date. Here I use a custom post type called 'Agents'. Agents is a user group and they can login through frontend. For Agent logins, I record ...
0
votes
0answers
27 views

How to link images to a certain property type

I've build a web page, in which an user certain data; the user can add also images, and once everything is done, he/she clicks submit and a Property post type is added. The problem is that the images ...
0
votes
0answers
101 views

Add post meta to search in admin of a custom post type

I am using woocommerce in a wordpress theme and I can't get the search functionality in the admin to include a meta value of 'shop_order' custom posts type. I've been trying to modify the following ...
0
votes
0answers
72 views

How to get meta value based on latest post id with group by term name

my query is SELECT terms.name as artist_name, wposts.ID,wpostmeta1.meta_value as image FROM wp_posts wposts LEFT JOIN wp_postmeta wpostmeta1 ON wposts.ID = wpostmeta1.post_id and ...
0
votes
0answers
47 views

How can I get the $key / $value pairs of custom fields that were added via 3rd party plugins or themes?

I'm running WP Job Manager plugin which is designed to allow its custom post type fields to be altered within a theme or plugin via custom filters. I have added my own custom fields (example) and the ...
0
votes
0answers
27 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
0answers
51 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() { ...
0
votes
0answers
115 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 ...
0
votes
0answers
57 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
0answers
23 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?