Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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

0
votes
1answer
5 views

add action save post type and update post meta woocommerce

I want update post meta in product woocommerce when I save o update the product. I write this function (and insert in functions.php) with save_post_NAME_CPT but don't work. add_action('...
3
votes
2answers
48 views

Custom field metabox not showing in back-end

I recently updated my website after a while, and the custom fields meta box is not showing in the editor anymore. It isn't showing under "Screen Options" either. Any ideas why this could be, and how ...
0
votes
0answers
12 views

how to display data from toolset custom fields into wp_head as json-ld jobschema format only in CPT 'Jobs'

i am using toolset types plugin and genesis framework. i created custom fields for a CPT Jobs using toolset plugin. Now i want to display these fields data as jobposting schema json-ld format into my ...
0
votes
1answer
11 views

How to Disable option of meta field if that option is selected for any other post in custom post type?

I'm working on a custom post type with a custom meta field post type (like post formats). I'm able to save and retrieve the post according to the meta key values. But the problem I'm facing is how to ...
0
votes
1answer
24 views

Filter posts by meta data using custom query

I'm trying to filter post by two things. By the current logged in user. By meta data (disc_id) from the post. Note: The value for "disc_id" is a copy of the post ID from the custom post type it is ...
0
votes
1answer
27 views

copy attachments to another post type and change attachment url

On my site I have to custom post types and a function that let's users import photos from post type A to post type B, copying the meta values and it copy's the image to the folder specified for post ...
1
vote
1answer
16 views

How do I set all of a particular post meta to a value within the custom post type I'm in?

I've currently got a custom checkbox that (if checked) sets a particular post as 'featured'. It also set all other posts as 'unfeatured', just before setting the current post. This has worked great, ...
0
votes
1answer
36 views

gettext localization is not working

I'm trying to translate the post date using __() function. But it is not working. The post date still displayed in English. What are you the other options to localize the post date(posted-on). ...
0
votes
1answer
44 views

Can't translate the post meta data (Date) in another language

I want to translate the post meta data (date) in chines language for example, September 13, 2017, should be translated as 2017年9月13. But my code gives it in English. Do you see any error? Please help. ...
0
votes
0answers
19 views

Look for string in posts and postmeta

I have a query that finds the usage of an attachment in any post. $used_in_content = array(); foreach ( $attachment_urls as $attachment_url ) { $content_query = new WP_Query( array( 's' ...
0
votes
1answer
21 views

wp_insert_post inside save_post adds wrong metadata to inserted post

I have code for saving metadata for Student post_type. While saving metadata I also want to add separate posts for each payment in payments array: add_action( 'save_post', 'save_student_meta' ); ...
0
votes
0answers
11 views

make post pagination with image from meta post

i have gallery post , with value post is image from meta post , and i want make this post like this fiddle but i dont know how to make it , i was try use this code <?php while ( have_posts() ) : ...
0
votes
1answer
21 views

Add postmeta to all blog posts

I have a bunch of blog posts that I need to update with a custom postmeta key/value pair. Therefore I have two questions - where can I find the postmeta entries in a worpdress MySQL database and how ...
1
vote
1answer
24 views

How to filter into post meta data before saving

I'm on a plugin, where I want to provide a way to my clients to filter data before saving. I know the best way is to provide a filter hook. So I introduced a new filter hook to filter all the post ...
0
votes
1answer
13 views

How To Display Author Popup on Entry Meta (Genesis Framework)?

How to when the mouse pointer on the author name can display Author Popup like this site? https://www.dietdoctor.com/low-carb/keto Thank you!
0
votes
1answer
25 views

Post meta data not showing in frontend, until hitting 'update' button

I try to insert around 2000 video-posts into WP. There is a custom field in the theme for the video-url, so I add the video-url to the post meta data with the corresponding field name. ACF seems not ...
0
votes
2answers
32 views

How can I change the <head> tag contents of individual Wordpress posts?

How can I change the tag contents of individual Wordpress posts? I want to add a meta tag for keyword. I use Yoast SEO but even though I specify the focus keyword, no keyword is added in the meta ...
0
votes
1answer
19 views

Custom meta box data array: foreach not working correctly?

I have written a plugin to create a new custom post type named gardener, and have added a custom taxonomy called region, in addition to a meta box with several fields called _gardener_address. The ...
0
votes
2answers
89 views

How to check if Woocommerce Order number equals to post ID?

I am facing a challenge. I need to check if Woocommerce Order Number will equal Post ID. I know that this is true like 90% of times, but I need bulletproof way to check this. See example where this is ...
0
votes
1answer
50 views

copy images from custom field to another custom field

On my wordpress site I have a front end form that allows users to create posts and upload photos for a custom post type 'Property'. Using the following function - $property_sights_value = ...
0
votes
0answers
13 views

Woocommerce - custom upload

My upload won't save images, and won't save list into field. It's a simple code but it just ignoring everything :) <form method='post' action='' enctype='multipart/form-data'> <input type="...
0
votes
0answers
9 views

wprf_postmeta getting data

I'm using Ninja forms.and the form sent to email is saved as mentioned in wprf_postmeta. What i'm trying to do is retrieving these data in order to use it as follows: I'm making a separate panel to ...
0
votes
0answers
17 views

Woocommerce - Saving parent product meta for children (in variations)

In 'new product page' i'm using custom meta fields. They're extensive and use custom functions to process data. Now in product type [variation] i need to take those meta fields which are coming from ...
0
votes
0answers
81 views

Creating a “Related Meta” type field?

I need a unique meta box which can contain auto-updating elements similar to how a tag cloud would appear. Example. identifier id : animals identifier data : Dog, Cat, Horse, Pig I need to know ...
2
votes
2answers
23 views

How to use a Term Meta Field as a link

I created a taxonomy called animal and a term meta field called horse. I created a function in my functios.php file to make it easier to display the data. Here is my code: function ...
1
vote
1answer
33 views

How do I have WP_Query match posts based on search parameter OR meta fields? (rather than search parameters AND meta fields)?

I'm trying to include post meta in the scope of a WordPress search using WP_Query. I have a meta query that looks like this: $args['meta_query'] = [ 'relation' => 'AND', [ 'key' =...
0
votes
1answer
21 views

How does WordPress treats attachments metadata in post content?

I understand that an "Attachment" object can have its own metadata in Media Library. However, it can also have it's own metadata in a post scope. How does WordPress deals with attachment metadata? ...
1
vote
0answers
19 views

Getting a Meta from Multiple Meta [duplicate]

i want getting a meta value from multiple meta i getting meta by : $data['cd_meta'] = get_post_meta( $p->ID, 'cd_meta', true); but cd_meta is a multiple meta and i need just one specific meta ...
0
votes
1answer
23 views

Wordpress creates new lines in postmeta table on post update

I noticed some weird behavior in WP. I've created custom fields through ACF Plugin. I've also coded a function that can update posts and custom fields at the same time with wp_post_update and ...
1
vote
2answers
24 views

Undefined Variable - Custom Post Type Meta

I've read many related questions and have tried all that I could so make sure it's actually a duplicate before flagging please. I've been using WordPress for about 6 years so when I say I'm stuck, I ...
0
votes
2answers
76 views

Display post number by category

I try to add auto increment post numbering by category. Like cat="myID" > post 1, post 2, post 3... Display post number not post ID number In find this solution, and use post_meta looks a good way. ...
0
votes
0answers
14 views

How to delete meta-field which is registered with register_meta to Rest API

I'm working on a Wordpress integration and updating our WP JSON api v1 to v2. We have custom post types which use two custom meta-fields. One of them should be preserved to the WP's database while ...
-1
votes
2answers
48 views

How to display the date under the post title?

He everyone i'm a newbie to wordpress/php and have 1 other problem. I am trying to get the date under the post title and not to display the category tags above the title. I tried it to change thing is ...
1
vote
1answer
23 views

Multiple postmeta with same name for one post in wp_postmeta table

I have a hidden post meta called _payment for my posts. When i was looking into the tables of the wordpress, I noticed that there are tens of this post meta with the same name for the same post! Here ...
0
votes
0answers
52 views

Action in Ajax request does not run for some user roles

I have an ajax POST request that looks like this: var data = { action: 'like_prof', id: profID, }; $.ajax({ method: "POST", url: ...
1
vote
1answer
70 views

Checking if a post with certain meta value exists

How do I check whether a post with a certain meta value exists? For instance, check if a post exists with _sku = 1?
2
votes
1answer
100 views

Custom Queries: Joining On Meta Values From Two Custom Post Types

Hi – I'm hoping this is the right place to be asking this question. I am in the process of moving my full football club website onto Wordpress, therefore using a single database for the information ...
1
vote
1answer
41 views

Delete all post meta except featured image Using SQL

Please I just migrated my site and I found out that wp_postmeta consumes most of my cpu resources, Is the any Sql code to Delete all post meta except the featured image. I dont want to Use wp ...
1
vote
1answer
19 views

how to make members list directory through wordpress post custom meta key.

I have created a website in which I am providing complete information about the organization. For this, I am using a Wordpress post. In which I am putting information of only one organization in a ...
1
vote
1answer
49 views

Hey, I want the second options. get_post_meta()

I can loop through foreach, but I don't know the second, "My car", "My boat" etc. I want my question is this: car - My car, boat - My boat, bike - My bike $engine = get_post_meta(get_the_ID(), "...
0
votes
0answers
20 views

how to check meta value as a multi array in wordpress query?

I have property listing on my page. i have to do filter on my page if user enter property guest value 5 then i need to fetch only that post where guest value is 5 that store in post meta value as a ...
0
votes
0answers
27 views

Want to send ajax request in wordpress to a custom file in plugin

Want to call a function in my plugin to delete the post-meta on click of a button. How can get this functionality. I suppose it can be done with ajax but i am unable to send ajax request to my custom ...
1
vote
1answer
23 views

How to receive all the meta information of a post ?

How can I get all the meta information of a particular post_id, if my meta_key = 'title' and meta_value = 'My Content Template' meta_key = 'download_url' and meta_value = 'http://www.example.com/pdf/...
1
vote
0answers
24 views

Query Posts depends on custom field inside repeater field using acf

i am working on a hotel website and trying to make price search i have custom post type name hotels inside post type i have a repeater field inside repeater i have some rooms with prices i am ...
1
vote
1answer
38 views

Force the “Choose from the most used tags” meta box section to always be expanded

I'm looking to have the "most used tags" link within the tag meta box on the post page always be expanded. Couldn't find any helpful plugins to use. I did find this previous post but the function ...
0
votes
1answer
57 views

update_post_meta doesn't work

I've been drilling with codes for so long. I was trying to create a metabox with a simple textare on it. Been stuck for almost 10 hours tyring to solve this. Still up until right now my meta box ...
0
votes
0answers
20 views

Remove item from post_meta array via AJAX

I have a form on a page where users can add new text inputs (up to 30 inputs). The entered value of this text input is stored in the post_meta table via AJAX as an array. Here is the php that ...
0
votes
1answer
31 views

ajax delete value from custom field array

I have on my page a multi file upload that saves post attachments within a custom field --- if (!empty($_FILES['vidPix']['tmp_name'][0])) { $i = 1; $files = $...
0
votes
0answers
16 views

How to get the Custom Taxonomy link for specific post in a SQL query

I'm using the 'wpDataTables' plugin and there's a lot of working with SQL which I haven't done before. I'm sorting custom taxonomy data from posts into a table and need each bit of data to link to ...
0
votes
1answer
59 views

change order of images attached to post

Im not quite sure how to explain my issue so let me know if Im unclear about anything. I have on my front-end post form a multiple file upload input that uploads files to my specified folder and ...