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

3
votes
1answer
1k 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
4k 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
83 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
5k 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
134 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
222 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
285 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
79 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
931 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
153 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
75 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
403 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
2k 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
2k 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
259 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
528 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
286 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
1k 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" ...
0
votes
2answers
374 views

Hide custom fields when empty

I am trying to create a function to add data from two custom fields after the entry title. I get it to show correctly when these fields are filled in. The fields are a image source url and an url the ...
-1
votes
1answer
504 views

Applying if (get_post_meta) to new shortcode

It's my first time here so here goes :) I've created a custom image field which allows me to upload new images, or have images added via a form from the frontend. I want these to display. I'm ...
5
votes
2answers
2k views

How to print meta description to posts? [closed]

I want to show my meta description content above posts. But i don't know what function I need to call. Resume: i want to put meta description from Yoast Seo above the posts body.
0
votes
1answer
492 views

Add custom fields after post/page title

I am using the Headway theme, and I need to add custom field code to page & posttitles. This is what I need to be able to do. The red button will be added through a custom field. It needs to be ...
3
votes
1answer
312 views

Using get_post_meta with new_to_publish

I'm trying to read the custom fields set by the user when publishing a new post: function doSomething($post) { $meta = get_post_meta($post->ID); error_log("post meta: ".print_r($meta, ...
1
vote
0answers
130 views

Change Post Template based on post meta?

I am trying to figure out a way to use a custom template within my plugin. I would like to avoid using a custom post type if possible. I searched for a way to add my theme file to the dropdown list ...
0
votes
2answers
3k views

if get_post_meta is empty do something

I need opposite of this: <?php if ( get_post_meta($post->ID, 'price_list_category1', true) ) : ?>style="display:none;"<?php endif; ?> In other words I want style="display:none;" ...
0
votes
1answer
491 views

Custom posts and get_post_meta in {$post_status}_{$post_type}

I am making a function to parse a .csv file uploaded in a custom field of a custom post. The name of the custom phone and the field's name is plan_information . The problem is when I ...
0
votes
2answers
285 views

getting the post_id from the post_meta

I need to find out the post_id of a post_meta record where the custom key is 'XYZ' and the is 'ABC'? Is there an API for that? Or do I need to run a regular select SQL with wpdb class?
0
votes
1answer
3k views

Retrieving multiple values to the Post Meta (using an array)

I'm having a problem retrieving post_meta values that I have stored in an array. I use this for storing the array: add_action( 'comment_post', 'add_food', 1 ); function add_food(){ global $post; ...
0
votes
1answer
939 views

wordpress get_post_meta / the_meta to output custom field value

What I'm trying to do is quite simple: I want to add a custom field named 'Button' to each post that will show a button (image) on the page with the value as its link. It's basically a button that ...
0
votes
1answer
1k views

How to display meta box data using “Meta boxes as needed”

I have been following this post exactly: http://wordpress.stackexchange.com/a/19852/14957 and have everything working in the backend but when I try to use echo get_post_meta($post->ID, 'songs', true); ...
0
votes
1answer
2k views

Display Custom Meta Box Field Only If Value is Present

I'm messing around with Custom Meta Boxes in WP for the first time and was wondering how I go about displaying the fields that only have values attached to it. For example I've got a meta box with an ...
0
votes
1answer
950 views

How do i get the attached images with custom value checked?

I have added a custom field to the image attachement. When this custom field is checked the image will be part of a carousel on the home page. Now i am able to get the custom field to work and save ...
0
votes
1answer
515 views

Wordpress stripping out custom field tags

I am using wordpress get post meta to store the value of a custom field into a variable. In this particular instance, It is actually grabbing the post's parent's custom field due to the ...
0
votes
2answers
690 views

Display post_meta in Shortcode

Simple shortcode turning overcomplicated <?php function recent_posts() { $q = new WP_Query( array( 'orderby' => 'date', 'posts_per_page' => '1') ); $list = '<ul>'; ...
2
votes
1answer
97 views

Add Post Url to Manage Edit Screen

I'm trying to add a column to the manage screen that displays the Title and url of the post. I got the Title to work but it's not pulling the url. Basically I just want to show the url that's not ...
1
vote
1answer
826 views

Widget: Custom Post Type Post Listing Dropdown on Admin Side

Widget: I'm making a custom widget with the following functionality on the admin side. 3 text fields 2 dropdown menus to select posts by title (both from a single custom post type) Right now, ...
1
vote
1answer
85 views

dynamically generating plugin syntax

I have downloaded an audio player plugin for WP. the syntax is very simple. You just add the line [audio:my_file.mp3] to your post editor/excerpt, and call it in the loop with the_content() or ...
0
votes
1answer
163 views

How do I add a fixed value to get_post_meta();?

I'm using the following to display a custom field value in my posts: <?php echo get_post_meta($post->ID, 'wikipedia', true); ?> How do I add this value to the output, where '$tag' takes the ...
0
votes
2answers
646 views

Echo 2 values from one key in Array with get_post_custom

Edit 12/15/2011 Added Radio Button print code // Add meta boxes to admin panel only needs to be added once add_action('admin_menu', 'plib_add_box'); //Add meta boxes to post types ...
0
votes
1answer
242 views

Get author total post votes from post meta

In author.php, i have the list with the posts written by the author. I'm trying to get the total number of votes, from the author posts. All posts have a post_meta with a numbered value. i need to ...
0
votes
2answers
2k views

Unable to set Custom “Link URL” for Featured Image, and More?

I have an issue that I believe can be solved one of two ways. I am using Featured Images in posts for content on a home page slider. What I would like to have happen is to have the destination links ...
1
vote
1answer
1k views

Need help on creating If-statement for custom meta fields

I'm using Wordpress. I have a movie review website called Filmblurb. For my blog posts, I'm trying to create posts with different categories. Under the "Reviews" category, I have a "Details" box that ...
1
vote
1answer
370 views

get_post_meta not working on category.php

I'm referencing an attached image in my header.php page which is displayed as a full screen background on my posts: global $wp_query; $page_id = $wp_query->get_queried_object_id(); ...
0
votes
2answers
990 views

get_post_custom_values problem, please help

i want get the "issue-cover" from archive page list, i done it. but it will cant get the meta value when i update/add new a post to the archice page. <div class="monthly_archive"> <?php ...
1
vote
1answer
2k views

How can I get_post_meta() in the most efficient way?

I have a custom post type for a real estate site, and the theme displays 9 properties in a grid on the home page. I don't think its written terribly efficiently - I'm getting about 160 queries on the ...