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
2answers
342 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
461 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?

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
459 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
286 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
117 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
2k 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
469 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
1answer
228 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
843 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
871 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
437 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
662 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
92 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
749 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
83 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
157 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
612 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
229 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
356 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
945 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
1k 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 ...