We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [php]

For questions about the server-side programming language that the WordPress core, plugins and themes are written in. Questions about using PHP outside a WordPress context are off-topic but might be asked on Stack Overflow.

Filter by
Sorted by
Tagged with
0
votes
0answers
9 views

How to get notified using email for contact form 7 integrated in popup maker- popup having cookie set

I I had created a button in elementor where user can download pdf. The button is linked with popup maker popup. As someone clicks the button the popup appears and it contains contact form created ...
0
votes
0answers
11 views

Trying to Set Shipping and Billing Details on Form on Order-Pay Page

I'm trying to set Billing and Shipping Details for a WooCommerce order using a form on the order-pay page rather than the original checkout page I need the billing and shipping details to be set from ...
0
votes
2answers
23 views

ACF field key/value to show on taxonomy list

The title might not be 100% spot on, but let me illustrate what I mean: I have a custom taxonomy (doens't matter if taxonomy of post-type), and ACF fields registered on the taxonomy. It all works ...
-1
votes
2answers
22 views

Setting WooCommerce currency programmatically

I have an issue where I need to change the currency programmatically. I am doing an AJAX call and I have noticed that returned results does not take into account which currency the user has set. So I ...
0
votes
1answer
19 views

Filtering custom posts by using checkboxes for taxonomy in an ajax loop always gives server 500 error

I have been working on this for hours and can find no solution. I have a website that uses a custom post type named 'Brands', which has a taxonomy named 'brand-categories'. At my client's request, I ...
0
votes
1answer
18 views

WordPress PHP version

My server has last PHP versión but WordPress still But my site keeps asking for the latest version, how do I update this? Thank you
0
votes
0answers
15 views

Permalink changes after several minutes after saving post

I once created a script for a website of mine that looks at who (which author) saves the page. Based on this information, a script ensures that the page that this author creates is automatically saved ...
0
votes
1answer
15 views

Changing Date Format on Custom Meta Data w/shortcode call

I am currently pulling a date from a users meta and making it so I can input a shortcode and it will show that date in certain places. I have the following code written and it works great! function ...
0
votes
0answers
28 views

REST API - Cart shipping methods with label and rates

I am developing mobile application from my woocommerce store. I am able to add product to cart but I am not able to count shipping methods for that cart. Whenever I retrieve shipping methods it ...
0
votes
0answers
87 views

AJAX to add to cart multiple products woocommerce

I found some AJAX on here to add a product to cart through WC through a button click, and I am trying to modify it to be able to add multiple products with the single click. I am not super familiar ...
0
votes
1answer
16 views

Check If bootstrap last column is even or odd (using ACF custom field)

Im using Acf Custom field in wordpress to get my custom field in Acf Reapter as below: <?php if(have_rows('field_name')):?> <?php $i = 1; while(have_rows('field_name')):...
0
votes
0answers
15 views

Child Theme Aaron Customizer

I created a child theme Aaron and wanted under advance settings-> “check this box to hide the clickable site title in the header menu” to always be default checked. How do I modify this on the child ...
0
votes
0answers
17 views

Updating User Profile information removes image

I have a custom front end user profile form. When updating the profile without changing the profile's image it will remove the image. You have to reupload the image any time you update your user ...
0
votes
0answers
14 views

custom search refreshing on submit and not giving results

The custom search refreshes on submit and also does not give any results. I am not sure what is wrong with the code but if someone could take a look at it to help me see what I am missing, I would ...
0
votes
0answers
14 views

Show 2 li in one loop php

Example First Loop // content goees here // content goees here 2nd Loop // content goees here // content goees here
0
votes
0answers
18 views

get_terms pagination

Anyone know how to paginate this get_terms function in wordpress, I tried some options but nothing worked, perhaps its because of the label? <div class="comp-modal-content"> </ul> <...
0
votes
1answer
43 views

Customize Add to Cart Button on single product with variable prices

Customize Add to Cart Button on a single product with variable product. In my themes woocommerce folder this is the hierarchy of the file → I have used the same hierarchy as in the woocommerce ...
0
votes
1answer
31 views

get_users(); Is an Undefined Function When Used in Cron Job

I am Using a Wordpress cron to update some usermeta of each user every 24 hours. For which i created a cronjob using the interface provided by my hosting provider. The Cron runs, but the code cannot ...
0
votes
1answer
20 views

file_exists function does not work

$filecs=get_stylesheet_directory_uri().'/css/lucilevi.css'; $filejs=get_stylesheet_directory_uri().'/js/lucilevi.js'; if (file_exists($filecs)) { echo "CS found"; } else{ ...
0
votes
0answers
8 views

Change Return Format on Advanced Custom Fields Time Picker

I'm using Advanced Custom Fields Time Picker and the return is showing like the image below. In the field settings I have the return set to the way I want, but still is returning weird. I tried a few ...
0
votes
0answers
9 views

Gravity form dynamicly genrated field

I have created a field which is generated dynamically with parameter as (uuid) unique identification I wanted to pass the entry id along with some prefix to but not after the form is submitted ie. ...
0
votes
0answers
33 views

How to fix color picker in caldera forms wordpress?

When configuring the form in the admin panel, everything works, at the front the field with a predefined color does not react at all. All plugins and themes were disabled, the developer has already ...
0
votes
0answers
14 views

Parent menu item with character space breaks dropdown for submenu

My team has a WordPress site with a custom FoundationPress theme. One of the primary nav items is "About us", this item has secondary items nested beneath it in a submenu. This is configured in the ...
0
votes
0answers
22 views

How to display a relationship field in the first paragraph?

I use plugin Advanced Custom Fields to create a relationship field to make related posts. I want to display the result after the first paragraph in each post. How can I do that? Please help me This ...
0
votes
0answers
24 views

Use WordPress Transient to show cURL

So there is a small issue that I'm running into that I can't seem to figure out. When i set set_transient('instagram', 'test', 900); it returns the 'test' as the _transient_instagram in the database ...
1
vote
1answer
27 views

Colon is Missing In My Website Url in Wordpress

add_action( 'init', function() { add_shortcode( 'site_url', function( $atts = null, $content = null ) { return site_url(); }); }); I'm Using The Short Code [site_url] and My Short ...
0
votes
0answers
9 views

Link Change Dynamicly

I have embed an iframe in my website. I want to change the source code dynamically. Which way and how I do this. Should I use shortcode for this?
0
votes
1answer
37 views

XAMPP-VM Mac OS Mojave wordpress debugging using XDebug

Someone please point me to a knowldge article or information on how to setup Xdebug on XAMPP-VM Mac OS in particular. The dev configuration: XAMPP-VM Mac OS Mojave 10.14.6 VScode with PHP debug ...
-1
votes
1answer
26 views

Woocommerce - Shipping tax class based on cart items not using the highest tax available

We have the "Shipping tax class" option on "Shipping tax class based on cart items". When I add a free tax product to the shopping cart and a 21% tax product to the shopping cart together, the total ...
0
votes
0answers
14 views

Add a prefix to the Wordpress Home directory

I have a code like the following, <?php function link_fn( $url ){ $lang = get_query_var('lang', false); if( $lang !== false ) { $url = $...
0
votes
0answers
8 views

Is there a way to use an html/php form to dynamically set the parameters for a woocommerce product?

I am currently doing a website for a courier company that has a very complicated form for processing orders. I was previously using eForms, but it couldn't do what I needed it to do. At the end point ...
0
votes
0answers
23 views

Different Post URL Base for Specific Categories

By default WordPress allows you to edit the permalink structure: Ideally wanting to have most posts as a simple URL such as site/post-name. However a few categories such as events, news, and albums I'...
0
votes
2answers
65 views

Create a form and have custom menu display based on user answers?

I want to create a "User Guide" form that will allow users to answer questions and pick the categories that they are interested in viewing. After they pick their categories and answer the questions I ...
0
votes
1answer
14 views

How To Use htaccess to Rewrite Link Structure for a Page that is Generated Programatcially

My site uses a plugin Easy Digital Downloads, which creates products that are of url structure, sitename/downloads/{Product} I want to change them to sitename/{product} For example, https://milyin....
0
votes
1answer
25 views

How to Schedule Cronjobs for start of every month and year

I have been trying to run a function at first of every month, and first of every year. And i wanted to run at 12am exact. Below I have shown the function. When is schedule it for daily it works ...
0
votes
0answers
12 views

wordpress upload image and set as featured

I would need your help since I'm getting "crazy" as I can't figure out how to do this. Basically I have an ajax call that sends an URL and name to PHP function that uploads the file. It's supposed to ...
0
votes
2answers
34 views

display custom plugin view on front end inside template body

EDIT May be my question is not well formed i need to use the url http://localhost/wordpress/houses/all-houses to display a house plugin view somewhere in plugin directory function getHouses(){ ...
1
vote
1answer
22 views

Query all posts of a custom taxonomy term

I am using this code on single.php, This query working well but when post has parent term (that parent also have child terms) this give output all posts of parent & children But in this condition ...
0
votes
0answers
18 views

Adding a new field to the address field type in gravity forms

I'm following the documentation for adding new address types in Gravity Forms located here: https://docs.gravityforms.com/gform_address_types/ My goal is to add a new dropdown for County where State ...
0
votes
0answers
23 views

Sort posts numerically by converted date format

Updated for clarity: I need to convert the post date format from Y-m-d to mdY and sort by mdY numerically, not by the actual timestamp. My goal is to order the posts by month first, then day, then ...
1
vote
1answer
23 views

Using a `Template Parts` folder instead of an `Includes` folder in a Custom Wordpress Theme

When I've built static sites in the past I've had an includes folder and used php if I've needed to repeat components / HTML over different pages. I've noticed in Wordpress that this functionality ...
1
vote
0answers
12 views

Get page that displays all children of taxonomy parent

I created a Taxonomy called articleTopics. The taxonomy has two parent terms, and the same six children terms for each. I have to link to a page which shows all children of either parent term. For ...
1
vote
1answer
12 views

Can't get custom posts of taxonomy to show

I have a custom post type called 'brand', with a taxonomy of 'brand-categories'. try as I might, I cannot find a way to display a list of posts in the current taxonomy. can anyone help? <?php ...
0
votes
1answer
14 views

How to hook code to show after the_content?

I am trying to hook some content AFTER the_content, but no matter how I do it I still get my custom content BEFORE the_content: add_filter( 'the_content', 'ow_add_sctns_to_ctnt' ); function ...
1
vote
0answers
12 views

Shrink down register_settings on Settings API

Instead of having so many function calls, is there a way that I can have one function call and all the fields under one section and then just call one section on the form? /** * Register each ...
1
vote
0answers
19 views

Show admin notice on incorrect value on form field

So I'm still learning about the Settings API on WordPress and can't seem to figure out how to handle admin notices on an empty database and then have validation. Registration: function ...
0
votes
2answers
29 views

How can I get the custom post title?

I need to get the title from my custom post but its showing from my default post. here is my code. please help.
0
votes
0answers
25 views

BLOG LOOPS Not WORKING CORRECTLY -

I am having issues with my blog loops. I had someone customize by site but they made a mistake with the blog posts. ISSUE: I have three different pages that feature blog categories (events, news, ...
0
votes
0answers
22 views

How to Add Order Confirmation Popup in WooCommerce Site

I am looking out for some way that helps me create a pop up window that shows up on order confirmation page. I tried some plugins but none of them let me add the person's name who ordered and what ...
0
votes
0answers
12 views

How to update user_meta_data from frontend

I want my user to be able to choose if they are a company or individual I've made a user_meta_field in database and it works fine, but how do i make some sort of option on my page-profile.php template,...