Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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

0
votes
1answer
6 views

ACF - Get unique values of array

I need to get unique values of array to use in a filter. This is my code <?php $newsArgs = array( 'post_type' => 'sistemas-sanitarios', '...
0
votes
0answers
7 views

woocommerce multiple custom fields code

I used a guide to add multiple custom fields to the general tab in product post setting. When I enter data into the fields, it saves and shows on product page without problem; The problem is that ...
0
votes
1answer
14 views

Woocommerce saving meta data for each child of variation

I've created custom fields that contains additional meta-data for my product. I'm saving them properly but only for single product. When i choose variation, fields are saved only for parent and i want ...
0
votes
1answer
21 views

How would I correctly implement a new if statement in a child functions file?

I want to make some changes to some Meta within an if statement on a parent function.php file and am doing so via child. The following is a snippet of the parent code: if( !function_exists('...
-1
votes
0answers
31 views

different between $this->meta($id, 'meta') and get_post_meta($id, 'meta')

i need custom rest api endpoint that callback a function in my function get_post_meta($id,'meta') its work but $this->meta($id,'meta') not work, why ? my function : add_action( 'rest_api_init', ...
0
votes
0answers
19 views

checking liked user in wordpress rest api

i want check liked user in wordpress rest api. liked user store in custom meta field "cd_liked_disliked_users" and when return it : i use below code for checking liked user but its not work , whats ...
0
votes
0answers
11 views

Filter in Category Archive with Custom Fields

My need is to create a category filter in the archive.php wordpress file, to filter recipes on that page, or combine them with other category or ingredients on a recipes blog. I access on the archive....
0
votes
3answers
32 views

How to add custom filed value after in wp post title

(WP Post Title)Malwarebytes Anti-Malware (Custom field value)3.5.1.2522 How to add custome meta value in wordpress after wp post title in same hyperlink
-2
votes
1answer
29 views

Adding a custom field after post title (ex.Example Title [30 Second Read])

function wpd_title_prefix_filter( $title, $post_id ) { if( $checked = get_post_meta( $post_id, '_wpd_title_prefix', true ) ){ $title = '[30 Second Read]: ' . $title; } return $...
0
votes
0answers
24 views

Editor value in a custom theme

So I'm making a custom theme, and I need access to the inputed editor value. I know I can access this in my post loop by calling the_content() generally, but I'm not sure if this is the correct way of ...
0
votes
1answer
18 views

How to replicate data storage and querying using Wordpress. Custom posts/fields or Custom db tables?

I am new to Wordpress development but have experience of other dev. I would like to store information that in a more trad setup would mean setting up some tables with primary keys and then a joining ...
0
votes
1answer
29 views

Filter custom WP_Query by first letter of a custom field - hopefully using Search and Filter Pro?

I have a custom WP_query that very simply filters a custom post type: <?php $query = new WP_Query( array( 'post_type' => 'professionals', 'search_filter_id' => '204' ) ); ?...
0
votes
0answers
29 views

How To Append Text To Custom Field If Value Equals Specific Text

I have a custom post type which uses a custom field, named 'course_availability', to display whether a course is full or if there are still places available. The custom field will only ever display ...
4
votes
2answers
72 views

WP_Query orderby custom field then post_date in one query

I need to order the first three posts by a custom field, and subsequent posts by post_date in one query - for example: Post 4 (field_order: 1) Post 3 (field_order: 2) Post 2 (field_order: 3) Post 1 (...
2
votes
2answers
45 views

How can i force Display names to be the same as Usernames?

i need help. My users register to the website. They type their username user_login (see chello) but the Display name (see chello04) is not the same. It has a random two digits at the end. Is there a ...
1
vote
1answer
55 views

Add Custom Field to a template page backend

I need to add a custom field to the page of a recipe blog that as a specific post page for recipes. It has also a Custom Field sidebar backend menu where I can add a custom field with a custom name. ...
0
votes
1answer
86 views

Different Taxonomy Values for Each Post

I'm trying to build a site at the moment that includes the different stores and times that albums will release. I'm not sure how I should structure it with custom taxonomies and custom fields etc. ...
0
votes
1answer
28 views

How to pass page as an argument like post in WordPress?

I am using this code to pass arguments in posts: $args_automobile_just_launched_bike = array( 'posts_per_page' => 3, 'post_type' => 'post', 'order' => 'DESC', '...
-1
votes
0answers
10 views

WordPress search through excel sheet of 10k tool names

I have a list of 10,000 tools in an excel sheet that I need to be able to search through in WordPress. The list of tools does not need to stay in excel, that’s just where it is right now. I need to ...
-1
votes
1answer
18 views

Changing the order of custom fields in the dashboard for Woocommerce variable products [closed]

I followed this quick/well laid out wordpress tutorial for adding custom fields to WooCommerce variations. http://www.remicorson.com/woocommerce-custom-fields-for-variations/ Everything worked great....
1
vote
0answers
12 views

How to create an input field, and base the output on spreadsheet data? [closed]

Fair warning, I'm brand-new to WordPress. I'm creating a site about fonts. I'm trying to set it up so that the user enters a font name in an input field on the home page, presses a "Submit" button, ...
1
vote
1answer
63 views

How to list custom fields as headers and list all pages sharing that custom field under it?

I'm trying to use a custom field of "State" to list all the city pages for available locations. I'm able to get the right results, in the (alphabetical by state) right order with this code: <?php ...
1
vote
2answers
36 views

Using advanced custom fields from one custom post type in another custom post type / using nested shortcodes

I have 2 custom post types, project and person. Both have several custom fields. I'm working on a template for the project custom post type. In the project custom fields I have several fields of type ...
2
votes
2answers
81 views

Adding a custom field to the site identity menu

It seems by default WordPress provides fields for site-title and tagline. I understand how to add (for example) the option to chose a logo, adding add_theme_support( 'custom-logo' ); to the functions....
1
vote
0answers
35 views

How can I add extra word in permalink when someone click download button?

I am new in here. I actually do not understand really it a WordPress related question or not. I think it is. My site runs into WordPress. My question is when someone clicks my post it shows a download ...
1
vote
1answer
28 views

Add custom field (value) to search result (without plugin)

I need to add custom field to wordpress search result. This what i tried to do is used pre_get_posts filter, like this: function search_filter( $query ) { $key_fields = array ( 'buty' ); $...
0
votes
2answers
53 views

WordPress function saves a post twice and updates all posts

I'm having a problem with a custom function. This function counts the post and assigns a number to that post. It then saves the number to a custom field and then updates the permalink to the post. My ...
-1
votes
0answers
17 views

create a custom input form as an extension

I'm trying to create a form with an input (Ex: my age), and I want to display result from that input (Ex: display my name). I want to create a form like this page https://batdongsan.com.vn/ho-tro-...
1
vote
0answers
19 views

Better way to save image in custom field

When I store image as custom field value, I currently use a plugin, Types Toolset. Basically it saves the full path of image after uploading the image, and it calls the value and put it as img tag's ...
1
vote
1answer
16 views

how to make members list directory through wordpress post custom meta key.

I have created a website in which I am providing complete information about the organization. For this, I am using a Wordpress post. In which I am putting information of only one organization in a ...
1
vote
1answer
31 views

Duplicating Table of Contents for Paginated Post

I have a technical blog with very long posts. I'm using pagination (via <!--nextpage-->) to separate the content into multiple pages. I manually add an html table of contents (TOC) on the top of ...
0
votes
0answers
11 views

split content around a shortcode in a custom wp_editor

so here goes. I am developing a custom content manager for WordPress. with this I have created a Block Manager, you add a block, you pick container size, background colour and so on. One of the ...
2
votes
1answer
50 views

Gutenberg add a custom metabox to default blocks

Is it possible to add custom meta boxes to the default blocks in Gutenberg? I would need to add a user-defined data-attribute to each block. This data-attribute then would be printed on the frontend ...
1
vote
0answers
63 views

Why the pagination for a query modified by pre_get_posts doesn't mind the number & order of posts sorted & selected based on a custom date time field

I have the following task I'm trying to accomplish. I want to display events in the post post type. I want to sort them by date and time and there should be events only displayed happening right now ...
0
votes
0answers
16 views

WooCommerce discount on user group and vendor

My problem is kind of unique. Imagine that end users are grouped and they get discounts from vendors products. Each group gets different discounts for each vendor. For example: UserGroup A gets 10% ...
2
votes
1answer
44 views

Make custom field meta not display if there is not data in it

I current have a custom field that is displaying even if there is not data inputted in the meta box when posting. How do I remove the hr, title, and ul if there is not data input? Here's the code I ...
0
votes
1answer
22 views

How to add code to custom field to every blog post via php?

I have a custom field value in every post. I need a rule to automatically add code to that custom field in every blog post. How can I do this ? thanks :)
1
vote
0answers
9 views

Comment Form - custom field

I have a custom field on the comment form, I would like to hide the custom field when it's a reply to a comment. essentially view the field it's a new comment only.
1
vote
1answer
32 views

Dynamic dropdown select values depending on other custom field value

i have custom fields like this: "country" - values: "USA", "Russia", "China" "city" - values: "Chicago", "Moscow", "Beijing" I want when user in custom field "country" choose value "USA" after that ...
0
votes
0answers
9 views

How to paged a custom field

Problem I have a custom field called "week" with values like 1, 2, 3 created with ACF would like to know how to be able to create a paged. I would like to put in a template a system that appears the ...
0
votes
2answers
45 views

woocommerce product custom field

I have added custom field in woocommerce Products>General Tab. But I am not getting those custom fields value in response using following link:- http://yoursite.com/wp-json/wc/v2/products/ My Code:- ...
0
votes
1answer
23 views

WP Cli - post add meta in xargs after wp post generate - add multiple fields

This command will generate posts and create a field with key "bar" and value "foo" wp post generate --format=ids --count=10 | xargs -d ' ' -I % wp post meta add % foo bar This does not seem to work: ...
0
votes
2answers
24 views

Show image depending on the number in the custom fields

I am currently using Wordpress and I have a problem. I'm trying to develop a code that shows an image or another image based on the value of the custom field In each product, for example, I have a ...
0
votes
1answer
51 views

Order posts by title and custom field value?

I want to order posts by title, but always show featured posts first. I have the code below to order posts by title. Now I would like to always show posts first that have the metafield '...
1
vote
0answers
76 views

Gravity Forms: Create fields programmatically

Is there any possiblity to create and manage gravity fields dynamically? I have form with ID 4 with couple fields. I want to add some fields of type checkbox with my own custom external data which can ...
0
votes
0answers
8 views

Comments Edit Input Form

I am using the Penscratch template. How do I make changes in the code so that users do not have to enter their website, and the form does not then show an entry box for that website?
-1
votes
1answer
22 views

How do delete a meta key?

Unlike the rest of the platform for some reason, there is no apparent way to simply modify a meta key where it lists them for a given page. I created a meta key as a means of testing, but I can't find ...
0
votes
0answers
19 views

php code for Timber (twig)

I have a webpage with Timber and now i need to add a custom php code in post file but how i can make my php code for twig? Code is here: global $post; // current post displayed /* grab the value of ...
0
votes
0answers
44 views

Woocommerce Search by Filter Custom Fields

I create a taxonomy and custom fields search filter. <form role="search" action="<?php echo site_url('/'); ?>" method="get"> <input type="hidden" name="s" /> <select ...
0
votes
1answer
29 views

ajax delete value from custom field array

I have on my page a multi file upload that saves post attachments within a custom field --- if (!empty($_FILES['vidPix']['tmp_name'][0])) { $i = 1; $files = $...