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

learn more… | top users | synonyms

0
votes
1answer
73 views

How can I hide the category term for posts with none set?

I'm trying to hide the word "Category:" from the metadata on the Twenty-Eleven theme's footer, when I don't have one set for a given post (sometimes I will manually remove the "Uncategorized" ...
1
vote
3answers
92 views

get_*_meta doesn't always return an array

I find it annoying that functions like get_user_meta or get_post_meta will return an array if the meta key exists or false if it doesn't. This means I need to do a check like so: $meta = ...
0
votes
1answer
101 views

Remember the meta value with radio buttons

I've created a simple meta box consisting of two radio buttons: yes or no. When they click on the appropriate box, it saves the meta value to the database. However, the post page does not remember it ...
0
votes
1answer
81 views

Timetable of Custom Meta Data using Custom Post Type and Custom Taxonomy

Scenario: I have a custom post type with custom meta boxes. Each post should represent a row in my table i.e Activity 1 Jan, Activity 1 Feb and Activity 1 Mar I have a custom taxonomy of terms ...
0
votes
1answer
2k views

Search custom post type by meta data

I have a custom post type 'Property' which my users need to be able to search by meta data. I have 3 search functions - 2 on the frontend 1 in the admin area - 2 of which are running as expected and ...
0
votes
1answer
84 views

The loop starting at a certain ID

Is it possible to start the loop from a certain post ID? I would like to get all the post starting at a certain ID, decendingly. To explain, I have to make sum assumptions first. Assume that my ...
0
votes
2answers
93 views

Short of raw SQL, can I query for multiple attachment metadata that have a given array key?

With raw SQL through $wpdb, I believe that I could do something along the lines of this (untested): SELECT post_id, meta_value FROM postmeta WHERE meta_key = '_wp_attachment_metadata' AND meta_value ...
0
votes
0answers
32 views

Cannot save post meta data as Administrator in Wordpress

I have an wordpress installation at yogazoga.com with several custom post types. When i try to add meta data to posts through admin panel it simply does not work. See the post at: ...
1
vote
3answers
662 views

Custom post type category not displaying in custom post type

I've created a new custom post type (lets call it "Reviews") on the backend of my Wordpress. It works fine for the most part but the Categories I create within that Custom Post Type are not displaying ...
0
votes
1answer
103 views

How can I prevent the post_modified column in wp_posts from being updated?

On my site, I display each post's Last Updated date instead of its Published date in order to let visitors know how recent the post is. I'm currently developing a new theme, and some of the features ...
0
votes
1answer
40 views

How can I use 'orderby' => 'meta_value_num' to order by the numerical value even if the value starts with a word?

I'm using 'orderby' => 'meta_value_num' to order some boats I have as a custom post type, the meta values ordered by, are boat models, which are normally just numbers but if you look at this page: ...
0
votes
1answer
828 views

Update value of a associative array with update_post_meta

I am trying to change the value of a specific key of an associative array which was saved in my post meta. This is how my array is saved in a custom field: Array ( [0] => Array ( ...
0
votes
0answers
506 views

Adding custom fields to the Quick Edit screen - puzzled about the column concept

We've been told that: The quick_edit_custom_box action hook will not fire unless there are custom columns present. (Source^) If so, then adding a custom field edit functionality to the Quick ...
0
votes
2answers
89 views

How to update the 'modified_time' of a post ONLY when content is changed?

For some reasons I show the Last Modified information to my users in the blog. Recently I have to clear up my categories and tags, but these actions will result in the update of 'Last Modified' field ...
0
votes
1answer
294 views

Display meta data from a custom field within plugin Category Grid View Gallery

I am using this plugin, which creates a gallery of posts, fetching a thumbnail and the titles of the posts displayed in it. I have enabled Custom Fields, and have created (and filled in values) a ...
0
votes
0answers
91 views

Filter plugin posts by meta value

I am a WordPress beginner, but have a few years of software development experience. I have a WordPress plugin used to display custom data via a custom post type. The index page contains something ...
0
votes
1answer
85 views

Get post id in Post Page within Wp-admin

I want to get post ID within Post page. I need this for custom meta box so i can set the id in shortcode. I can show the result in notices but don't know how to make it global to use for meta input. ...
3
votes
2answers
1k views

Custom field values deleted when trashing custom post type

I've created a custom post type with 2 custom fields attached to it... When I create a post of this type and fill in the custom fields, the data is, in fact, saved to the db... However, if I trash one ...
2
votes
3answers
492 views

How to access the post meta of a post that has just been published?

I am using the hook publish_post to run my code where I need the post meta of the just published post. But the post meta value I am looking for is somehow not available at this point of execution. On ...
0
votes
1answer
108 views

Compare 3 custom fields and sort by oldest

I am building a movie archive. For each movie I am filling out the release dates for 3 countries, they're stored as custom fields (added via Pods) Now, when listing the movies I would like to build ...
0
votes
1answer
62 views

Meta box with front-end styling

I have a specific Gallery post of products that I release at the start of every Monday on my website, which differs from my other Gallery posts. These types of Gallery post don't require the Authors ...
0
votes
1answer
147 views

wordpress simple post multi rating with post_meta and user_meta

I am trying to create a multi criteria post rating function with simple form and post_meta and user meta. The Goal when users submits their ratings 2 things should happen: 1.the ratings is stored ...
0
votes
0answers
154 views

Show/Hide Custom Meta Boxes using any plugin

How can I show and hide the custom meta fields created using Advanced Custom Fields plugin? I want to handle the publish and unpublish of the fields and values from the admin panel. Is there any ...
0
votes
2answers
296 views

Sanitaizing Select Optin For Custom Post Type Metabox in WP

Using WordPress 3.8.1, I have a Custom post Type called "Map" and it contains a Metadata which is a Select options element as: <label for="my_meta_box_select">Countries</label> <select ...
0
votes
3answers
232 views

How to Echo Metadata Value in Currency Format

I have a Custom Post Type with a Metabox and an input Text field for adding "Price" to the posts. Now I would like to display the input value which can be like 49 or 59 like 49.00 or 59.00 so far I ...
0
votes
2answers
134 views

Issue on Working with Metabox - Checkbox to enable Sale Items

Using WP 3.8.1, I have a Custom Post Type which is called "Sport" and it has a Metdabox - medata data as I do not need to set up online shopping but I world like to add Price of my products to any ...
0
votes
1answer
118 views

If custom field doesn't exist, or exists and it's true show title?

Im trying to add new feature to the theme and that's show/hide page title,but since i already have about 50 posts i can't go to all of them and save again just to save custom field values. So i tried ...
0
votes
0answers
260 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 meta ...
0
votes
2answers
210 views

Filter posts by tax (dropdown) and meta value

I'm having a page on which all my custom post types are displayed. I now need to add another to the existing ones: $args = array( 'post_type' => 'bkroadkill', 'post_status' => ...
0
votes
0answers
54 views

Use and get custom user metadata

I wanted to check if a post custom field matches the logged user's custom metadata. If it does then list only posts that match. I think that's possible.
1
vote
1answer
145 views

populate post meta in gravity forms [closed]

I can populate post author email with this code: add_filter('gform_field_value_author_email', 'populate_post_author_email'); function populate_post_author_email($value){ global $post; ...
9
votes
5answers
15k views

How can I show posts only if meta_value is not empty

Three people have already tried to solve this, and we're coming up nil. I want to show only posts that have a value in the meta_key 'featured_image'. So... if 'featured_image' is not empty, show the ...
0
votes
1answer
57 views

Meta box losing its value when scheduled post is published

I've created a plugin with a meta box that has a check box and noticed that when a post goes from scheduled (future) to published the meta is no longer checked. When I schedule the post and check the ...
0
votes
0answers
99 views

Advanced Custom Fields: wp_get_attachment_url not working, attachment page says “Missing Attachment”

I used Advanced Custom Fields to add a file upload field to a custom post type. I have the following code in the template for this custom post type: $file = get_field('file'); echo ...
0
votes
0answers
38 views

How to re-run the main query based on meta data value?

When a user requests a custom post url like */books/best-book-eva, I want to (with a plugin) hook in before the page is displayed (and the main query run if possible) check that posts meta value ...
0
votes
1answer
72 views

Is there a filter for get_post_custom()?

I know there's a filter get_post_content that I can hook into, but that only seems to work with get_post_meta, I need to filter individual values of get_post_custom() by checking if the metadata key ...
0
votes
1answer
70 views

How to rewrite CPT-Permalinks the correct way (incorporating meta-box-data)?

Using the below hooks, I tried to rewrite the permalinks of my custom post type magazine_issue to be made of values of additional meta-fields I added to the edit screen. The problem with my actual ...
2
votes
0answers
81 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
73 views

How do I delete element from a serialized array upon deletion of a post?

I want to delete an element (post id) from a serialized array associated with a specific meta_key. The following screenshot tells the whole story. What you're seeing are, post ids saved in a ...
0
votes
3answers
214 views

Order by a meta fiel 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
2answers
181 views

Front end file upload returning wrong attachment url

So I'm making a simple file uploader with wordpress where users don't need to go into wp-admin to add a file. I have it working great, it uploads the file to the correct folder..etc but the only ...
0
votes
2answers
451 views

Author_meta ONLY if it exists

I'd like to ONLY show the authors website link if it exists, but I can't work out the exact syntax for it. I have this if ( get_the_author_meta('user_url') ) : // If a user has filled out ...
0
votes
0answers
22 views

How to sort post_meta in edit.php?

I have Custom Type cpt1 and Custom Fields cf1, when you use hook manage_cpt1-bien_sortable_columns, wordpress don't sort the post_meta ?
1
vote
4answers
2k views

WordPress is stripping escape backslashes from JSON strings in post_meta

I thought I was making my life easy and being future-conscious by saving some content as bits of JSON in custom post_meta fields. Unfortunately, WordPress doesn't agree and is making my life ...
0
votes
1answer
1k views

Adding custom fields (post meta) before/during wp_insert_post()

Our code base has a ton of logic that executes as the post is inserted/created. However, some of that logic depends on custom post meta. The only way I know of to add post meta to a new post is like ...
1
vote
1answer
1k views

advanced custom fields update_field for field type: Taxonomy

I need to insert a post via wp_insert_post and then add relevant post_meta - however, the WP admin has been customized with the excellent ACF. I know I can add_post_meta in this way: add_post_meta( ...
0
votes
0answers
63 views

Unsure how to add simple checkboxes that write to a small table to admin

I've been doing a lot of reading on the add_meta_boxes...but there's so much information that I'm confused about when to use them. I have a little plugin that writes out some checkboxes and then when ...
0
votes
1answer
182 views

Set Checkbox as checked by default

I want to add a checkbox in the post meta and set it as checked by default. I am trying following code, but it does not display the checked box by default. However it saves correctly and after saving ...
0
votes
1answer
64 views

Rich Custom Field for Custom Post type not saving

I am new to creating meta boxes and I am trying to create a custom field meta box that is connected to a custom post type which is created by WooTheme Sensei (Post type = lesson). I am trying to use ...
1
vote
1answer
769 views

How to implement a Google map store locator

I have followed the following Google developer doc about creating a store locator usng PHP & MySql. https://developers.google.com/maps/articles/phpsqlsearch_v3 I have this working but now I ...