I have a WP project with following docker-compose configuration. When I try to connect my http://localhost to access the installation, I get 500 and I read this in the log: PHP Fatal error: Uncaught mysqli_sql_exception: Connection refused in /var/www/html/web/wp/wp-includes/wp-db.php I assume there is someth…
Tag: wordpress
Automatically Sort Table By Ascending Quantity in Php/html, not sql
I have data, from HTTP requests, that I am rendering in the form of a table. Right now, I just have it so that the listings are ordered as the for loop processes them, but I want it so that the for loop processes them and then sorts the data according to highest % of weight. Weight is a column
Woocommerce conditionally load a custom product template
I am creating a custom theme and I have copied the file content-product.php to my theme folder. There I have made changes to the html structure and css. I can load of list of products and see the changes working via the short code [products]. However elsewhere on the site I want to display another list of pro…
Woocommerce custom email is triggered if specific product ID is in order but not if other products are in the order
I have a custom woocommerce email trigger function in my Woocommerce store. This email function triggers 2 different emails based on product meta data. If specific product meta is empty it triggers email number 1 and if it’s not empty it triggers email number 2. This works excellent when there is only s…
Limiting WordPress Search to specific blog category not working
So I’m trying to create a search form on a blog page so that it only searches the posts with the category “blog” this is the search form code I’m using: This is the search.php code: When a query is searched, the url loads like it’s limited to the category: https://www.scraperapi.…
How to change variation color based on variation stock status in woo commerce?
working on the website built with WordPress + Woocommerce and I’m trying to change the attribute background color on the product page if it is on backorder. for example, size 4 should have a different background color, because it’s out of stock and available on backorder: WPC Variation Swatches fo…
Display out of stock products on specific category – Woocommerce
I use the woocommerce / inventory menu settings to hide all of the “out of stock” products from category listings. But there are some products them i want to display in certain categorys even is the stock is 0. Is there a function that can override the upper “main switch” in certain ca…
Php function serialize() returns s:value but i don’t want this ‘s:’.What should I do?
I got this as an O/P: s:287:”a:3:{s:6:”actors”;a:2:{s:4:”name”;s:6:”Actors”;s:5:”value”;s:38:”Felicity Jones, Diego Luna, Alan Tudyk”;}s:8:”director”;a:2:{s:4:”name”;s:8:”Director”;s:5:”value”;s:1…
Updating meta value for specific ids
I am updating post meta with this How can I add this metakey and metavalue not only to post ID 3100, but several other IDs? Answer You can define array of post ids and then you can iterate loop of ids. Try the below code. Update as per OP comment.
How to display extra text field on WordPress author page
I want to display an extra text field on the author page which I can fill in the respective user profile when I logged in. Additionally it would be great if the textfield has a WYSIWYG editor. How can I do that? Answer You can use the hook user_contactmethods to add some custom fields to the user page. See th…