This function returns the values of the custom fields with the specified key from the specified post. It is a wrapper for get_metadata('post'). To return all of the custom fields, see get_post_custom(). See also update_post_meta(), delete_post_meta() and add_post_meta().

learn more… | top users | synonyms

0
votes
1answer
93 views

Remove last character in get_post_meta

I have a custom field that contains a sentence along with a punctuation mark at the end. I am looking to use this field as a title of the article on my homepage, but in doing so I would like to remove ...
0
votes
0answers
92 views

Custom Field: Display only if a specific key is selected outside the loop

I might be doing this all wrong. I have a custom field called "enable_adsense" and the value can be either "yes" or "no" What I'm trying to do is display something if the value is "yes" and something ...
0
votes
1answer
30 views

Return only custom post types for the page, not all

I'm currently working my way through some custom posts (for the first time). I'm managing to return the bits I need using this <div class="pagered"> <h1 ...
0
votes
2answers
30 views

put saved metabox values back into fields and then display on the front end

i have a group of metaboxes which i finally are now saving but am struggling to get the saved values back into the input boxes they came from. so for example i have a meta field called link text and ...
-1
votes
1answer
143 views

get posts based on category and post meta

I am coding a Live Show box for a radio website to show who is on air and who is up next. I've been using the get_post function to retrieve posts based on the category (in this case the day of the ...
1
vote
2answers
101 views

Why is my get_post_meta always empty

I made this action hook which will send an email to the users every time a new post in the custom post type "events" is made. function email_members($post_id) { global $wpdb; $usersarray = ...
0
votes
1answer
114 views

get_post_meta is always empty when I use wp_mail

I made this action hook which will send an email to the users every time a new post in the custom post type "events" is made. function email_members($post_id) { global $wpdb; $usersarray = ...
0
votes
2answers
429 views

Where is the key _wp_page_template passed?

When adding custom post meta boxes, I understand that whatever name attribute input you put would be passed through the form into the server. Hence, if I have <input type="text" ...
0
votes
0answers
200 views

loop through custom post types with meta data

I'm really curious as to how might be the quickest way to loop through a custom post type with meta data. I have some code that works but it's slow. I'm using wp_query and it works. I have also a ...
0
votes
0answers
44 views

Displaying additional meta from a custom post type on the page?

I have added the custom field which displays in the custom post type "portfolio" just fine. // Add more custom field function woo_metaboxes_add($woo_metaboxes) { // Check for post type = ...
0
votes
1answer
96 views

how to fire join query with post_meta

I have print sql query that runs within 'posts_where' filter and its like: SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'shop_order' AND post_date >= '2013-08-26' AND ...
0
votes
2answers
587 views

Click on featured image to pull up lightbox [on hold]

So I have a gallery-like archives page full of donors on my site. Each box of the gallery consists of a featured image from the donors post type. The goal for the site is, upon clicking a donor, to ...
1
vote
1answer
567 views

How to display Yoast SEO meta description in archive template for each post instead of the_excerpt()?

I read this question but it wasn't what I was looking for exactly. I'm new to Wordpress and a little confuse with the functions and everything. How can I get the metadescription in the loop for each ...
1
vote
5answers
1k views

Get meta_id along with meta_key and meta_value

Is it somehow possible to get_post_meta or get_post_custom and have meta_id returned along with the meta_value? For example: $data = get_post_meta( $post_id, 'my_key' ); // returns this: array( 0 ...
0
votes
1answer
178 views

Image not showing using a custom function and get_post_meta

I'm trying to create a function to display either a theme option or custom images based on user input. So basically, it's a custom meta box. The user selects either a display header image OR they can ...
0
votes
1answer
177 views

How do I save each option in a multiple select menu as it's own meta_key + meta_value pair?

How do I save each option in a multiple select menu as it's own meta_key + meta_value pair? This is the basic multiple select menu. Note: multiple select menus allow you to select more than one ...
0
votes
2answers
219 views

Multiple If else statements on Search Result Page

Ok, I have a few CPT's setup with a metabox that only requires some values for some categories. When searching a specific category, I want to display a link to the value (which is a url) if it exists ...
0
votes
1answer
148 views

Related posts and custom meta_box?

I am trying to code the ability to pick which posts should be included as related to the current post the user is editing. I have used @MikeSchinkel very helpfull post here, to include a list of ...
0
votes
0answers
494 views

Update Post Meta for Arrays — Remove/Replace Single Value from Multi Dimensional Array

I am trying to unset/remove then replace/update a single value from a post meta field, but my code for array_push() and unset() are removing all of the values from each array. Here are the two halves ...
0
votes
1answer
396 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
1answer
58 views

get_post_meta in one post only

I have a rough demo here to try and illustrate my problem. http://www.ttmt.org.uk I have six pages with titles - Page One, Two etc. On a index/home page I'm creating a btn/div to link to each ...
0
votes
1answer
359 views

Display an icon with get_post_meta?

I want to display an icon in the post meta data in the loop.php, for each post have a specific meta_value! To be more specific i use this code to display an icon when a new posts has been published ...
0
votes
1answer
108 views

Random element in get_post_meta array

I have a custom field that contains a list of comma separated colors. I want to randomly select one of those colors. If get_post_meta returns an array I thought I could randomly pick from that ...
0
votes
2answers
244 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 ...
4
votes
1answer
484 views

What is the index [0] for on post meta fields?

Trying to improve my PHP knowledge through test and try! I am confused on [0] arguments at following WordPress PHP code global $post; $custom = get_post_custom($post->ID); $price = ...
0
votes
1answer
198 views

get_post_meta image width for lazy load

I'm trying to lazy load a page of images in Wordpress - I've tried the plugins but none of them seem to work(I only want to lazy load image on some pages.) So I'm now trying to do it with a plugin - ...
0
votes
0answers
22 views

How do I retrieve a value from a multi - dimensional array using get_post_meta? [duplicate]

I know that I need to use get_post_meta(31, $custom_repeatable, true); The post_id is 31 and the meta_value is $custom_repeatable. I would like to display the value hamsters repeat one only . My ...
-1
votes
1answer
144 views

How do I just display the part of the array that I want to? [closed]

I would like to take a stored array, from the meta_value $custom_repeatable and just display the line 'hamsters repeat one', but the following code doesn't display it how I'd like. Here is the code: ...
-2
votes
1answer
556 views

echo is just displaying the word 'array', rather than the array [closed]

I'm trying to see the structure of an array, but when I try to echo the array, all it says is 'array'. Please can someone explain how I can see the structure of an array? add_shortcode('book', ...
1
vote
2answers
1k views

display specific custom fields

I have few custom field assigned for each post, like: "Club" with value "club1" "Date" with value "date1" and so on... Now, I want to display from all the custom fields just those 2 " club" and ...
4
votes
2answers
1k views

How we get_post_meta without post id

I want to get my all posts-meta, But on the base of key. For example the main query for getting the post-meta is <?php $meta_values = get_post_meta($post_id, $key, $single); ?> Now i want ...
0
votes
0answers
53 views

getting a post id from a custom type post

changed a wordpress to use custom type posts instead of pages. I'm Trying to update a plugin to work with this change. currently I'm stuck with just getting the right id from the post here's the ...
3
votes
1answer
767 views

Formatting custom meta box date from YYYY/MM/DD to a more readable alternative

QUESTION This is following a previous question that was graciously answered by Milo earlier here - How to sort CPT by custom meta value (date), and return posts month by month In short, I'm having ...
4
votes
2answers
3k views

Display Yoast WordPress SEO title in archive template

The WordPress SEO plugin by Yoast allows users to add SEO titles and meta descriptions to taxonomy term archive pages. These are then used in the head of the document. I´m trying to display the SEO ...
0
votes
1answer
74 views

How we can get “get_post_meta” of specific user who added it

Basically i have front end form which store the notes and tags of post. And every user who logged in can store there own notes and tags. But i want when he view the notes and tags he can only see here ...
0
votes
2answers
4k views

How to get meta box data to display on a page

I am trying to piece together a Metabox with 3 text editor fields for a custom post type. The box is showing up and appears to be saving on the custom post type entries but I can't get the data to ...
0
votes
2answers
115 views

wp_query not resetting, last post hanging

im creating a wordpress query for custom taxonomy. However im unable to get the last post that i queried to go to the permalink. Please could somebody help me get this query right, much appreciated in ...
2
votes
1answer
195 views

How can I display my custom metaboxes on a custom post template?

I'm fairly new to PHP/wordpress, and this is actually the first time I haven't been able to answer a question through google! I'm working on getting up to speed with PHP/WP generally, but I can't seem ...
0
votes
1answer
213 views

get_post_meta($post->ID, 'Begin', true); don't give me numerical value

I'm trying to use the jquery plugin Timeago. With this, I want to countdown from a date (2013/03/04 format) Which is in a custom field. Echo $Begin2 gives me something like : 34 days ago. It's work ...
0
votes
1answer
69 views

How to display childrens custom fields?

I need help, I have a page that I want to display content from the page children, I get the content but not the custom fields! I've tried this but it dosnt work, what am I doing wrong? <?php ...
0
votes
1answer
784 views

get_permalink vs the_permalink

I am filtering the_permalink to return a custom structure function append_query_string($url) { $url_endpoint = get_permalink(); $url_endpoint = parse_url( $url_endpoint ); $url_endpoint = ...
0
votes
1answer
137 views

Function to return values from metabox

I have created two custom metaboxes using the Meta Box plugin for my cpt called books, and I am confused how to output the values. The values need to be used in sperate places in one of my templates. ...
0
votes
2answers
73 views

how to display custom fields of post on a web page

I want to ask that how can i dispaly custom field of a post on a web page . I have used get_post_meta but it resulted in just an array .i cant figure out what is the problem
0
votes
1answer
334 views

Display Meta Data with HTML?

Is it possible to display the custom field/meta data content with some html? Usually i would use the following to just display the content... <?php echo get_post_meta($post->ID, ...
0
votes
1answer
1k views

get_post_meta - get a single value

When I do get_post_meta($post->ID, "company_wp_box_g", false) I am getting back an array of key/values pairs. array (size=1) 0 => array (size=7) 'f_name' => string ...
0
votes
1answer
1k views

Display post details by post ID

I need to display post details by ID on front page template (front-page.php). On the front page I want to display the post’s title, excerpt & featured image. I have tried to do that but no idea ...
1
vote
2answers
213 views

Ordering posts by metadata

In my plugin, I use these instructions to obtain a list of posts: $args = array( 'numberposts' => -1, 'offset' => 0, 'meta_query' => array( array( ...
-1
votes
1answer
449 views

Display a list of posts whose meta field values are equal to the ID of the post being viewed?

SOLUTION PASTEBIN LINKS:: http://pastebin.com/YmXVC1kn - Author Single Post http://pastebin.com/g0xgvxgh - Book Archive Template Please refer to these files here - solved by storing the post ID ...
0
votes
1answer
259 views

Run a check for multiple meta key values

I am having a heck of a time getting wordpress to display all values of a certain meta key correctly. I wonder if I am going about this the wrong way? My end goal is to run a check to see if there ...
-1
votes
4answers
784 views

Problem with get_post_meta

I am using this code to retrieve post meta: <?php if( get_post_meta($post->ID,'a',true) == ''){ echo '<img src="' . get_bloginfo( 'template_url' ) . '/img/img22.jpg" ...