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

learn more… | top users | synonyms

0
votes
1answer
450 views

Custom fields to save multiple values

I’m adding custom meta-box, by means of jquery I can create in it several custom fields with a key “test”. There can be one or several custom fields, but the key is only “test”. I can also delete key ...
0
votes
1answer
110 views

Unfiltered html with update_post_meta

I have buddypress installation. When posting an acitivity, I'm including some data (html) as meta. Let me show some code: this is an action triggered when acitivty is posted. function ...
0
votes
1answer
81 views

Change the contents of a dropdown through the admin panel?

I have a custom post type "Events". In Events, I have a custom field for "Place" which is a dropdown list. Is there a way to edit the contents of the dropdown list through the admin panel or is ...
0
votes
1answer
76 views

How to add post meta to post permalink with still keeping a good performance?

the following problem - I want to completly change my post permalink structure to be like this: www.example.com/%post_id%/%post_meta_value1%-%post_meta_value2%-.... It would even be more nice to ...
0
votes
0answers
221 views

Using a query to display custom post types based on ACF post_object

Basically the set up I currently have is two sets of custom post types which are: uc_university and uc_course I'm having lots of trouble trying to display a course based on a my Advanced Custom ...
0
votes
1answer
36 views

Getting WordPress to store 0 values for custom post type meta

I've created a very complex custom post type system for a football website and am using custom meta boxes to store various match stats. To decide whether or not I should display a stat I check ...
0
votes
3answers
314 views

Can't publish custom post type - “You are not allowed to edit this post.”

Hey guys I've created this post type but when I click the publish button I receive the message: You are not allowed to edit this post. Have I done something wrong in my code to disallow anyone ...
1
vote
1answer
77 views

Get posts between custom dates

I created an event CPT and a meta box with a date. I saved the date as post_meta in the form dd.mm.yyyy. Now I want to create a shortcode that queries all posts which's dates meet the condition ...
0
votes
0answers
46 views

Unsetting/Removing custom meta data on a page

I've made a custom meta box where you can upload an image attached to the post. I've done this since the image isn't placed in the normal content area but separate. /*** Custom post upload ***/ ...
0
votes
2answers
95 views

How can I show custom field according to taxonomy?

How I can show custom fields in my theme according to category? For example in Laptop category show some custom fields and in Motherboard category show another fields.
2
votes
2answers
505 views

Meta query with boolean true/false value

I'm trying to show all rental properties, first by all properties that have not been rented, and then by all properties that are currently rented. There is a custom post type 'rent' with custom post ...
0
votes
0answers
150 views

Importing into wp_postmeta

I am converting a custom site to WordPress but I have a problem. I have about 20,000 posts for one Custom Post Type that has custom fields for both "source_name" and "source_url". Both these Custom ...
0
votes
0answers
375 views

How to upload images as custom field with meta box?

With this sample of code I want to demonstrate that, my meta boxes are working well, entering data into database (postmeta) with the post, except the image files. They are passing the filenames only ...
0
votes
0answers
107 views

Editing does not change post_name

Suppose I wrote an article, "My Article Title", it has been saved into the database with $post_name=my-article-title , and the permalink is mysite.com/my-article-title. All good. Now, if I didn't ...
1
vote
1answer
284 views

Combine multiple custom field values into single value

I'm sure this is a fairly basic question but I can't seem to get it right. I have multiple custom field values for addresses in my custom post type and I want to save them as a single value or array ...
1
vote
1answer
47 views

Is it possible to paste a link without tags and make it directly a link in a post?

So for example: if I post http://testeteststetetst.com, it won't make it a link if it's a post. If it's comment, it does make it a link... Now, I want it for posts too.. Is this possible, if so, how? ...
1
vote
1answer
115 views

Restrict post edit/delete based on user ID and custom field

I've been able to prevent deletion and editing of posts based on user ID and page ID however, I need to restrict access to editing and deleting based on a custom field. Not sure how to go about doing ...
0
votes
1answer
892 views

Hide Post Meta Data on a specific category

I'm using the Canvas theme from Woothemes, and their framework (obviously.) I built a child theme and have my custom CSS segregated in a custom.css file in that directory. I've made some changes to ...
0
votes
2answers
109 views

Query posts by searching for a string in a meta field

I'm trying to see if I can make this happen with the built-in meta_query function. I'm taking a $_GET variable and want to return posts that contain that string inside the meta_key urls. So far, the ...
0
votes
1answer
71 views

Group posts by meta_key

I have a Problem with grouping meta_values. The Query looks for posts with the meta key "company". I want a unique listing of the colors like: blue red yellow array_unique was not successful and also ...
0
votes
1answer
38 views

Publish and save specific postmeta to a filtered post_type

I have multiple plugins with different post_type(s). When I save or publish, all of the custom_post_meta that belong to one specific post_type are also saving. I'd like to filter by post_type so ...
0
votes
1answer
222 views

Move Title and the Content WYSIWYG editor position

Right now, the Title is the first thing at the top of the page, then we have next the WYSIWYG Editor. I would like to add a Custom Meta Box and insert it before the title or WYSIWYG editor. How can ...
0
votes
0answers
156 views

Sort users by custom user meta value

I'm trying to sort users by a custom meta value "user_business" which is their business name that way when users are listed they're sorted alphabetically by their business name as they should be. I'm ...
1
vote
1answer
45 views

How can I sort homepage by a meta value?

I am trying to sort my home page posts by a custom meta value. I've been told I should use pre_get_posts but I seem to not be implementing it correctly. This is what I am doing: ...
0
votes
2answers
33 views

Have lots of meta for posts, is it better to get at all at once or each individually

I have a directory website and am doing a bit of a redesign/restructure. I have quite a few meta fields for each entry, i.e. address, city, country, website, where to buy their products, social links, ...
0
votes
0answers
77 views

How to create a custom field index page

I'm trying to create an index page for some custom fields, just like the taxonomy search pages. E.g. I have a custom field with slug=wpcf-delivery. I want an index page that lists all values where ...
0
votes
1answer
51 views

remove a single post_meta

I created a plugin that has multiple meta boxes. One meta box saves a single record by using update_post_meta(). Another meta box saves multiple record by using add_post_meta(). I do not have ...
0
votes
1answer
318 views

Post meta select input, if statement

I have created a meta box with a select input (drop down menu). It has a few values and I want to display different content depends on which value the user selects. I am just unsure how to display ...
0
votes
0answers
44 views

get_post_meta no longer working

I am trying to use get_post_meta to return a value from the post meta, it was working completely fine then suddenly stopped working. I've tried and checked everything and i cannot seem to get it ...
0
votes
0answers
15 views

How to bulk update META Data in posts [duplicate]

I have almost 50,000 posts in my wordpress website. I have never written the META Title, META Description and META Keywords. Now I need to write them for SEO purpose. How can I do it easily in the ...
0
votes
0answers
241 views

Sort Custom Post Type List Table in Admin by Multiple Meta Values

I have a Custom Post Type (CPT) called Sessions. The List Table in the admin for this Custom Post Type (CPT) has the following columns: Session # (post id) Session (post title) Day (CPT meta value) ...
0
votes
1answer
97 views

How to validate select field in post meta?

I want to display a select dropdown field in the post meta. How can I validate the input before saving it? Currently, I am simply saving without validating like this: if ( isset( ...
1
vote
1answer
83 views

Maintaining two permalink structures

How can I create two different permalink structures for a Wordpress blog, determined by an addition to the post meta? On the old site, articles were available through the following structure: ...
0
votes
2answers
39 views

Wordpress for questions and responses website

I am using Wordpress to create a Q&A website. The question is returned by the_content. If I store the answers as post meta field array: { [1] => 'first answer', [2] => ...
0
votes
0answers
29 views

Post with multiple 'content's and muliple comment lists

I am sorry my post looks long. I am creating a private small community for a group of authors. Their final goal is to create, online, an encyclopedy relative to the holy book. In other words, to each ...
1
vote
1answer
159 views

How to best delete orphan wp_postmeta

I'm in the middle of doing some fairly complex queries involving metadata from a custom post type. Unfortunately if any posts are deleted the metadata stays put which complicates matters as I am ...
0
votes
2answers
93 views

Which query method to use? (edit- wpdb syntax problems)

I am trying to create a query in order to get all the metadata from a custom post type named match_reports that is associated with a meta_key and meta_value in another custom post type named ...
0
votes
1answer
38 views

Array of user ids to list of user names

I'm outputting an array of user ids from metadata like so: $awaygoalby = unserialize($post_meta_data['report_away-scorers'][0]); and I want to change each user id to the user name. So I was hoping ...
0
votes
1answer
281 views

Conditional For get_the_author_meta

In post loop I'd like to setup a condition for get_the_author_meta. So if the author meta field is empty, then nothing is displayed. Below is what I have but it's not working. <?php ...
0
votes
0answers
155 views

Using mysql queries to delete custom post types based on meta_value

I am trying to create a cron job to run on my server which deletes a custom post_type (post_type = event) from my databse based on a meta_key (st_date) and a meta_value (the date the event took place ...
0
votes
1answer
131 views

How to display custom post meta in the appearance->menus page

I'm working on a website and added a custom meta option for all pages / posts called: "Location". $value = get_post_meta( $post->ID, '_privacy_location', true ); I'd like to add the value on ...
0
votes
0answers
62 views

Ranking authors by post meta value

I have custom post-type with custom post-meta and i want to rank authors by post meta value.I can show the SUM of a meta value on author page with this code <? php $points = ...
0
votes
2answers
190 views

Save post_parent in a custom post type

I'm using the save_post action to save some meta data in a custom post type: function my_save_post($post_id) { // is autosave? if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { ...
0
votes
0answers
61 views

Wordpress join posts with meta values of array type

How do I get all the posts matching meta value of type array function author_posts_join_filter($join){ global $wpdb,$wp_query; $meta_name_author = '_authors'; if(is_author()){ ...
0
votes
1answer
125 views

Get meta information from post parent

So I am in a single page and I want to get some meta information from a parent page. This code is inside my footer.php: if (is_single()) { global $post; $parent = get_post_achestor ( ...
0
votes
2answers
162 views

how to get a list of meta data fields assocaited with a custom post type

I am using a theme which has defined a custom post type-- Now, I am trying to retrieve the list of metadata fields used by that post type-- so that I can insert data via PHP code in form of that ...
0
votes
2answers
190 views

Metadata for a taxonomy - is there any WordPress way of doing this?

If I have a CPT "movies" I know I can have various taxonomies eg "Director", but how can I store further information such as "director's nationality" for any one particular director ... or is this ...
0
votes
1answer
500 views

filtering custom post types via meta data drop down

I'm trying to add drop down filters (that are populated by terms that are in use) to a custom search page for "opportunities" or listings page. Currently I am doing this with taxonomies but doing this ...
0
votes
2answers
748 views

Up/Down voting system for Wordpress

Looking in all posts with keywords "voting system, upvote, downvote", I can't find a satisfying solution for this issue, except accepting one of the available plugins, spend a lot of time undersanding ...
1
vote
1answer
383 views

WP_query posts closest to todays date

I have written an wp query which I would like to order in a bit of a complicated way. Some posts have a meta value 'the_date' which is an end date for the post. I would like to order posts in date and ...