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

learn more… | top users | synonyms

0
votes
0answers
79 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
34 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
49 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
117 views

How to get meta value in wp_attachment_metadata

I want to get wp_attachment_metadata in my own way. I want to separate the sizes (Thumbnail, Large, Medium, Small). The meta value on database looks like this: ...
0
votes
1answer
50 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
73 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
57 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
2answers
125 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
0answers
20 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 ?
0
votes
1answer
553 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
826 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
51 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
103 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
3answers
100 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
1answer
49 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
757 views

update_post_meta() whenever custom post type is updated

I need the following functionality. Whenever my custom post type is updated or saved I need to overwrite certain custom post metas. I need to make sure this only affects posts of the post type ...
0
votes
0answers
41 views

Remove meta info for one specific category on all posts in that category

As for the moment each post on my site http://wonderfulwanderings.com (hope this is okay, just want you to know what I'm talking about) is displaying which category it belongs to. I would like to ...
0
votes
1answer
19 views

How to get pictures of the Wordpress post

During the post creation of a post in Wordpress, I add 2 pictures in the post Gallery. How can I retrieve uploaded pictures URLs to display them on the other template?
3
votes
2answers
680 views

Trying to get custom post meta through Jetpack JSON API

I'm using the Jetpack for Wordpress to produce a JSON API for my Events custom post type, which works fine: https://public-api.wordpress.com/rest/v1/sites/MYSITE/posts/?type=events&number=100 ...
0
votes
1answer
135 views

query_posts orderby postmeta

I'm trying to retrieve a custom post type and order it by a custom date stored in postmeta. The custom date is a unix timestamp. The meta_query works correctly - it only retrieves posts with a ...
0
votes
0answers
28 views

wp_postmeta are updated for only one page

Code below only updates wp_postmeta of one specific post, not all the posts. On other pages the meta_key is not even added to the table, so it is not the problem with saving but with something else, ...
0
votes
0answers
152 views

Add auto increment value to custom meta

I have a custom meta "code" in my CPT. How can I make it so that it has a number that will auto increment every time the admin publishes a post? My solution is to add a table in the database that is ...
0
votes
1answer
98 views

Custom post type submenu sorted by specific meta_key & meta_value

I have a created a custom post type called "Events" using register_post_type. I am now trying to create a submenu within "Events" that will only show events sorted by a specific meta_key and ...
0
votes
1answer
75 views

delete_post_meta() for whole CPT / multiple posts?

I'm cleaning up a theme and one of Custom Post Types has some odd, long gone custom fields. I want to delete them, unfortunately delete_post_meta() takes post->ID for an argument, while I want to ...
0
votes
1answer
57 views

Meta box values are displayed on Custom Fields list. Is it possible to hide them?

I have multiple meta boxes for my Custom Post Type posts. I want my users to add new fields using Custom Fields. The problem is - Custom Fields display all the garbage from my metaboxes and it might ...
0
votes
1answer
64 views

Wordpress postmeta: Store data as an array or single item?

I know it could be difficult to query a single item that saved in an array in wordpress postmeta table, but I have lots of metadata for a single post which may create too many rows for the postmeta ...
0
votes
1answer
275 views

wordpress update multiple posts post meta

I am trying to update multiple posts post meta at the same time. I have the following query: <form action="" method="post"> <?php $variations = new WP_Query(); ...
0
votes
3answers
355 views

shortcode in a custom metabox

I am trying to add a shortcode from a plugin to my custom metabox. I have read it isn't the done thing but in this case i do need it to work. The client might not add a video but might add an image ...
1
vote
2answers
366 views

How to keep a check box in custom meta box for custom post type checked by default for add new post?

In my custom plugin, I have a custom post type and have a custom meta box for it. I have few fields in it, one of it is a check box. I want this check box to be checked by default when I go for a add ...
1
vote
2answers
125 views

Custom Post Types. Are there any disadvantages/advantages in using a plugin to develop them?

There are a few plugins which can assist you in building your CPT's, and these can usually handle your taxonomies and sometimes postmeta also. Some even take it further than that. I know that as with ...
0
votes
0answers
54 views

How to create a custom search in wordpess matching with title and metadata

I want a custom search in wordpress where the search query should return results matching to post title or with a custom metadata. For example if a user is searching for "chicken" in my site, it ...
0
votes
1answer
348 views

WooCommerce custom taxonomy as meta?

I have created two custom taxonomies: (slug) = language (slug) = location On the single product page I would like to display these two as meta below the "Categories" and "Tags." Example: I found ...
0
votes
2answers
186 views

Trying to get property of non-object error using get_post_meta()

I made a simple function for post_meta, in functions.php: // Top Sub Heading (top_sub) FROM CUSTOM FIELD function topSub( $Trunckvalue = null ) { global $post; $TopSub = get_post_meta( ...
0
votes
1answer
61 views

How to query post ids liked by the Author

I'm using wti_like plugin and this is how i get the number(count) of post liked by the author // Get the author object $author = get_user_by( 'slug', get_query_var( 'author_name' ) ); // Get the ...
0
votes
1answer
2k views

How to add multiple featured image in meta box in post editor?

I would like to add multiple featured image in meta box in post editor area apart from default available featured image. I have added the meta box but i have no idea on adding the featured image ...
0
votes
1answer
88 views

Why does get_transient() always return string even if integer set?

I've been trying to bug fix the following method for hours now, and don't have an idea why it always returns a string, instead of an integer. The idea is to return a class property, if exists, or a ...
0
votes
0answers
72 views

Problem with inserting Iframe in post_meta with Cron

I am trying to automatically post from Tumblr to Wordpress. I've made some scripts that enable Wordpress to put the first image of the content as Featured image and put the first <iframe> in ...
0
votes
1answer
121 views

Sorting meta box values by start- and enddate and all dates in between

What I've been attempting to write is a function that will allow me to sort a list of WordPress posts by their meta values start date, end date and all dates in between. I've set up a custom metabox ...
0
votes
1answer
217 views

Unique Post Meta Values

I want to use Unique IDs like YouTube video IDs and WordPress post IDs in a custom field 'youtube_id'. I just created a front-end add post page and want to check if 'youtube_id' used or not used in a ...
0
votes
1answer
69 views

Retrieve user_meta and copy to post_meta

As geo mashup only retrieves post_meta, I am trying to copy over the geo_location from a custom registration field into the meta for page containing the map. The code I am using is: <?php ...
0
votes
1answer
97 views

How to retrive Custom Post Type Meta Fields in Custom WP_Query

Can some one let me know How I can render the Custom Post Type Meta Fields (Meta-boxes). I have a Custom Post Type Called "News" and I successfully added a Metabox to my Custom Post Type called "News ...
0
votes
1answer
296 views

Gravity Forms Update post meta from template

I created a form called 'Books' which has the fields: Title (Post Title) Author Genre (Dropdown - fantasy, horror, drama... etc) ISBN Number Status (Dropdown - Default Option - Published, additional ...
1
vote
1answer
644 views

Get all posts from custom post type and insert in select input as metabox

I would like to know if its possible to do something like this. I have Slider custom post type and Services custom post type. For slider posts I have created a metabox for URL value to display next ...
2
votes
1answer
195 views

Save default value for empty or missing post meta

I am using WordPress and I am using a custom field that has the name ecpt_carprice for each post I am publishing, the field is saved in wp_postmeta the same as the attached image: Some of my cars ...
0
votes
2answers
1k views

Check if meta key value already exists

Let's say that I have few posts with meta key "videoid". Value of that meta key is different for every post (and has to be different). When adding new post, how can I check if videoid with that exact ...
0
votes
1answer
115 views

Storing values in Post Meta vs new tables

I want to store list of user IDs in the post meta who have rated a post . So, for each post I will need to check the post meta to see if the user id exists in it or not. So my question is that, is it ...
0
votes
1answer
52 views

how to show this part only in the single post page?

I have this part in my index-meta.php file : <ul> <li class="Source"><a>source:</a></li> ...
0
votes
1answer
69 views

Display Post Meta in Header

I'm trying to get page post meta in my header so I can set some meta tags. I tried to get the global post variable but it only return true. <?php global $post; global $wp_query; echo ...
0
votes
1answer
28 views

When importing posts to a new site if XML file has postmeta not setup on new server what happens?

I have a few XML exports from one domain, and all the posts have postmeta which no longer exists on the new domain. An example is <wp:post_parent>70</wp:post_parent> The new domain has no ...
0
votes
1answer
74 views

get_template_part() isn't loading author information

Using get_template_part() I parted some of my theme's common post templates. My post template is content-general.php. Without parting thing is going fine. But just after parting the template — ...