All Questions
6,217 questions
0
votes
0
answers
47
views
Custom fields: Split data from single custom field's sub-array to separate custom fields when saving post
TLDR; I’m using a plugin that stores its custom field data in a sub-array, and I would like to save parts of the data from the sub-array to separate custom fields when a post gets saved.
In my case, ...
0
votes
1
answer
56
views
How can I make a search term redirect to a page
I'd like users to enter a unique number such as "756463" and it take them to a specific page.
How can this be done please?
1
vote
1
answer
486
views
Problems with draft website pages
I set up all the pages for my website (set as public & DRAFT) (https://9v7.961.myftpupload.com/?page_id=50) - BUT - lots of stuff not working (menu shows no pages, cannot link to Posts, custom ...
0
votes
0
answers
42
views
How do I create a term for every value of a post meta?
I have some information stored in post meta that I'd like to convert to terms. I'd like to create a term in a custom taxonomy for every meta value with a particular key.
I need to loop through ALL ...
0
votes
0
answers
15
views
Site uses wpdb to fetch meta_keys but just displays first meta_key from a page (the post uses the same meta_key "filmmaker" more than once)
My page should display all filmmakers, that have been tagged as "filmmaker" in my posts. I do have posts that feature more than one filmmaker (meta_key = filmmaker) in custom fields, but ...
0
votes
1
answer
558
views
How to get all specific fields from one ACF Group?
I have created few question/ answers using ACF.
Field names are question_1, question_2 and so on.
My codes are:
<?php if (get_field('question_1') == 'yes') && (get_field('question_2') == '...
2
votes
1
answer
641
views
How to detect if an ACF custom-field is really in use?
I want to find out if a custom-field is in use for a post or term.
That means the custom-field has a content and is not empty.
I guess that's more difficult for selects, radio or checkbox-inputs.
So ...
1
vote
0
answers
34
views
WP query with variables gives no result for specific user
I'm trying to fetch one custom post with two values: the logged in user ID and a known string, both as variables.
The query works out fine when testing on an admin account where the user ID is 1 and ...
0
votes
0
answers
59
views
Function to Compare CPT Post Custom Value with Default Posts CF Value
I want to create function for compare custom field values of CPT Posts with default posts CF Value. As of now I implemented below code in template file which is working fine, but I want to create ...
0
votes
0
answers
133
views
Advice how to connect custom database with Wordpress, change data in Wordpress and finaly use this data
Is it possible to create a page in WordPress that will allow logged-in users to create new or change existing content from the custom database?
So I think this task could be divided into three parts:
...
0
votes
1
answer
663
views
Display ACF object field data using Elementor Custom Query
Hello i'm working on a website using elementor pro + ACF.
I have create a custom post type (CPT1) with ACF object field that take another CPT2 as values. I would like to display on my CPT1 page all ...
0
votes
0
answers
46
views
Create taxonomy terms from custom field values
I have a CPT 'Candidates', where its custom fields are being fetch from an API.
I am planning to convert/associate the values of these custom fields as taxonomy terms. Because I need to filter the '...
0
votes
0
answers
60
views
Mandatory field in Custom post
I am learning WordPress Plugin Development. How can I make Mandatory Fields in Custom Post ?
0
votes
0
answers
40
views
How do I ensure that post_type and Taxonomy use the same slug?
I had to create a Custom Post Type and taxonomy to add a question and answer section to my site. But I want both of them to use the same persistent link. The codes are like this, so one of the two ...
1
vote
2
answers
457
views
How Do I Add HTML Support to the Additional Category Description Field?
I created an additional description field for categories, but what I write in html is saved in MSQL without html, how can I add HTML support to this field?
For example, I write a statement like this:
&...
0
votes
1
answer
296
views
How do you add a featured image to a page (not post)?
There's no "add featured image" in the settings section in a page I created. On the other hand, a similar blogpost I created has this setting. I went over some websites which told me that I ...
1
vote
0
answers
3k
views
How to create repeater field manually, without plugin (ACF Pro)?
Looking for a way to register a custom field to appear on specific pages or post types, that would behave as a repeater, whose content I could then get on the front. Paying for ACF Pro for one small ...
1
vote
1
answer
94
views
How do I count the number of pages a user has seen on my site, and force them to log in after a certain amount
I'm looking to write a little function that counts how many pages the user has clicked through in this section. When it gets to a certain amount, I want to prompt them to log in and prevent them from ...
0
votes
0
answers
15
views
Can I restore restore content from old Worpress site to a new Worpress site from an archive
I managed a now defunct Wordpress site (www.wp_old)several years ago that I still have complete archive of. It was created using Updraft Plus.
I recently configured a development server, and have ...
0
votes
1
answer
14
views
Display Additional Info
Hello guys, i have this problem. I added this additional field but i can't get the value for that specific field
I'm using this code but shows nothing:
($field['type'] === 'cedula' && !empty($...
1
vote
0
answers
261
views
Elementor Combined all Sections into 1 Text Editor
I am hoping someone might be able to help me with this.
I used Elementor to edit my front page, which was great because it was nicely organized with sections and content and everything.
Now I just ...
0
votes
0
answers
422
views
Creating New Dynamic Fields for a Certificate (Number Generation, Code Referencing, and more)
I'm making a certificate that's supposed to autogenerate and involves the need for multiple dynamic fields. I have everything else finished but I have difficulty trying to create 3 dynamic fields. ...
0
votes
1
answer
502
views
Display posts with specific value first in query
I would like to display posts that have a certain value in a meta field first. I would like to display posts that have a certain value in a meta field first. I have tried it with meta_query and ...
0
votes
1
answer
172
views
Add string to page title if post in specific category
Can someone please help me add a string to WP page title depending on category of a post ?
I did this with post title (code below) however I want to extend it to page title.
function recipe_titles ($...
0
votes
1
answer
30
views
if custom field doesn't exist, use post thumbnail instead, as image background
I am trying to modify a code in my theme, but I only partially succeed. I need a working condition, if a custom field is not present, to use the post thumbnail instead, as the background image.
if the ...
0
votes
1
answer
121
views
Wordpress rewrite rule for specific page and second parametr doesnt work
I have a link like this: https://example.com/page-test/?v=p300 and I created rewrite rule to point new url: https://example.com/page-test/p300/ but it doesnt work.
Just there is redirect to correct ...
2
votes
2
answers
2k
views
Update post meta custom field using block editor
I have a custom mapping plugin that (among other things) saves/updates coordinates to a custom field when the user drags a map marker within a custom block. Everything works as expected except for the ...
0
votes
1
answer
18
views
Intiger meta value with '>=' returns posts with lower value
My post has a custom post meta named duration. which has the video duration in seconds. Like,
Post 1's duration: 1
Post 2's duration: 56
Post 3's duration: 155
Post 4's duration: 7
Post 5's duration: ...
0
votes
0
answers
24
views
meta_query weird behaviour, static int will work, but not user data
I am currently trying to build a Ajax filter for a CPT, all the products have a min and max value of a specific range in which the products works best. Therefore i created ACF groups with a min and ...
0
votes
1
answer
34
views
Separate blog and reviews categories
I created a review website recently where I write website and product reviews.I intend to write blog posts too on my website. I don't want to create subdomain or separate blog page.Both review posts ...
0
votes
1
answer
105
views
How to use custom fields like Title to show value in content?
I need some automation in my Wordpress Blog.
As we type Title and it appears in post. How can we add fields like Title?
Then how I can show the value of those fields in my single-post. I want to use ...
0
votes
1
answer
41
views
Creating a redirect option for current page url
I am running a multisite network with around 8 websites. Currently, some sites have more content than others(for example, mysite.com/uk and mysite.com/dk have more posts). What I am trying to achieve ...
0
votes
1
answer
38
views
Update value inside array update_post_meta
I am trying to change default values inside array in custom field.
But I am getting error "PHP Fatal error: Uncaught Error: Cannot use string offset as an array" when I try to change the ...
0
votes
0
answers
71
views
WP query_posts group by meta field related
Hello Guys i am trying to customize a wordpress theme and am getting this is How it queries All Posts with episodes post_type.
My Question Is.
this Post type is related to another post_type which is ...
0
votes
1
answer
51
views
Get previous and next custom post by custom field
I try to get previous and next post so I do this :
$args = array(
'post_type' => 'event',
'post_status' => 'publish',
//'posts_per_page' => 1,
'...
0
votes
2
answers
53
views
Need to search a custom field (ingredients, one long string per post), but want it to allow phrases/non-exact matches
So I have a complex list of ACF repeaters for ingredients, but have a save hook to store them all as one comma delimited text string in a custom field to help. My current "advanced" search ...
0
votes
1
answer
173
views
Meta field bulk editing no longer working in WP 6.0 [closed]
Until recently, I was using the following PHP and jQuery code for adding bulk editing support for a meta field (price) in a custom post type (Book):
PHP:
function show_bulk_edit_book_metabox( $...
0
votes
1
answer
59
views
Hide custom column in admin template screen (Elementor) [closed]
My plugin adds a custom column to admin posts and pages screens but it's also adding it to the Templates (Elementor) screen. I know users can hide this themselves, but I'd rather do it in my plugin.
...
0
votes
1
answer
177
views
Conditionally run function based on custom meta value?
I’m looking for a way to conditionally display an image within certain Woocommerce hooks that I choose based on whether a value is true within a custom meta field for the products on my site.
For ...
0
votes
1
answer
2k
views
How do I upload file through custom field, save it to database and get it
I have made a custom field without any plugin. When I choose file I want to upload that file and get its url on my page. Basically, I want to upload video and show it on frontend. This is my code ...
0
votes
0
answers
43
views
Custom plugin places html head content in body
I'm currently working on a plugin. I have to render a lot of html on a specific page. I've placed that piece of code in the plugin it's core file, like so:
add_filter('the_content', '...
0
votes
1
answer
135
views
Conditional operator OR not working with custom fields
OR operator is not working for both conditions, only check first value if true then code executed and if first is false then not check 2nd condition and return else output.
I also try with LIKE ...
0
votes
0
answers
29
views
Wordpress Phone Field Check (use numbers, spaces and pluses)
I'm a newbie in PHP, I use this PHP code that works like a charm. It's a custom form that sends to Woocommerce different fields. I want to add a "preg_match" check for each of those fields ...
0
votes
1
answer
78
views
What snippet do I need to type to show my ACF field show up on my theme?
I've been trying all kinds of things but I can't get it to work cuz my Theme single.php looks different that usual.
I made a field in ACF named Region and then enter for example USA which I need to ...
0
votes
1
answer
83
views
Hide Status Option From WordPress Publish Metabox and Rename Published on:
I want to hide Status option on publishbox and rename Published on to Date Created for Custom post post_type like you see in red on the below picture.
0
votes
0
answers
26
views
"Can't update in WordPress"
WordPress changes can't showing.
WordPress version: 5.5.3
Node version: 14.19.3
PHP version: PHP 7.4.29
npm version: 6.14.17
There is a website under development in WordPress.
I edited the page in ...
1
vote
0
answers
69
views
Is there any way to get all meta and standard columns for any WordPress object after searching based on meta key and value
I have a scenario where I have a meta key and value and a WordPress object name, I want to search based on the meta key and value and retrieve all details stored in db, for example if this is for a ...
1
vote
1
answer
75
views
Remove Body Classes
I need to remove specific body classes added as a comma separated delimited list to a custom field input field like this
wp-custom-logo, single-post, postid-28, single-format-standard, logged-in, ...
0
votes
1
answer
102
views
How to conditionally add Custom Post Type to Front Page
I am using the following code to show my custom post types on my front page along with the default post type:
// allows the products to show up on the main page
function add_custom_post_type_to_query( ...
1
vote
0
answers
195
views
How to add fetchpriority parameter to images in the media library?
I want to add a custom field called fetchpriority to the images in the media gallery. This parameter should be added to the image when it is inserted in a post.
Ex: I have an image called logo.png. ...