The get-post-meta tag has no wiki summary.
0
votes
1answer
21 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
0answers
19 views
How to retrieve hidden custom fields from a post? [closed]
I've read that is possible to "hide" custom post meta fields if the fields are prefixed with an underscore "_". However, I do need now to retrieve some data that is likely being stored in one of these ...
0
votes
1answer
39 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
24 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
3answers
35 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
295 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
0answers
18 views
Dynamic Custom Menus [closed]
I've created a meta box so my client can choose which custom menus to use on certain pages. That seems to be working fine. However, I've created a second menu but only the original menu is showing up ...
0
votes
0answers
31 views
How to display all values of a multicheck array if they are checked?
I'm really a rookie to PHP, i'm using the customfield fields&meta boxes plugin for wordpress.
Normaly when i register a customfield,
i display them by using:
<?php if ( ...
0
votes
1answer
71 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
20 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
50 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
39 views
echo is just displaying the word 'array', rather than the array
I have a post_id of 31 , & a meta_value of custom_repeatable . But when I echo the variable (like below), all is says is array when I use the shortcode. I'm not bothered with the ...
0
votes
0answers
11 views
problem retrieving specific custom meta [duplicate]
I want to retrieve just 2 custom fields from my post, this is what I've tried:
<?php echo get_post_meta(get_the_ID(), 'CLUB','DATES', true); ?>
This code is retrieving just the first one ...
0
votes
2answers
49 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 ...
0
votes
1answer
37 views
Slideshow with custom post type and categorize with taxonomies [closed]
So I have a problem. I made an custom post type and a taxonomy so I can categorize the pictures.
What I want is to filter pictures for example: category=Frontpage (shows all the items from the ...
3
votes
2answers
167 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
36 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 ...
2
votes
1answer
221 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 ...
3
votes
2answers
593 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
39 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
204 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
63 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 ...
1
vote
1answer
91 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
66 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
45 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
273 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
79 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
59 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
106 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
653 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
441 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
90 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
176 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
152 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
205 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
158 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
216 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 ...
3
votes
2answers
560 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
312 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
128 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
81 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
1answer
139 views
How do I do If Post Meta DOES NOT exist? [closed]
I have the following code:
<?php $buycheck = get_post_meta($post->ID, 'buy-link', true); ?>
<?php if ( $buycheck ) : ?>
<div ...
0
votes
1answer
546 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
303 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
92 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
1k 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
470 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
840 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
833 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
479 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 ...

