Skip to main content

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
0 answers
5 views

Make URL of a post pretty using JetEngine

I am currently using JetEngine and I have created a Custom Post Type named Creator. I also created a Taxonomy named Creator Categories. I have a Creator post named Beyond the Wall which I assigned a ...
Tsukimoto Mitsumasa's user avatar
0 votes
0 answers
12 views

Alerting woocommerce new order recipient dynamically [closed]

I have the below code which adds an email address stored in ACF fields to the new order email depending on if the user is checking out in GBP or EUR currency. This works fine, the problem I am running ...
caffeinehigh's user avatar
1 vote
1 answer
34 views

Wordpress and php 8.1

I am trying to run wordpress 6.7.1 on ubuntu 24.04 with nginx and php8.1-fpm. This is a fresh wordpress install with theme Twenty Twenty-Five and no plugins installed. I also disabled any cache. I am ...
Thomas Aichinger's user avatar
0 votes
1 answer
23 views

Wordpress website not loading

I downloaded an entire existing wordpress website from a filemanager. I also setup the database for it, by exporting/importing the existing database. I also modified the siteurl and home field in ...
Jorn Reed's user avatar
0 votes
0 answers
13 views

How do I ensure that the URL parameters are updated correctly when multiple filters are applied

I am writing a product filter, and ran into this issue. I have 2 different attributes of my product filter: Tilt -- as a checkbox with "Yes" or "No", and Multibrand Compatible -- ...
JohnLyons's user avatar
0 votes
0 answers
18 views

Custom Welcome Message Text That Accompanies Sound Player Suddenly Out of Alignment [closed]

I have a custom welcome message at the top of my site just below the main title text. It's a sound greeting that rotates between three audio bytes when the page is loaded with an accompanying title ...
LK.'s user avatar
  • 3
0 votes
0 answers
17 views

Filtered queries not responeding to page path

I am writing a product filter, and ran into this issue. I have 2 different attributes of my product filter: Tilt -- as a checkbox with "Yes" or "No", and Multibrand Compatible -- ...
JohnLyons's user avatar
0 votes
0 answers
19 views

Change Query Var from s to q

Hi I have kind of an unusual task that I'm not sure exactly how to approach. I would like to change the query string shown in the url bar to use “?q=” instead of “?s=” I am using Elementor as well as ...
Brenden's user avatar
  • 11
0 votes
0 answers
16 views

button for resetting all the custom meta fields

I’d like to have a button to reset all the custom fields for the prices, the button should operate from the author (agency) edit page because I’d like to clean the prices of all the apartments (posts) ...
Andrea Sacconi's user avatar
0 votes
0 answers
25 views

PHP Status Indicators

I am not a developer at all but I have figured quite a bit out myself. I have a website that shows my Employees/Users as online, offline or busy. I have made PHP Status indicators for each person with ...
Tina 's user avatar
0 votes
0 answers
5 views

Display all products outside of filtered function

I have a products page which displays products based on filters. I believe I have found the code in which all of the products are queried. Normally, if a customer selects an attribute such as '...
JohnLyons's user avatar
0 votes
1 answer
23 views

Filtering with Attributes - how to display all non-queried products below query

I addded attributes to filter out products, based on their selection. For instance, I have field named 'tiled' as yes or no. If person ticks 'yes', all the products with the attribute of 'yes' are ...
JohnLyons's user avatar
0 votes
0 answers
12 views

How to Modify Gallery Preview on Edit Screen on the "Visual" Tab in Classic Editior

I am modifying the gallery_shortcode() function from media.php using a plugin. How do I make my custom gallery structure show up as the preview on the edit page. I want to change how it displays in ...
Enjabain's user avatar
  • 101
0 votes
1 answer
9 views

Can you open a media frame to sellect an attachment to associate with another attachment you are editing on an existing media frame?

I want to have a media frame that pops up on click of a button on an existing media frame. This way I can associate another attachment with that attachment. This question shows an example of you can ...
Enjabain's user avatar
  • 101
0 votes
1 answer
30 views

How to create a dynamic url with post title from one website to another?

Since I am new to PHP, i have a question. I've searched a few days on the internet, but don't really find an answer. I have also tried a few plugin's, but nothing replies to my wish... What I want to ...
Nathan Kop's user avatar
0 votes
0 answers
11 views

Trying to change the default page break numbering format

You provided an answer on the below post, I wanted to ask if this should work on Wordpress posts or pages, Im trying to do something similar for posts but I added your code to functions.php and it ...
Steve's user avatar
  • 1
0 votes
0 answers
19 views

Inequality based on today's date and SCF date not working

I have the following custom query and I would like to exclude any posts whose SCF dates are in the past. I have checked that the custom date of the post is returned in the Ymd format and it is. I can ...
Eind999's user avatar
0 votes
0 answers
9 views

WP_Options tabel randomly increasing in size indefinetly

I have a problem with my wordpress page (woocommerce store, woodmart parent theme), where the wp_options table in my database gains almost 50MB in size, in what I thought was approximently every 10 ...
mait konts's user avatar
0 votes
0 answers
15 views

Flat Rate Shipping Based on custom region dropdown field

i have custom dropdown field on checkout page For region select. Have 2 rate: For Region X with cost 5$ (flat-rate:34) Second for all others with cost 10$ (flat-rate:35) I want to set rates on field ...
Irakli Mosidze's user avatar
0 votes
1 answer
32 views

Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english

Looks like this has been introduced in WordPress 6.7 - I have the following code: $loaded = load_theme_textdomain(MY_TEXTDOMAIN,get_stylesheet_directory() . '/languages'); // internationalization $...
Blackbam's user avatar
  • 565
0 votes
1 answer
21 views

Allow HTML in custom taxonomy description, and show it on front end

Sorry I'm quite new at coding, and also working with WordPress and ACF, and I'm trying my best but I can't figure this out: I'm trying to load my taxonomy description in rich text. Currently I'm using ...
Casper Boon's user avatar
1 vote
1 answer
22 views

How to customize WP_Error (REST JWT authentication plugin) [closed]

🔖 Background & Environment WordPress 6.6.2 JWT Authentication plugin 1.3.4 Php 8.3 I'm using the recommended plugin JWT authentication for WP REST API, to authenticate my users. Asking /wp-...
Adrien Villalonga's user avatar
0 votes
1 answer
14 views

get_var not returning a value when the field contains an apostrophe

I am trying to run a comparison on 2 tables based on last names. However, if the fields contain apostrophes, the query returns a blank result. If it doesn't contain an apostrophe, it will return the ...
Darth Mikey D's user avatar
1 vote
0 answers
40 views

Display posts in correct month order using single date custom field

I have developed a WP Query that displays posts from a custom post type and taxonomy, and orders them by date using a custom field. The posts have a single Advanced Custom Fields date picker field ...
Mike Hermary's user avatar
0 votes
1 answer
28 views

Pass WP data to javascript

I'm using data attributes to pass product price calculation formula to javascript. Is it possible to pass it to javascript without being displayed in page source code?
jaroMT's user avatar
  • 1
0 votes
1 answer
23 views

When a foreach loop is used multiple times in blocks, is there a way to ensure a variable always has a unique value?

I'm a bit new to this so sorry if my explanations are a bit daft. We use custom gutenberg blocks on our site. One of them is a FAQ block where you can add questions/answers and they display as an ...
Andrew Shlaimon's user avatar
2 votes
1 answer
34 views

Set custom post type to load custom block pattern by default

I have registered a custom block pattern for use on my non-full site editor WordPress theme. The pattern is available to be inserted in default and custom posts. Now I am wondering how it can be set ...
Mike Hermary's user avatar
1 vote
1 answer
38 views

Application Passwords only for admin user? [closed]

I was wondering if it is possible to only allow the Application Password feature for admin users. I have found this page about it: https://make.wordpress.org/core/2020/11/05/application-passwords-...
RobbTe's user avatar
  • 262
0 votes
0 answers
16 views

Why does my custom slug only show in Gutenberg editor after page refresh?

I'm using an acf field to create a custom slug for a post type. Everything works and saves correct in the database. Only the shown value of the link field in the backend is not updated on publish. I ...
Lisa's user avatar
  • 13
1 vote
1 answer
31 views

Prevent publishing of uncategorized posts

I'd like to prevent posts under the default category named "affitti" to be published. I tried this but with no effect function prevent_default_category_publish($data, $postarr) { if (...
Andrea Sacconi's user avatar
0 votes
1 answer
24 views

Adding a variable to some PHP code with gettext

The year in the following code, that is to say “2024” $titolo_display_price = '<div class="titolo_listino_prezzi" ID="titolo_listino_prezzi">' . '<h3 class="...
Andrea Sacconi's user avatar
0 votes
1 answer
15 views

How could I prevent using the same custom loop in a template file when I only need to change one meta_query parameter?

I am displaying a set of upcoming fixtures for two cricket teams on the same page. The fixtures are created from a CPT and the relevant team is selected from a custom field. I have everything working ...
Craig Watson's user avatar
0 votes
0 answers
12 views

Issues applying JSON body filters in EU F&T Portal SEARCH API with WordPress integration

I am trying to use the SEARCH API service of the EU F&T Portal public REST APIs for retrieving data for further integration with my project, but I am having some problems. I am using WordPress as ...
smelendez's user avatar
0 votes
1 answer
22 views

How to return count number from a wordpress database

I have a database 'wp_db7_forms', with fields, 'form_id', 'form_post_id' and 'form_date'. I am trying to get a COUNT of the number of entries for a specific 'form_post_id'. With this sql query in ...
Malcolm Collins's user avatar
0 votes
2 answers
16 views

Username as Tax_Query Term

I'm hoping someone may be able to point me in the direction of where i've gone wrong. I have a page which has a shortcode to pull through Referrals for the currently logged in user. It just needs to ...
Chris Mitchell's user avatar
0 votes
0 answers
12 views

Facing 503 error on PHP files after deleting hidden files from the root folder

I am in the process of transferring my Wordpress website to Zume hosting. The website was working fine on my previous hosting provider. After uploading the files and database to Zume (using file ...
Vitor Oliveira's user avatar
0 votes
1 answer
18 views

Custom theme on multisite has issues with standard loop output

I am experiencing the following error output when using the standard loop on page.php and single.php on a multisite-based WordPress installation. The loops are the same for both template types, with ...
Mike Hermary's user avatar
0 votes
1 answer
41 views

White Screen of Death on Wordpress Website

A white screen of death is displayed on my website. No matter which page you are on, it remains completely white. The Wordpress admin panel is not affected and is completely accessible. My website ...
Limes's user avatar
  • 3
0 votes
0 answers
23 views

Prevent render in editor via PHP

Simple ACF Gutenberg Block that I would like to use as a wrapper for other content (using <InnerBlocks />). The block's only field is a Link that wraps all of the content in an <a> tag. ...
Darrel Plant's user avatar
0 votes
0 answers
25 views

How to connect input of information in wordpress and sending it using php to the VDS?

How to connect input of information in wordpress and sending via php on VPS (the site itself is on hosting)? With the second one it is still clear (inserted via snippet): $remote_ip = 'smth'; $...
Nikolai Vorobiev's user avatar
1 vote
1 answer
57 views

Unable to remove action from parent theme via child theme

The Blank Slate theme (in its functions.php) adds a jQuery script to each page, which I would like to remove: <?php /* ... */ add_action( 'wp_footer', 'blankslate_footer' ); function ...
The-Coder-Who-Knew-Too-Little's user avatar
0 votes
1 answer
18 views

I've added SKU to Woocommerce permalinks, but I have small issue

I code number 1 in functions.php and number 2 in .htaccess to get product permalink based on SKU. Something like this: xyz.com/product-title/#sku How could I remove "#" from the permalink (...
Abdolaziz's user avatar
1 vote
0 answers
24 views

Disable astra_get_search_form from generating in header [closed]

I have a website with an Astra child theme. Astra is generating a search form in my header. The form is generated 4x by Astra, and as the method="get". I don't use this form, and there is ...
MaxiGui's user avatar
  • 111
0 votes
1 answer
23 views

Hide ID for WordPress User Role Subscriber

How can you Hide a specific Page or Page ID or set of CSS IDs for user Roles that are not admins? Specifically User Role (Subscriber) I've tried global $post; $post_id = $post->ID; if( $...
Jeremy Thomas's user avatar
0 votes
1 answer
51 views

Is it possible to remove the "Shop" title from the WooCommerce catalogue? [closed]

I own and run a gaming website. The games are listed in a WooCommerce catalogue (this was set up prior to my acquisition of it). Whenever the games catalogue page is loaded, the title "Shop" ...
Mus's user avatar
  • 119
0 votes
1 answer
25 views

Function extension

I have the following code: function auto_link_post_titles( $content, $post_id, $field ) { $excluded_ids = array(); // Put the IDs of the pages you want to exclude here $excluded_field_names = ...
Mapa's user avatar
  • 19
0 votes
1 answer
30 views

Remove "Forum" from BuddyPress group creation step

In WordPress, I have BuddyPress and bbPress installed. bbPress creates an integration with BuddyPress where you can add forums to BuddyPress groups. I want to remove the "Forum" step from ...
quantum_leap's user avatar
0 votes
0 answers
49 views

Enable logical for function

I have the following code: function auto_link_post_titles( $content, $post_id, $field ) { $excluded_ids = array(); // Put the IDs of the pages you want to exclude here $excluded_field_names = ...
Mapa's user avatar
  • 19
0 votes
1 answer
15 views

Function exclusion for a plugin

I have the following code: function auto_link_post_titles( $content, $post_id, $field ) { $excluded_ids = array(); // Put the IDs of the pages you want to exclude here $excluded_field_names = ...
Mapa's user avatar
  • 19
0 votes
0 answers
27 views

Custom PHP contact form issue

I'm building a WP website with a custom contact form in PHP, HTML and Javascript. The issue is when the user click the submit button to send the form, it redirects to a 404 page. The PHP function: ...
Mathieu Préaud's user avatar

1
2 3 4 5
212