Tagged Questions

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

learn more… | top users | synonyms (2)

0
votes
1answer
11 views

Custom post meta field effect on the performance on the post

I have the posts which have many custom defined meta fields. On posts I am calling them on requirement using get_post_meta. Means for 10 meta fields I am using it 10 times. Am I doing it right? ...
0
votes
0answers
10 views

Custom Post type as Taxonomy

I have a custom post type "issue" and relationship with custom post type "article". What I want is, to create the issue cpt as a taxonomy for the article cpt, and showing it in article post list. When ...
-1
votes
1answer
20 views

Genesis Blog page Template Using multiple custom fields [on hold]

i'm using Genesis blogpage template for creating new pages. i'm using custom field "query_args" to filter posts. now what i'm trying to filter posts with some custom field value using below code and ...
0
votes
1answer
18 views

Call the latest posts from a custom field group to be displayed on front-page

i have this custom Metabox field group from https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#group containing 3 fields and displayed on the Products page ...
0
votes
0answers
21 views

Post type archive pages with custom query

Apologies if this is something trivial, but I can't seem to get it right and I can't quite find the correct way to tackle this from previous questions. I am building my own theme. I have the normal ...
0
votes
0answers
12 views

Add custom price to cart [on hold]

I'm trying to add custom price to the cart instead of the regural one. I created a custom field like that add_action( 'woocommerce_product_options_pricing', 'wc_rrp_product_field' ); function ...
0
votes
0answers
14 views

Grouping search results in search.php based off on categories AND custom field names

Wondering if it's possible to output search results based on custom field names and categories via search.php file. I tried this: (with two categories) But didn't work for some reason? <?php ...
-2
votes
0answers
11 views

Add extra price field in woocommerce [on hold]

I am developing a word press site in that I Want to give all products an extra fixed price (which will be different for all products) and then I need to add this fixed price to price column of the ...
0
votes
0answers
24 views

Create custom fields/meta data gender+country - radiobuttons and dropdown on register screen for these fields

On register I want the user to select gender (radio buttons) and a country (dropdown from list of countries) as well as an agreement checkbox. I'd also like all of these to be editable on the user ...
0
votes
0answers
17 views

Store input from user into DB

I'm building a simple web application using Wordpress that takes tons of input from the user (text as well as images and video) about themselves and shows that data (profile) either publicly or ...
0
votes
0answers
12 views

WordPress Custom File upload meta box saving 0 bytes as File size

I am trying to save custom images with the custom post type , so i added a custom meta box for file upload . it seems it is working fine but when i upload any file it save the file size is 0 Bytes . I ...
0
votes
1answer
20 views

How do I display posts with specific value in a custom field into my loop?

I'm trying to display posts that contains a specific value from my custom field. For example, I created a custom field that asks for the year, let's say I would like to display only posts with the ...
0
votes
1answer
23 views

post_per_page ignored in WP_Query

I have a custom post type named 'album' and I added two custom fields 'release_date' and 'release_date_us' with the ACF plugin. I'm trying to display the latest albums based in a widget area. The ...
0
votes
0answers
10 views

Display avatar based on id entered in custom field [on hold]

I would like to display a users avatar in the sidebar. This is how I display the value of my custom field. <?php global $wp_query; $postid = $wp_query->post->ID; echo get_post_meta($postid, ...
1
vote
1answer
18 views

How can I dynamically add a post to a custom post type which uses a custom field?

I have a custom post type called "patients". I was using only the post title, but now I need to make a relationship with users. I made this by creating a custom post field (created by ACF), a ...
0
votes
0answers
47 views

How to ACF custom fields when using 'create_post' method with JSON-API plugin? [closed]

Preliminary information JSON-API is a plugin that as that name suggests creates API endpoints for Wordpress. I'm experimenting with it to use Wordpress just for the backend and doing all front-end ...
0
votes
1answer
17 views

Sort posts by custom fields value using dropdown menu

I'm trying to sort my posts by a custom field value, called price. Only using numbers in the custom field value. I want that the visitors of the website can sort the posts on price by using a ...
3
votes
1answer
64 views

Order by meta_value_num DESC and meta_value ASC on WP 4.0

I have created a custom post type that I want to order by custom-field-1, which is boolean so its value is either 1 or 0, in DESC order (1 to 0) custom-field-2, which contains text and is supposed ...
0
votes
2answers
15 views

When creating a metabox do you have to create DB fields for the data?

I'm just getting to grips with metaboxes for the first time and after reading up on them one of the main question i have is do you need to specify fields in the DB to store the data got input. i.e. if ...
0
votes
0answers
13 views

get adjacent post by meta key and meta value

I'm trying to limit previous/next navigation to posts that have the same meta_value on a certain meta_key. I know this was asked before, but I couldn't pick a working answer. And all that I could come ...
0
votes
1answer
22 views

Show custom field if it exists, and show different elements if it doesn't

Basicly what I'm trying to do (with very basic knowledge of PHP): If Custom Field $randomname exists for that particular post, show the content of that custom field. If Custom Field $randomname ...
0
votes
1answer
47 views

CPT Repeatable Fields + Undefined Index

I'm using this code here for repeating fields in a CPT (yes, I know of ACF and a few others), and have tried to add a third field. The field is currently displaying in the meta box, and is output on ...
0
votes
0answers
21 views

Using custom fields globally?

I'm trying to use the value of one custom field on multiple pages and posts. I'm a newbie to PHP and custom fields so what I'm trying to accomplish could possible be done using a different method. I ...
0
votes
0answers
16 views

Custom Field for Individual Pages in Multi-Page Post

I have articles divided into multiple pages using <!--nextpage-->. I need a custom field say mycf holding different value for each individual page of the article. Also, I need a way to update ...
0
votes
0answers
12 views

Select value don't stay selected after save

I did a multiple select item that takes his options from another CPT, it works but after the saving the selected items don't stay selected. this is my code for the meta box global $post; echo ...
0
votes
0answers
22 views

Why is my blog theme not showing page and post content, or their custom field values?

I have created a proprietary blog theme, with the following: 1 custom post type 1 custom taxonomy Taxonomy X has 2 terms. Each term has 4 and 7 posts respectively. Each post has 5 custom_fields. All ...
-3
votes
1answer
18 views

Tons of Custom Fields [closed]

I recently worked on a website (wedding venues) that required tons of custom fields, more than 80 I believe and heavy customization. Suddenly wordpress seemed a bad choice of platform for this ...
0
votes
1answer
20 views

How to save values of a custom input field on the Network > Site Info screen

I'm struggle with implementing a custom input field on the screen of a Site Info in a Network. I've managed to create a field with help of this post but i have problems with saving the value. When i ...
0
votes
1answer
21 views

Comparing 2 Decimal Numbers from custom fields and displaying posts

This is really confusing me. Hopefully you can help me. What i want to do, is search for a number and display anything that is either minus 1 or plus one of the search result. The numbers that it will ...
0
votes
2answers
16 views

Filtered by a custom field, ordered by another

I am trying to loop custom post-types, filtered by a custom field artist-status => invited and ordered by another custom field last-name alphabetically. Here is what I managed to write, and it ...
0
votes
1answer
37 views

Display custom field meta outside loop, site wide

I've created a custom field ("breaking") with the goal that whenever one post has this field present, it will display the value in the header throughout the site (that is, all posts, pages, archives, ...
0
votes
0answers
14 views

Output terms based on custom fields

This question is rather specific. In my custom posttype "sak", I have a taxonomy called "vvpl". This taxonomy has a custom field called "revision" because a term have copies based on how many ...
0
votes
1answer
54 views

Enable a short code in the custom meta field

I was wondering if there is a filter that allows me to enable short codes to work inside the custom meta fields in my posts. I know the following code enables it in widgets: ...
0
votes
2answers
23 views

Add custom fields to existing posts (admin pages)

I'm able to add a custom field for new posts (in the admin pages), using the action hook wp_insert_post. But I would like to add the custom field for old posts, when I am editing the post (in the ...
0
votes
1answer
9 views

Post content is cleared when updating

When I'm updating a post, its content is being cleared. What's wrong with the code below? add_action( 'save_post', 'eb_save_subpage_data' ); function eb_save_subpage_data() { global $post; ...
4
votes
1answer
80 views

Pass all custom fields through the same filter on post load?

Is there a way to filter all custom fields on a post? Lets assume for very basic simplicity I have: standard fields of: title post body custom fields: author ISBN quote Lets assume on page ...
0
votes
2answers
44 views

How do I add custom fields to posts without having to manually add everytime I post?

I am new to wordpress but I was trying to add custom fields to certain posts but I don't want to manually add every time. I saw there is a custom post type class that you can specify but I didn't find ...
0
votes
0answers
18 views

Permalink structure depending on custom field

I'm trying to create a permalink structure that is only used when a certain custom field is filled in. For instance, when the custom field value of 'premium' is '1', I want to add /premium/ to my ...
0
votes
0answers
25 views

Add nofollow to custom field link and make domain exceptions?

I have a theme that enables users to comment a post, and also to add a link inside a custom field. I've tried a few plugins to try to force a nofollow attribute, but none seem to affected the links ...
0
votes
1answer
19 views

Function not pulling image or text from custom post type

//Custom Post Type register_post_type('inf_main_feature', array( 'labels' => array( 'name' => 'Main Featured', 'singular_name' => 'Main Featured', ...
0
votes
1answer
15 views

Display Custom Post if custom field is marked

I'm trying to get a custom post to show up on the front page only if a custom field I made is marked, otherwise it sould look for the one that is (and only one, not all marked). I currently have ...
0
votes
2answers
30 views

Best filter to use for modifying custom fields on a post?

What is the best filter for editing custom fields on a post? I am not actually editing the post content but some related fields. Would it be add_filter('the_content', 'edit_custom_fields');? It just ...
0
votes
0answers
11 views

Default custom column to off

Im currently building a plugin, that adds around 15 custom columns to a custom post type listing with meta data. When registering these columns they all default to being "on" in the screen options ...
0
votes
0answers
31 views

Get Custom Field Value of a $post_id on wp_insert_post Action in functions.php

I have this code in the functions.php file which emails the post content to the admin every time a pending post is added to the database: function send_email_on_pending_post_creation( $post_id ){ ...
1
vote
1answer
16 views

Custom Field Create Bulk via SQL Query

I have a question. A created a custom field named video_desc. I have ofer 2000 posts and I need to add this custom field to all posts and add the text "Description Here" to it. How can this be done ...
0
votes
1answer
22 views

Custom Fields Question

I'm new to wordpress and I am trying to understand these custom fields. I read the wordpress codex page refering to custom fields but I have some questions. I take for example my site. I created a ...
0
votes
0answers
16 views

how to store wordpress terms?

i have customized a wordpress form and added two new fields of type "radio". i got this post array but wordpress not storing radio button data. here is my code for adding radio : ...
0
votes
2answers
19 views

How to dynamically attach pictures to a carousel

I am trying to make single pages for each individual portfolio piece. I created custom posts & field types, but it only seems to allow one featured picture per post. Should I be adding my pictures ...
0
votes
0answers
20 views

Move Content of Custom Field to Post Content

Hello everyone I have a custom field in all my posts - the field is _listing_additional_info This is on a custom post type called listings. I need to move the content of those custom fields into the ...
0
votes
1answer
29 views

predefined custom field on registration page

What I want to do is, i have a professional theme (like elist from elegant theme) and in theme there are so many custom fields. I want to include those custom fields into my Wordpress custom ...