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

learn more… | top users | synonyms

0
votes
0answers
15 views

Calculate top authors on the basis of Post Views

I wanted to calculate the Top authors on the single.php page according to the average of the posts views. I have created a function which is calculating the average of the total post views of a ...
0
votes
1answer
28 views

Assign postmeta in bulk

I have meta paramteres for my pages, which i would like to change in bulk (about 300 pages). I know that meta name is "header-settings" and values can be "no-data", "site-data" and "page-data" I also ...
0
votes
0answers
15 views

meta query always fails even if data is correct

I've following query - $query = array( 'post_type' => 'accessory', 'posts_per_page' => -1, 'meta_query' => array( array( 'key' => 'accessory-bike', ...
0
votes
0answers
9 views

Copy Image URL post meta over to Advanced Custom Fields [on hold]

I'm using Gravity forms to create a an entry on a custom post type. I'm also using Advanced Custom Fields to have all my data displayed nice & is easily editable. However, I'm finding no matter ...
0
votes
1answer
20 views

Set default Custom Post Meta Value

I've tried almost anything and just can't get this to work. I have a custom post type with a custom meta field and I want a default value to be added on when the Publish/Update/Save button is ...
-2
votes
1answer
29 views

If meta_key exists then don't select this post?

I'm trying to select all posts EXCEPT ones with a meta_key somekey. SELECT * FROM wp_posts JOIN wp_postmeta ON wp_posts.ID = wp_postmeta.post_id WHERE meta_key != 'somekey' But this is still ...
0
votes
2answers
23 views

Wordpress altering my custom query, How to fix it?

I am querying for most popular posts by custom view count by using the custom query below, <?php $mostpopular_args=array( 'post_type' => 'post', 'orderby' ...
0
votes
0answers
16 views

Performace on 1 million plus meta fields vs 1 field with 1 million multi array

We are potentially looking into building a counter in a post_type. So a post meta field wil be created with some data like total downloads and downloads left (tied to user ID). We expect up to one ...
0
votes
0answers
37 views

Sorting Posts with meta value not working

I want to retrieve most popular posts based on 'view_count' meta value, the below code doesn't seem to work, I am getting some random posts, where am I doing it wrong? <?php ...
0
votes
1answer
14 views

Getting attachments by meta value

I'm stuck at a very simple point: I need to get all attachments by a custom meta key (and value). I'm developing a short code, so it has to work on every possible page. What I've tried so far: $args ...
0
votes
1answer
32 views

Adding meta data to an attachment post

I want to add a meta data to my attachment posts, so I can get them in order by meta value later. That meta value would be 'price'. So I thought this could work: I have this args: $args = array( ...
0
votes
2answers
22 views

Get posts ordered by meta data

I have a post type gtre and metadata price. The 'price' metadata I get using get_post_meta($post->ID, 'key', true)["price"]; So I don´t know how exactly should I write the args for WP_Query ...
0
votes
1answer
29 views

How to calculate the average of a post meta value(Numeric) of a specific author

I am having a website which is currently consist of multiple authors, Currently my website is having a module to count the total no. of views and i am storing this value in post meta as a ...
2
votes
0answers
33 views

Efficient way to save a lot of meta data

im currently developing a plugin that will read an external xml, and convert the data to a custom post type. Each post needs around 50-60 meta_fields. Right now im looping through each piece of needed ...
0
votes
1answer
27 views

Displaying a div from an assigned meta_value when on a page

On my website I created a custom metabox that is being displayed in the post type "page". The metabox will display a checkbox and 4 url fields. The checkbox will control the visibility of a div ...
1
vote
1answer
40 views

Get attachment by meta_key value

I need to get the attachment (will be only one per post) associated to a post with meta_key wpcf-legislacion-gratis (not matter the value the column has) by using a custom query using get_posts() ...
0
votes
1answer
8 views

Echo custom post meta from options array

The code below comes from: var_dump(get_post_custom($post->ID)). How can I echo the value of artist_seo_description from my PHP script? array(5) { ["_edit_last"]=> array(1) { [0]=> ...
0
votes
1answer
28 views

How to Update post status using meta data in Custom post TYpe

I have custom post type and have some some meta field it. I have a select field 'Publish' to change post status. if I set it 'yes' and click on Update button then post will be published and if i set ...
0
votes
0answers
40 views

Simple WP_List_Table won't return posts, let alone custom metadata

So, I am trying to create a simple WP_List_Table to return custom metadata from a custom metabox created by a plugin I developed. As of now, I haven't added any of the columns for the custom post ...
0
votes
1answer
25 views

Filtering by multiple conditions in the loop

I'm trying to filter the posts in my index by multiple conditions. So far I've tried with this: <?php $query = new WP_Query( array( "post__not_in" =>get_option("sticky_posts"), ...
0
votes
1answer
38 views

Can A Post Meta Field Store multiple values that are not in an array?

I have a post_meta field that seems to be displaying multiple values, yet they do not seem to be in an array. Using debug bar, this is what I see inside of the ...
0
votes
2answers
50 views

Wordpress custom post type

hello i have post_type "product" and taxonomy "price" can someone help me to query that custom post type with the selected taxonomy? my current code is like this <?php $term = get_term_by( ...
0
votes
0answers
20 views

Use more than one post meta inside the loop

I have custom meta like this: I want to select the post with both of these conditions are true for : 1- end_date = "some date" 2- st_date = "some date" Also I need it to select by title ...
0
votes
1answer
22 views

Metabox of one post influence setting on other

This great answer by David Gard allowed me to have a metabox sticky (checkbox) for posts that could only be set (checked) on one posts in the loop at a time. If post A has that meta box checked, then ...
0
votes
1answer
35 views

wordpress sorting using array merge by price in ascending order but price with 0 must be show last

I'm using below code to filter the query on page and sort the post in ascending order by price. I'm getting desire output but my concern is , i want all price with 0 at last. <?php global ...
0
votes
0answers
11 views

Displaying randomly created meta values in wysiwig editor

I have already asked this question on stack overflow but I'm asking it once again here because i haven't found a solution to it yet. I am creating custom meta info for a post that will have null ...
0
votes
0answers
35 views

Query postmeta values, and return multiple post_titles for common meta value

As of now I query the DB: global $wpdb; $query = $wpdb->prepare(' SELECT p.post_id, p.meta_value, pm.post_title FROM %1$s AS p JOIN %2$s AS pm ON ...
-1
votes
3answers
50 views

Custom Post Type meta value is being saved in array, instead of just the string (as value)

So, this is how WordPress is saving my CPT meta: array(8) { ["product_id"]=> array(1) { [0]=> string(10) "abcdefg987" } ["end_date"]=> array(1) { [0]=> string(10) "02-02-2015" } ...
2
votes
2answers
101 views

How to make custom post meta wp_editor translatable?

I have custom post type named soto_property in which I have added three wp_editor as post meta, using this code - wp_editor( htmlspecialchars_decode($valueeee1), 'propertyEditor1', ...
0
votes
1answer
22 views

Value of post meta dropdown is not showing in Wordpress

I have a select dropdown in my post meta in which I am getting post ids of all post of another custom post type. see below code- <select name="property_type" id="property_type"> ...
0
votes
0answers
13 views

Post Meta Checkbox won't save

I'm trying to use the script as per How set featured posts using checkbox in post edit screen? function register_post_assets(){ add_meta_box('featured-post', __('Featured Post'), ...
0
votes
2answers
53 views

How to sanitize select box values in post meta?

I have added a select box in the Post meta. Here is the code, and it works fine. My question is, do I need to sanitize the values before updating the post meta? If yes, how it should be done? This is ...
0
votes
1answer
46 views

Best way to check if a post with specific meta exists

I am building a function in wordpress that reads an XML file and imports 100-500 events as a post type to wordpress. The events have a lot of meta data that is saved as post meta. One of the meta data ...
0
votes
2answers
41 views

Get meta info related to current post

I'm trying to get the meta info by key rw_related_link for each post but my code is wrong since instead get the ones related to the current post I got the same in all post and that's wrong. This is ...
0
votes
1answer
19 views

Act on user meta updated, but only once

My plugin is calling a third party over http whenever a users meta data is updated. To do this I am using the updated_user_meta hook. It seems however that that hook is called multiple times, once ...
2
votes
3answers
54 views

How do I remove all the metaboxes for a custom post type?

What's an effective way of removing all the meta boxes for a specific post type in Wordpress? The only solution for removing metaboxes at all that I've found seems to be the remove_meta_box() ...
0
votes
0answers
54 views

Save multiple custom post fields from quick edit

Context: A multiple custom posts and custom fields website. Since the website is rather complex, has a lot of users, a lot of editors and a lot of data, they asked to be able to choose which custom ...
0
votes
0answers
43 views

Show posts between two Custom Fields date

I'm trying to fetch all the posts from today to next week by using some custom fields inside posts, using Advanced Custom Fields. Everything was working until now, because it doesn't show posts from ...
0
votes
1answer
28 views

Advanced Custom Field — grabbing post_meta from previous post

Say I have an acf called "show_this_tomorrow" every day (in a new post) I put some data into the field. And I want to show that data output on the next days post. I was thinking I'd use this to grab ...
0
votes
1answer
39 views

Edit post meta direct from post.php?

Does anyone know of an easy way to be able to edit ALL of a single post's meta at once ie on the post.php &action=edit page? As some of the meta has been put in there with the update_post_meta() ...
1
vote
1answer
52 views

Advanced Meta Query for Large Calendar Website (12k+ posts) (175k+ wp_postmeta rows)

The Problem On a site I built, I opted to use custom fields instead of a calendar plugin to organize my posts in a "calendar". In the beginning this seemed like the most logical way to accomplish ...
0
votes
2answers
34 views

Looking for suggestions on creating simple database (Help!!)

I'm working on creating a basic database for a theatre and really need some suggestions as the best way to approach this. Each production from this theatre will have its own page. The page should ...
0
votes
1answer
46 views

Hide the_meta if no value

I would like to have post-data associated to posts and displayed on my blog. I added to single.php (as seen here: http://codex.wordpress.org/Function_Reference/the_meta) and all the metadata is ...
0
votes
1answer
37 views

post_title in save_post action

I use save_post action to save meta field and to check if post title is set. So I check the value returned by empty($post->post_title) but I get true also if I set the title.
0
votes
1answer
45 views

How to add a meta information to the URL?

I need to put a post meta information to the URL: www.website.com/custom-taxonomy/postname-[metainfo] How to change the rewrite rules, that the content of this meta information is added to the URL? ...
0
votes
1answer
43 views

Get all metadata for a given custom post type

I'm using a plugin that allows me to add people profiles as a custom post type, with several custom fields used for specific information. These posts are then output via shortcode on the relevant ...
0
votes
1answer
95 views

How to set YouTube video as featured image?

I am trying to have all my posts with post_format set as video, have said video as the featured image. Here is what I am working with thus far but I need some help: if($post_format == 'video') { ...
0
votes
1answer
48 views

Saving custom image meta fields

I have currently added a custom meta field for uploading a media file (image). I can successfully add the upload button to display and work but I'm having problems saving the field when updating the ...
0
votes
1answer
28 views

How to get several fields from wp_query?

I'm going to get several fields from wp_query result. I know about wp_list_pluck() function, but it accepts only one field paramether. How to get several ones if I'd like to take several parameters ...
0
votes
5answers
111 views

Best approach to create Hot and Trending sections

I am going to implement a Hot and Trending section on a website. I have seen such sections on many popular websites but can't really figure out how exactly this works. Although I assumed Hot section ...