Custom Fields are fields that can holds arbitrary extra information known as meta-data.

learn more… | top users | synonyms (2)

0
votes
1answer
113 views

Custom Field data only shows after manual post update

I have a custom field [address] that converts a street address and displays it on a google map on the front end post. Upon manual post update, the latitude and longitude address co-ordinates ...
0
votes
1answer
363 views

Add “alt” Attribute to GD Star Rating <img> Tags

I have try over a week to validate 4 images that are retrieved by a code with GD Star Rating plugin This is the code i have: wp_gdsr_render_rating_results(array('template_id' => 49, 'rows' => ...
1
vote
1answer
67 views

Multiple URLS per post non-ascii

I am looking for some best practice / practical advise on a particular URL use case. I am finding myself using a lot of non-ASCII characters in my URLs. This doesn't really make it easy for users of ...
0
votes
0answers
84 views

wp custom field image and text multiple time

from previews example link try to achieve this link this is working but is recreating double time the $text and $image and how can i create a new table to wrap every time a call the text and image? ...
0
votes
1answer
69 views

I want to add a custom field in the rss title of each post, but don't want it to be shown on the site

I've seen that other sites have done this but didn't manage to do it myself. I have certain custom fields for each post and I want one of these custom fields to be shown in the RSS feed in the title ...
0
votes
1answer
335 views

Wordpress built in custom fields don't validate or sanitize? Is there a way to fix this?

I'm surprised to see that when creating post meta using the default/built in custom fields on the post editor page it allows you to enter tags like: <a>,<script>,etc. I then ...
1
vote
1answer
4k views

nextgen gallery: how to get picture url by gallery id

All posts in my site have custom field with nextgen gallery ID. To display gallery I use this code: $gallery_id = get_post_meta( $post->ID, 'galerijos_id', true); // Get gallery id from custom ...
1
vote
2answers
4k 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 "...
1
vote
1answer
160 views

Custom Metabox additional item

I have a custom metabox that have 2 options: URL and a text box called "testimonial". The URL box is working great(when i put some text in this field on admin, the text appears on site), but the ...
-1
votes
1answer
816 views

How I can change PayPal IPN 'custom' field in woocommerce?

I use Woocommerce plugin. All works great, but I need add to PayPal IPN 'custom' field only 1 word instead "order_id" that writes at 'custom' field now. I trying edit this file: ...woocommerce/...
0
votes
0answers
21 views

I need to display a joomla table into a wordpress site

I need to display a database that is made in joomla, into a wordpress site. I tried to import CSV file, I get the data but display is wrong. I want to see the database in wordpress the same way I ...
1
vote
1answer
262 views

Remove wrong dashes from get_the_title()

I have a particular CPT post that has a dash (-) in its title. I copy this title in a variable $var using get_the_title() then I create a custom field somewhere else with a value equal to $var : ...
0
votes
0answers
407 views

Convert date format in meta

I have been storing date format in meta key/value. I have been storing in this format (mm/dd/YYYY) now I need to convert that into (YYYYMMDD) SO I can run a date match in query. Please advice how can ...
0
votes
1answer
46 views

Custom metaboxes not saving after switching themes

I recently switched themes and copied over my metaboxes from the old functions.php into the new one. They show up but when I click publish/edit they dont save add_action( 'add_meta_boxes', '...
0
votes
0answers
44 views

Private feedback on users

I am trying to find a way for users to write private/anonymous feedback on each other (similar to ebay or amazon but private, and so that users can view feedback on them and feedback they have sent). ...
0
votes
1answer
33 views

Output custom field as ul list

I have a custom field who's content I would like to output as a ul list. The custom field contains words that are separated with a spaces between. I'm trying to use this code here but it's not ...
0
votes
1answer
22 views

How can i retrive a text from a custom field

I retrieve the date of an actor by selecting the date. 'data_nasterii' is the name of the custom field. <?php $data = get_field('data_nasterii'); echo date("d/m/Y", strtotime($data)); ?> If i ...
1
vote
0answers
679 views

Unique key for each row in a repeater field

Is it possible to have a unique key for each sub fields in a repeater field? I don't want to use the array index, because the array index can be changed, when adding new rows between existing rows. I ...
0
votes
1answer
102 views

How to use shortcode inside of shortcode in theme

I am trying to place a shortcode inside another shortcode within a page template, however the various attempts I've made seem to not do anything. Here's how my code looks now - <?php echo ...
0
votes
2answers
1k views

IF Custom field value equals ZERO

I am trying to use the following code to check for my custom field for a value of ZERO to then display my div <?php $mp_price_sort = get_post_meta('mp_product_price'); if ($mp_price_sort == '0') ...
0
votes
1answer
387 views

WP_query multiple custom fields not working

I am currently using WP 3.1 and trying to get WP_QUERY to work with the custom fields. My argument is as follows: $args = array( 'post_type' => 'post', 'meta_query' => array( 'relation' =&...
0
votes
1answer
168 views

Cache issue with WP_Query and custom field filtering

I have three separate WP_Queries on a page. Each of them return custom post type items that have a certain checkbox checked and then display one of those randomly. The checkbox has been added using ...
1
vote
2answers
625 views

List of Posts in a Custom Field

I have a question. I have a custom post type called Place. I have a situation that there can be place in place. I want to have a custom field parent_place where I could choose a parent of place. The ...
0
votes
1answer
127 views

Perform function on publish AND save (not just save)

I am using this function to auto-set a post title based on a couple of custom fields: function set_event_title( $data , $postarr ) { if($data['post_type'] == 'event') { $getdate = get_post_meta(...
1
vote
2answers
605 views

global function to apply filter to custom field

I have an action hook which works perfectly for the_content. I would like to apply the same hook anytime a handful of custom_fields are requested. The custom fields are 1) myfieldone 2) myfieldart 3) ...
2
votes
1answer
156 views

Automatically populate a hierarchical taxonomy from a custom field

I've got a vexing how-to that I've not found any help on. I have a custom post type that has a custom field with a date in it (format: yyyy-mm-dd-t). When a post is published or edited, I would like ...
0
votes
1answer
557 views

Saving multiple Metabox contents

I'm putting together a fairly simple Custom Page for a friend on their WordPress site, but I'm having some real difficulties getting the contents of the Metaboxes to save correctly. WordPress doesn't ...
0
votes
2answers
82 views

Custom Metaboxes, multiple post selection

I have the following custom meta-box, which works to list a post type, I simply want to allow multiple values to be selected but cannot get it to work, it appears if I tell the select to store ...
1
vote
2answers
2k views

How to position a custom field before the editor

I have installed Advanced Custom Fields 4.0.1 and created a new Field group containing a single field called preamble. I would like to position this new field before the editor in the posts edit ...
0
votes
2answers
29 views

Correct syntax for retrieving custom field in CPT

I don't understand when to use $post->ID or $post->post->ID with CPTs. I have : $event = get_post( $event_id ); $event_pre_register = get_post_meta($event->post->ID, "Event Pre-register ...
3
votes
2answers
1k views

Set post title from two meta fields

In a custom post type I have post titles disabled, however in the list of posts and in the slug it just shows the title as "auto-draft". I want to automatically take two pieces of post-meta and make ...
0
votes
1answer
312 views

Logic for Nearby places with post and categories

I'm developing a website which has states as categories and posts as cities. What we are trying to do is identify each post (city) and also show nearby cities to the current city. As of now we are ...
0
votes
2answers
423 views

Hooking into the post editing screen for an existing page only

I am working on a Wordpress theme that hides the default WYSIWYG editor and replaces it with a custom module system which is fine and dandy, but I've come to the realisation if someone were to use the ...
0
votes
2answers
1k views

Display background color or image with custom meta box?

With custom meta boxes, how would I go about displaying the background image (or color if no image is linked) within the page. Code for the page where I want data to displayed. I want to apply the ...
2
votes
2answers
2k views

Multiple custom fields with the same name

Is it possible to have several custom fields with the same name? For example, I have a custom field called "promotion" for a CPT called "event". Sometimes there are more than one promotion applied ...
0
votes
1answer
110 views

Checking if field is set before comparing with meta_query in query_posts?

I have a query set up to compare the start and end dates for some custom fields. The start date is required for the post; however, the end date is not. This causes some issues with the following: ...
-1
votes
1answer
185 views

What do the numbers mean at the end of add_action('save_post')…?

I've seen on a few tutorials that there are numbers at the end of the call to save Custom Fields/Meta Boxes on the save_post hook. For example, in the WordPress Codex it gives the following example: &...
0
votes
1answer
1k views

Get custom field label

I've defined some custom fields using Advanced Custom Fields, and I display these fields as keys and values using get_post_meta, e.g.: <span class="campsite_meta_key">מחיר:</span> <?...
0
votes
1answer
82 views

Insert custom fields to a custom post type

I am creating a small blog about my trekking and camping experience. Since different experiences - like campsites, treks and tour operators - have different metadata, I have created a custom post ...
0
votes
1answer
55 views

Single page Wordpress website - custom fields or meta boxes or something else?

Hoping someone can give me a pointer in the right direction. I'm building a website for my friend who's getting married and they've asked to be able to update the site themselves - fair enough. So, ...
0
votes
1answer
149 views

How to sort Custom Fields by a value

i use below code in home page for show a table of custom fields. but i don't know how sort this table by duration value. <table> <?php while(have_posts()): the_post() ; ?> <?php if (...
0
votes
1answer
58 views

Convert many posts from having a specific meta_key to use a post_format

I have 350 posts that were using a plugin-provided option stored in a meta_key ("custom_post_template", to be precise). I want to convert these posts to assign them a specific post_format ("gallery")....
1
vote
0answers
101 views

Meta Query And/Or

My question is very similar to Meta Query with AND & OR? . This question was answered in 2011 by @Otto. With the exception that my logic is different. I want to query, for example, posts with ...
0
votes
1answer
245 views

Wordpress Media Uploader custom Javascript not working

I encountered a strange problem with my JavaScript (jQuery) when trying to modify the behavior of my Media Uploader in Wordpress 3.5 This was my JQuery: $('.attachment-filters').change(function(){ ...
0
votes
2answers
60 views

I want my post to republish again after adding a custom field

I wanted a code in Wordpress that could allow me to republish the post every time I add a new custom field. For example, if I already have a post and wanted to add an update to it; I want it to appear ...
2
votes
1answer
106 views

How to save multiple metaboxes?

I read a tutorial about metaboxes, most of things are clear but I have a question about multiple metaboxes. My question is about saving, in the tutorial: <?php add_action( 'save_post', '...
0
votes
1answer
348 views

get_post_meta property of non object

I am getting a custom field outside the loop in header.php. I get the custom field just fine but I found that when the custom field is empty, I get an error message Trying to get property of non-...
0
votes
1answer
357 views

Display Posts Query with IF function

I'm writing a template to display my custom posts types in a list. But I only want to have the post show if it has a value for one of my custom fields. I'll explain: My custom post type is "Faculty ...
1
vote
1answer
152 views

Create custom field key upon theme activation

Upon theme activation I want to create an 'URL' key for the custom fields. Like in . I know who to run functions when a theme is activated, I don't know how to create this custom field key though. ...
0
votes
1answer
527 views

Archive for custom fields?

Recently I've done a nice taxonomy system on my WordPress website. Created also the taxonomy archive template files, so wherever I'm listing the taxonomies I can click on them and will bring me on a ...