No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
js
.DS_Store
.babelrc
.gitignore
README.md
footer.php
functions.php
header.php
index.php
package-lock.json
package.json
screenshot.png
style.css
webpack.config.js

README.md

React Wordpress Theme

Basic wordpress theme that runs on React and Redux.

Screenshot

Installation

  1. Clone project into your Wordpress /wp-content/themes/ directory

  2. Turn on Cmccullough React in Appearance -> Themes

    If you're using Wordfence

    Some parts of the WP JSON API get blocked by Wordfence, so the theme might not work unless you turn off Prevent discovery of usernames through '/?author=N' scans, the oEmbed API, and the WordPress REST API under All Options > Firewall Options > Brute Force Protection

Customizing

Need to test how this will handle being a child theme first, but if you want to customize this directly:

  1. cd into this theme's directory
  2. Run npm install
  3. Run npm run start
  4. Start coding

Breakdown

FYI: Many of these React components are split in two, use a component's Container (if available) in your markup to use the component.

Components

  • CategoryList
    • Gives you a list of the post categories
  • Footer
    • The footer on every template
  • Header
    • The header on every template
  • Post
    • A single post
    • Accepts post as an attribute
  • App.jsx
    • Sets up routes
    • Imports the scss file from Bootstrap 4

Containers

All of these are HOCs that fetch data and applies it to the Redux store before rendering it's WrappedComponent

Ducks

I'm using ducks to help tame Redux

Pages

  • Category
    • Lists all the posts for a specific category
  • Determine
    • This figures out if a permalink is a page or a post, and redirects accordingly
  • Home
    • The home page 🤷‍
  • Page
    • Displays content for a page
  • Post
    • Displays content for a single post

Templates