Prestashop logo, Visit home page

Link a Wordpress blog

-

If you want to add a Wordpress blog to your PrestaShop Hosting, it is entirely possible.

To do this, you need to follow the following steps:

 

Manage blog folder

In the PrestaShop

Your blog must be contained in the PrestaShop webroot. Take note that the PrestaShop is still in the folder:

/vol/site/current

Therefore, your Wordpress blog will be for example in:

/vol/site/current/blog

Add the variable

In the Variables tab of Ps Hosting you must add a new entry “BLOG_DIRNAME” which takes as value the path to the WordPress directory from the web root.

So here "blog"

hosting_variable_blogdir_blog.png

Remember to save at the top right.

 

Manage the database

PrestaShop and Wordpress share the same database

In this case, you simply need to modify the WordPress configuration file (wp-config.php) and put the data from the PrestaShop database that you will find in Variables.

PrestaShop and Wordpress share two separate databases

You will need to create the WordPress database

Connect using SSH

Go to mysql

mysql

Create the Wordpress database, changing the CHANGE_____PASSSWORD______ with a strong password (minimum 16 characters)

create database wordpress;
create user 'wp_user'@'localhost' identified by 'CHANGE_____PASSSWORD______';
GRANT ALL ON wordpress.* TO `wp_user`@`localhost`;
GRANT ALL ON wordpress.* TO `admin`@`localhost`;
flush privileges;

Then add the Variables in the Variables tab

DB_WP_NAME => wordpress

DB_WP_PASSWORD => [the password you have chosen]

DB_WP_USERNAME => wp_user

Please respect the nomenclature
You will have this:

hosting_wordpress_variables.png

Don't forget to save at the top right with "Save"

Remember to modify this data in the wp-config.php of Wordpress

 

Manage .gitignore

You will need to modify the .gitignore with

# Blog
/[BLOG_DIRECTORY]/*
!/[BLOG_DIRECTORY]/wp-content/
/[BLOG_DIRECTORY]/wp-content/*
!/[BLOG_DIRECTORY]/wp-content/themes
/[BLOG_DIRECTORY]/wp-content/twenty*
!/[BLOG_DIRECTORY]/wp-content/plugins/
/[BLOG_DIRECTORY]/wp-content/plugins/*

The BLOG_DIRECTORY corresponding to the folder which contains the blog in your PrestaShop/
Ex: If your blog is in a folder called "blog" you will put:

# Blog
/blog/*
!/blog/wp-content/
/blog/wp-content/*
!/blog/wp-content/themes
/blog/wp-content/twenty*
!/blog/wp-content/plugins/
/blog/wp-content/plugins/*

 

 

Share

Was the article helpful?