Create a Blog with WordPress and Gatsby — Part 2

Create a Blog with WordPress and Gatsby — Part 2

In the 2nd installment of this series, I’ll show you how to pull in data from your WordPress site into your Gatsby site! Now let’s go back to our Gatsby site that we set up in Part 1, and get it hooked up to our WordPress site, and pull in some blog pos

Part 2 — The Connection

Now let’s go back to our Gatsby site that we set up in Part 1, and get it hooked up to our WordPress site, and pull in some blog posts!

Gatsby Plugins

Open up gatsby-config.js in your text editor.

First I’m going to edit the siteMetadata from the defaults to make the site my own:

Image for post

Image for post

There are so many great Gatsby plugins, but for the sake of this tutorial, we’ll only install what we need to connect WordPress.

Normally I’d install the gatsby-source-wordpress plugin, but since it is going to be updated soon, let’s try out the new one.

Run:

npm install gatsby-source-wordpress-experimental

Next, we’ll go back and edit our gatsby-config.js file and add a .env file to the project. It will be ignored by gitignore.

This is what mine looks like, minus my login info for my WordPress site.

Image for post

Here’s what we’ll add to gatsby-config:

Image for post

web-development gatsbyjs javascript wordpress react

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How native is React Native? | React Native vs Native App Development

Article covers: How native is react native?, React Native vs (Ionic, Cordova), Similarities and difference between React Native and Native App Development.

Hire WordPress Developer

Whether you want to develop a blog or you want a feature-rich, interactive WordPress website? **[HourlyDeveloper.io](https://hourlydeveloper.io/ "HourlyDeveloper.io")** is a distinguished leader in the WordPress development market. **[Hire...

Best WordPress Development Services in India

Skenix Infotech is a top WordPress Website Development Company in India & USA with expert WordPress Developers. Get affordable WordPress Development Services.

Hire Dedicated Wordpress Developer

Find the latest jobs available in The Middle East today.

WordPress Development Company in India

Skenix Infotech is a top WordPress Website Development Company in India & USA with expert WordPress Developers. Get affordable WordPress Development Services.