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

learn more… | top users | synonyms (2)

0
votes
0answers
12 views

sequnce in enter words in wordpss search using query

I have a problem in creating advanced search with custom query and using $wpdb->get_results($query , OBJECT); In Normal search in wordpress when we search xxx yyyy or search yyyy xxx we have same ...
0
votes
0answers
29 views

How to let users “collect” posts?

I have a post called "games" where I add information and review games. I want to add a way that users could add some posts to a collection. Something similar to "favorites". And then display the posts ...
0
votes
2answers
22 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 ...
0
votes
1answer
684 views

Extra profile field as select box?

I want to add some more profile fields to Wordpress. It works fine with normal text box: <input type="text" name="gender" id="gender" value="<?php echo esc_attr( get_the_author_meta( 'gender', ...
1
vote
1answer
39 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 ...
2
votes
2answers
63 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
2answers
170 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 ...
0
votes
1answer
28 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
0answers
61 views

How to pull Magic Field items in a group by a specific permalink and not the list order?

I am currently making some fixes to a site that someone else built. They have a custom post type called 'News" within that is a group called 'Category List' with an image, title and description. The ...
0
votes
1answer
50 views

Custom Fields and Buddy Press

I would like to setup a simple feature in Groups with buddypress. Basically, I would like the landing page the group where the HOME button is for example, to have 3 fields... just like so: I'd like ...
0
votes
1answer
52 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
25 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
22 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
39 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
26 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
358 views

Populate wordpress menu with link to custom field value (file download)

I have an additional menu that appears on some single.php pages. To this menu I would like to add an li with a link to a PDF which is uploaded to the post by a custom field (advanced custom fields ...
0
votes
1answer
22 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 ...
0
votes
1answer
32 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
17 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 ...
3
votes
2answers
795 views

How to validate custom fields in custom post type?

I wrote a plugin that creates a custom post type with custom fields. To prevent users from entering incorrect information, how can I validate the data? I assumed that the save_post hook function ...
1
vote
1answer
290 views

If meta key exists in get posts function otherwise create it

The following code fetches posts with the meta key home telephone numbers. $metas = ''; $args = array( 'numberposts' => 1, 'post_type' => 'electors', 'orderby' => ...
0
votes
2answers
189 views

How to load php file for specific page in admin?

Hello and thanks for the guidance! Trying to load a custom .php file for only my home page (template is page-home.php) by using this code: add_action('admin_init','load_home_meta'); function ...
0
votes
0answers
51 views

How to change the default image uploader

Recently i'm using the awesome files of jaredatch (https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress) to create custom metaboxes and fields. I'm still learning about this part and ...
2
votes
1answer
701 views

How to filter a dd/mm/yyyy date from a custom field in a query

I'm trying to build a query in order to sort some posts by a date custom field, where the dates are formatted dd/mm/yyyy. It works by querying the database directly with get_results like in this ...
0
votes
1answer
100 views

custom comments form for custom post type

Hello everyone I am creating a theme dedicates to hotels display and booking in which I have created a custom post type 'Hotels' so now I want a mechanism to book the hotel rooms and a "book now" ...
1
vote
0answers
26 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
88 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(){ ...
2
votes
1answer
47 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
2answers
33 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 ...
0
votes
1answer
45 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 ...
6
votes
1answer
432 views

Any way to add custom options to Gallery Settings?

Now that Wordpress has updated to version 3.5, the media gallery has been overhauled and this custom options solution doesn't appear to work anymore. I'd like to add a couple of fields to the gallery, ...
0
votes
0answers
20 views

How make a link to meta_key for all meta_value

I have a meta_key = 'company', where meta_value = name of the company that introduces the user to order form. Then these companies appear on the publication page (index-job.php). How make a link the ...
0
votes
2answers
120 views

Settings API - save multiple tabs at once

In the attached screenshot you can see the structure of the theme options we are working with. There are 8 tabs and for each tab, we have created custom fields using code similar to what can be seen ...
0
votes
1answer
74 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
40 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
0answers
24 views

Get only form elements in Contact Form 7

I want to get only the form elements of a form when applying do_action() for a contact form. My plan is to include only the input fields from other form in a main contact form. For example: I have a ...
0
votes
0answers
44 views

Custom Wordpress Meta Query

I have a post type (course) that has some meta data associated with it, namely the following two: City and State The two pieces of data above are stored in the postmeta table, with meta_keys ...
0
votes
1answer
40 views

Custom fields: my custom checkbox area doesn't seem to work

I'm trying to create my own custom fields meta box filled with just checkboxes in pages. I'm basing it off this tutorial here. I was able to get the original tutorial to work, but when I started to ...
0
votes
0answers
69 views

Admin Filter by custom field

I use this for make a filter for post in my admin, on a specific custom post type, but it don't work, the query don't update and i get an empty list add_action( 'pre_get_posts', ...
0
votes
2answers
85 views

Custom fields won't display on my blog page

I created a custom field called 'Page Description' which I use to create a custom title for each static page of my wordpress site. I use the code: <?php echo get_post_meta(get_the_ID(),'Page ...
-1
votes
1answer
61 views

jaredatch metaboxes on video post formats

I'm trying to get a metabox to show up only when the video post formats is selected using jaredatch metaboxes ...
1
vote
1answer
214 views

Trying to reorder posts by custom field

I'm running WooCommerce and am trying to get the default product display to be sorted by the sku field in ascending order. So far I've come up with this: /* Order products by SKU */ function ...
0
votes
0answers
36 views

How to Use Theme Customizer settings for Colors in a Custom Theme?

I've been reading up on the Theme Customizer so I can create a backed for the Custom theme I am building. Based on the tutorials I have read, I understand how to enable the customizer, create new ...
0
votes
1answer
47 views

Custom field Search with Relavanssi

The site I'm working on is a talent website that has actors names, headshots, and resume all created with post_title, featured images, and custom fields. I am using Relavanssi to make my search ...
0
votes
0answers
17 views

Sidebar IF query hiding everything

I have this query which I'm using in the sidebar, but when I place it in a php widget, the whole sidebar disappears... The code is below and the full sidebar code is in a pastebin here ...
3
votes
1answer
53 views

How to use multiple query with same meta key

I use these codes to print custom field query. My custom field key is out_wiki <?php if( get_post_meta($post->ID, "out_wiki", true) ): ?> <div class="outlink"> ...
0
votes
1answer
113 views

How to display posttypes and taxonomy in standard posts, not in a separate label?

I want to display some taxonomies directly in "Posts" label, as standard post, not in a separate label like "Books" for exp., but i don't know how. Is there a way to do this? This is the code: class ...
0
votes
1answer
9 views

Collect Data from NEXT item while in loop

I am trying to get the value of a custom field. The trick? I'm in the loop, currently printing out 2 of 5 for this example. I would like to get some info from 3 of 5 (or even 1 of 5) while printing ...
1
vote
3answers
77 views

Change content before writing to database

I've searched around but I can't quite pin down the answer for this. I am attempting to use the content of a custom field as post_data and save it to the database as such when a post is created or ...
0
votes
2answers
311 views

Duplicate posts being displayed when querying Custom Fields

I have created a small segment within WordPress that records match information for League of Legends. Using up to 30 different custom fields I can store information of 30 champions picked from 3 games ...

1 3 4 5 6 7 25