Louis
Louis

Reputation: 438

How to integrate a wordpress blog into an existing react website ? (as a www.xxxx.com/blog)

I would like a blog (that have been created, fully with wordpress) to be accessible via my already existing react website (www.xxxx.com) as (www.xxx.com/blog). Is that possible ? I have been searching over the internet to find a solution but could not find any with react/js... Thank you !

Upvotes: 2

Views: 1857

Answers (2)

markratledge
markratledge

Reputation: 17561

WordPress is PHP and MySQL, not Javascript (React). But check if your host allows PHP/MySQL allongisde React.

The WordPress Codex has all the info you need on Integrating WordPress with Your Website (WordPress Codex). You will need PHP and MySQL. See Hosting Requirements (WordPress Codex).

First, assume you have an existing site at http://myexample.com. Next, create a new sub-directory (folder) at your site and call it 'blog' (you could use something other than blog, but you must create this sub-directory). So you now have an empty sub-directory at http://myexample.com/blog/. Now, download WordPress and upload all of its files into this new folder, and install WordPress.

Then, use the header on your index.php file in /blog/ :

<?php
require('/the/path/to/your/wp-blog-header.php');
get_header(); 
?>

Read Integrating WordPress with Your Website (WordPress Codex)

Upvotes: 1

Sereja Nagin
Sereja Nagin

Reputation: 86

Easiest but not the best way would be to use iframe tag. For doing this you specify local page with your blog as src.

Upvotes: 0

Related Questions