Basically client was using variation swatch plugins and using elementor plugins to create single product template, so to show the product variation in that template I faced little issue but at last found how to show it,
Continue reading “Showing product Variation in Elementor made single product page”Category: Web Development & WordPress
Install Free SSL to your domain in Hostinger VPS using terminal and SSH
Basically my client’s ssl was expired, he was using hostinger vps and i have helped him to install a new free ssl to his domain ( hosted in vps) using ssh and terminal.
Here are the steps. Just use the codes i shared step by step.
At First login to SSh
Continue reading “Install Free SSL to your domain in Hostinger VPS using terminal and SSH”Redirect All 404 Error page to Homepage Without Plugins
So, here is the code which you need to put in your theme’s function.php and save it and you are done. Basically here i tried not to use plugins and did it simplest way.
function redirect_404_to_homepage() {
if (is_404()) {
wp_redirect(home_url('/'));
exit;
}
}
add_action('template_redirect', 'redirect_404_to_homepage');
Decorator Design Pattern
Suppose you know how to create plain Dohsa ( Dohsa class) , and you wanted to add flavor to it. You are thinking to prepare MasalaDohsa and OnionDohsa from this plain Dohsa.
So instead of modifying the main Dohsa class, you can add OnionDohsa and MasalaDohsa class which will extend dohsaDecorator class and add the flavor on the main plain Dohsa.
Continue reading “Decorator Design Pattern”How to use Try, Catch, Finally : Exceptions in PHP
Suppose you are creating Participants Class where only participants of age 12 are eligible. So you have to use Try, Catch and Finally(optional) to throw exception if age is greater than 12 or less than 12. Here is an example which you can see.
Continue reading “How to use Try, Catch, Finally : Exceptions in PHP”Install and use WordPress using Docker
Step 1:
Install Docker on your Laptop. You can test docker is installed or not by running this following command in your command line and it will show you the Docker version
docker -v

Step 2: Inside your Applications folder create a folder named “dockerwordpress”
mkdir dockerwordpress

How to change wordpress admin password from phpmyadmin using sql
So you need to login to your phpmyAdmin from your hosting and then you need to open the wp_user table ( you may need to change the prefix based on your wordpress table configuration .
Here i have tried to change the password of user “admin” to “abcdef@@”
Continue reading “How to change wordpress admin password from phpmyadmin using sql”Simple Tutorial of Using Ternary Operator to Find Even and Odd Numbers
Here I have tried to show how to use ternary operator to find out a number is even or odd .
Continue reading “Simple Tutorial of Using Ternary Operator to Find Even and Odd Numbers”Displaying All Images from a Folder Using PHP
In this script, I demonstrate how to retrieve and display all JPG and PNG images from a specified folder using PHP. The code uses the glob function to fetch images with specific extensions and then displays the images using HTML.
How to Handle Dynamic Parameters in PHP: Working with Unknown Number of Function Arguments
By using func_get_args(), you can capture and handle any number of parameters passed to a function, making your PHP functions more flexible and versatile.