Divi – Align Gallery images vertically center

Take note of the height restriction!

In this case we set the height for the default size of landscape images layout for the divi gallery element.

/* Gallery Image Alignment */
.et_pb_gallery_image.landscape {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 226px;
}

Create New Laravel Project & Generate Auth

Create Project

Just use one.
The are multiple as examples.

composer create-project --prefer-dist laravel/laravel blog "11.*"

composer create-project --prefer-dist laravel/laravel blog "10.*"

composer create-project --prefer-dist laravel/laravel blog "9.*"

Generate Auth

An alternative instead of running npm run build.
Run npm run dev OR npm run watch

// With Boothstrap
composer require laravel/ui --dev
php artisan ui bootstrap --auth
npm install 
npm run build

// With VUE
composer require laravel/ui --dev
php artisan ui vue --auth
npm install
npm run build 

Uploading your js build to the server

If you using git and working locally and using laravel vite.
Build your project and use the below gitignore. This will push your build to the server.

The below is that if you don't include certain directories then your build files will not get uploaded and some servers don't have suffucient resources to run builds online.
So you need to build locally and upload the build via GIT.

/vendor/
npm-debug.log
yarn-error.log
public/hot
public_html/storage
public_html/hot
public/robots.txt
storage/*.key
.env
.htaccess
Homestead.yaml
Homestead.json
/.vagrant
.phpunit.result.cache

Setup Node.js on Shared Hosting Apache Server (Cpanel)

First off you need access to the server terminal. Or SSH acces. If you have that then you can proceed. Else go get your Login permissions or SSH access.

Connect to your server using SSH or Cpanel terminal.

Run the following curl command to download the Node.js source code:bashCopy code


curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash 

This will download the nvm (Node Version Manager) installation script and pipe it to the bash shell to run the script.

Once the installation is complete, run the following command to load nvm:bashCopy code


source ~/.bashrc

This will activate the nvm environment so you can install Node.js and npm.

Run the following command to install the latest version of Node.js


nvm install node

This will install the latest stable version of Node.js and npm.

Verify that Node.js and npm are installed correctly by running the following commands

node -v 
npm -v

These commands should output the versions of Node.js and npm installed on your server

Keep in mind that the above steps may not work on all shared hosting providers, and some providers may not allow you to install additional software on their servers. It's always a good idea to check with your hosting provider before attempting to install software on a shared hosting server.

Manage Apache Server on Linux

Check Apache Status


sudo systemctl status apache2

Start, Stop or Restart Apache


sudo service apache2 start
sudo service apache2 restart
sudo service apache2 stop

For other operating systems such as CentOS/Fedora
Try httpd instead of apache2
Example : systemctl status httpd

Bootstrap Mobile Optimisation

The best CSS library I have ever used for mobile Optimisation!

https://getbootstrap.com/

After full time developing since 2016 I still used this one almost every project I complete. In terms of mobile optimisation. Bootstrap remains king!

It is simple and easy to learn. Allowing new developers to pick it up fast. And cutting down the work load for mobile optimisation greatly. I highly recommend BootStrap to any web developer.

Derek Banas Learn in One Video

Check out this Derek Banas!

Derek Banas was an amazing resource when I was starting out in programming and still to this day is fantastic.
He covers fundamentals and explains tpoics very well and clearly for you to understand. I highly recommend this channel!

You can visit his Learn in One Video paylist here :
https://www.youtube.com/watch?v=Rub-JsjMhWY&list=PLGLfVvz_LVvSX7fVd4OUFp_ODd86H0ZIY&ab_channel=DerekBanas

And you can find his channel here :
https://www.youtube.com/@derekbanas/featured


Divi Remove Project Post Type

By Adding the below snippet to your WordPress functions.php file you can remove the Divi Project Post Type which is added by Default.


add_filter( 'et_project_posttype_args', 'mytheme_et_project_posttype_args', 10, 1 );
function mytheme_et_project_posttype_args( $args ) {
	return array_merge( $args, [
        'public'              => false,
		'show_ui'             => false,
		'show_in_nav_menus'   => false,
		'publicly_queryable'  => false,
		'exclude_from_search' => false
		]
	);
}

Laravel Redirect Index to Public

Edit your htaccess file.
This alone will redirect your root o the public folder.
If you have a lot inside of your htaccess file. Be careful while adding stuff. Ensure you keep a backup before editing and test the addition of the code inside the htaccess file.

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_URI} !^public
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>