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
7 views

How can i get multi checkboxes value in metbox?

I make list of check boxes by WordPress meta-box and i can not get this value in my theme. i can get my text value with this code <? echo get_post_meta($post->ID, $prefix . 'text', true); ...
0
votes
0answers
11 views

Send POST variable with 'post_publish'

I have a custom button which triggers my page builder to load on the post.php page upon clicking it. However, I want to send a variable as well with it. Here's what I tried $('#post').attr('action', ...
0
votes
1answer
14 views

php wp_insert data on front using a form

I'm using a form on my website to allow user to create posts on my wordpress admin. It works fine, but I have an issue, I don't get the tags meta inside my admin. here is my php code : <?php ...
0
votes
1answer
38 views

Comparisson between date() and a date from wp_postmeta

I am using the calendar plugin: "The Events Calendar", and is trying to get the events that are done. I can't see what it is that I'm doing wrong, but I'm pretty sure that my meta_query is wrong, ...
0
votes
0answers
21 views

Ajax add_post_meta()?

I've got a custom meta field that I need to work with ajax (like the tags field). This is the function I currently have: function prfx_meta_save( $post_id ) { // Checks save status $is_autosave = ...
0
votes
1answer
19 views

Display all meta for a post?

I have a custom meta field for my posts and I'm able to display the value. But it only displays one row. Since I have more than one value I need to display all of them. I know I probably have to do ...
1
vote
3answers
34 views

WP Query post meta value

I'm trying to get posts which have applied the meta value trainees. $args = array( 'posts_per_page' => -1, 'orderby' => 'post_date', 'order' => 'DESC', ...
-1
votes
0answers
11 views

How does meta_key _product_attributes work [closed]

I am looking at some dummy data for WooCommerce. There is an xml-file. In there are items with all their attribes but its kind of complicated for me to understand how this is working. There is this ...
0
votes
1answer
4 views

Updating post_meta when updating a setting with the Settings API

I'm currently using the Settings API and, on saving my options group, I need to simultaneously update post_meta based on the options that have been saved. Is there anywhere within the Settings API ...
3
votes
1answer
48 views

What is the most efficient way of querying posts based on visits and date for current day?

I am about to develop a piece of code for my site to display the most popular posts of the day that are X days old. I would like some help from you to achieve this the most efficient way. This is ...
-3
votes
0answers
13 views

Print Friendly Prints Wrong Data

I want to use print friendly in products. I have a page jump but I need it to be just in the itinerary part. You can see what I'm talking about here. It keeps on just printing the description instead ...
1
vote
2answers
17 views

sanitizing integer input for update_post_meta

When updating a post meta where the input will be always an integer, should i use (int) or is there any WordPress function for that (eg. sanitize_text_field) For example ...
0
votes
1answer
13 views

How to display post meta data in secure manner

I have have a custom post meta field where I can add a embedding code (a video for example, an iframe). Now I want to retrieve the code from the post meta and display it securely. I can display it ...
0
votes
0answers
33 views

How to show specific meta keys of all posts in admin panel?

I have some common meta keys on every post. Ex: hotel_person, hotel_number All the posts have these two meta keys. I want to show these meta key values and the post titles. All these values and ...
0
votes
0answers
20 views

save_post is not firing when I only edit custom meta fields

I've come across the action hook save_post few days back and I like to take advantage of it. I've custom post post type "Property" with Meta fields associated with it. The problem is that when I ...
0
votes
1answer
27 views

How to add tags to post from frontend?

I am working on a site where visitors will be able to add tags to post from frontend without being able to edit the already assigned tags. It basically will be a add tag button where upon clicking ...
0
votes
0answers
19 views

Post meta wrong format

I moved my woocommerce store to another server and now I have problem with product metas (_product_attribute meta). I have custom attributes there. Attributes haven't gone from database but my page ...
0
votes
1answer
97 views

Order by meta value pro first then meta value free in my search function

My meta key is geo_listing_type and this key have 2 meta_value, pro and free. I want to order these by pro first then free <?php get_header(); ?> <!--Start Content Wrapper--> <div ...
0
votes
1answer
17 views

Date format - Meta Box plugin

I am getting a date using the plugin Meta Box. The output is: "2014-10-30" and i'd like: "30/oct/2014" There is a way to change the default format? This is the register of the metabox: $prefix = ...
1
vote
1answer
23 views

Save re-arranged draggable post items to wordpress database

So i've followed the clearly documented pages for the packery and the draggabilly plugins to allow for a customizable grid and looked at how localStorage can be used to remember/store data of the ...
0
votes
0answers
42 views

Automatically add custom fields (post_meta) to all published posts, hourly, via wp_cron?

I'm trying to update the post meta of all published posts hourly (via wp_cron) with the code below: if ( ! wp_next_scheduled( 'postviews_updatedcounts_hourly_event' ) ) { wp_schedule_event( ...
0
votes
0answers
20 views

WordPress Custom File upload meta box saving 0 bytes as File size

I am trying to save custom images with the custom post type , so i added a custom meta box for file upload . it seems it is working fine but when i upload any file it save the file size is 0 Bytes . I ...
0
votes
1answer
23 views

Long Polling: Stuck in while loop

I'm trying to write a long polling function, that only returns data to the client as soon as some custom post_meta is updated. This custom post_meta is a unix time stamp, which is then compared to the ...
2
votes
2answers
81 views

Consolidate Metaboxes into 1 Big Metabox

I have a post type with 7 (count it SEVEN!) taxonomy tag boxes. By default, the only options to display these metaboxes are - 7 small metaboxes on the right side stacking or turn these tag metaboxes ...
0
votes
0answers
24 views

WP_Meta_Query object with conditionals

I have a custom post type (Books) that is connected with a second custom post type (People). The Books CPT has an additional author meta box that if checked, it should appear on the additional People ...
0
votes
1answer
26 views

echo image caption

I am attempting to echo out my image captions in a Bootstrap Carousel. I have managed to get my images to display but unable to display my captions. I have attempted to use wp_get_attachment_metadata ...
0
votes
1answer
21 views

How to get only current images of a post

I am new to WordPress. I have created a template page where I want to show single posts, So to get media of that post I am using a function $args = array( 'post_type' => 'attachment', ...
0
votes
3answers
34 views

Display different information of a custom post type

I'm developing a real estate site for a client and I'm struggling a bit with it. I created a custom post type called "Property". A property can be on sale and/or on rent. Two different menu items in ...
0
votes
0answers
36 views

How to e.preventDefault() on an admin post page for a submit() action?

Lately, I have had a problem with a seemeingly simple task of preventing a form submission an a post admin page in WP. In a nutshell: I created a meta box on an admin custom-post page that includes ...
0
votes
1answer
29 views

Sort by custom field that is an array?

is it possible to sort posts inside a query based on post value that is in an array - but using the last element of the array? The code looks something like: <?php $mostsharedposts= new ...
0
votes
0answers
50 views

Ordering posts alphabetically by meta keys and title

I have a query for custom posts and I have managed to order the results alphabetically based on the title first then a 2nd alphabetical ordering of the 1st of 2 meta keys "Species". This works great. ...
0
votes
0answers
39 views

WP Query to order posts by multiple meta fields

This question might have an answer already in the forums, however I still wanted to ask it as this is a different more complicated version of the problem. The story: We have 2 meta fields for ...
0
votes
1answer
42 views

Howto: use existing post_meta as options for a different metabox (checkboxes or list)

I want to create an "Employee" Custom Post Type ("Add New Employee") wherein the employee may belong to one or many offices. The user needs to be able to add/edit/delete offices via a separate ...
0
votes
1answer
29 views

Orderby two meta fields not working

Good day. I have the following code: $args = array( 'post_type' => 'property', 'tax_query' => array( array( 'taxonomy' => ...
0
votes
2answers
61 views

WP_Query displaying ALL posts

I cannot figure out why my WP_Query always displays all my published posts regardless of what I put in the arguments. <?php $args = array('numberposts' => 1, ...
0
votes
1answer
69 views

Notice: Undefined index: error and understanding wordpress

I am trying to create custom post types with wordpress 4. I followed a tutorial book called "Buildin Wordpress Themes From Scratch". I am on localhost so debug mode is on. When I try create a new ...
0
votes
1answer
53 views

Data from ajax not updating post meta

I can not update the meta from this ajax. Can someone give me a direction to help me to resolve it. I have a select field. I need to grab his value, make some work with that value and then, add it to ...
0
votes
0answers
35 views

Issue with migration - image connections to posts going awry

I need help with a rather daunting issue that I'm grappling with. I've migrated a client site from one host to another. Everything went fine except for one major issue pertaining to images attached to ...
0
votes
1answer
24 views

Return a single custom post from multiple meta queries

I'm currently working on a widget which returns a single random featured property on a website but I'm having some trouble with my WP_Query arguments. In the backend I have 2 checkbox meta fields ...
0
votes
2answers
61 views

What Is meta_id In wp_postmeta?

I am trying to add some data in WordPress Custom Field and via adding more direct records/data in wp_postmeta table via SQL query. There are four column as mentioned below... 'meta_id' - A unique id ...
0
votes
0answers
35 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 ...
0
votes
2answers
42 views

Custom meta box not saving values of radio buttons in Wordpress

I dont know where i am going wrong.I want to save the values of my radio buttons in custom meta box.Here is my code. <?php if (!function_exists('custom_meta_box')) { function ...
0
votes
0answers
34 views

Custom meta boxes ID prefix showing on first category but not others

I've created a custom post type and added some custom meta boxes using this great resource: https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress The problem, I've found, is that ...
0
votes
0answers
36 views

How to add validation / error message while add/edit custom post

I am trying to add error message on custom field in custom post save action But my validation not working. Check my code below. add_action( 'save_post', 'save_event_meta_data' ); function ...
0
votes
0answers
51 views

Auto adding product meta on publish

I currently have this function: add_action('transition_post_status', 'wpse_110037_new_posts', 10, 3); function wpse_110037_new_posts($new_status, $old_status, $post) { if( $old_status != ...
0
votes
1answer
64 views

Twenty Twelve entry meta data - change and move

I'm trying to fix with the twenty twelve meta data. I've started fixing and successfully managed to get the date under the title of the post. Please visit my site to see. One thing I want to do is ...
0
votes
1answer
32 views

How to order posts by the user_login that corresponds to a meta_value (which is a user id)?

I'm trying to create sortable column headers for a CPT list, but I'm stuck on one piece. When clicking on an "Assignee" column head, I want the list to display alphabetically by the login name of the ...
0
votes
1answer
45 views

Plugin can't be activated [closed]

I'm developing a WordPress plugin, but the last changes caused the plugin to stop working. It tells me that I can't activate the plugin because it caused a fatal error. On localhost all is working ...
0
votes
0answers
23 views

unable to access image attributes in wp_postmeta when looping through posts

I have an issue with accessing attributes of a library image, particularly the "Alternate Text" attribute. I use the ACF (Advanced Custom Fields) plugin to pull back the slideshow image which is ...
-1
votes
1answer
79 views

getting image alt text via ACF plugin in WordPress [closed]

I am using the ACF plugin in my WP 3.3.1 application and I use the the_field method in many places across the site. One place in particular I use it is in a slideshow/carousel as below: <img ...