Git Product home page Git Product logo

wptheme.snoepshop's Introduction

Readme

Tools to run WP locally

  • MAMP
  • Ngrok OR localtunnel (tool to make localhost available over the internet)
  • Relative URL (WP plugin, to make URL paths from wordpress relative)

Styling

SASS is used for styling, to compile it during development you have to run a script. See chapter 'Run' for this.

Test (Mollie) webhook locally:

To interact locally with a webhook you should make use of a tool to make localhost available over the internet. Use Ngrok or localtunnel for this. Currently Ngrok is not working, but Localtunnel is.

Installation

Make and/or install WordPress locally using MAMP. Clone this project and place it in the themes folder of the WordPress installation. Make the theme active in your local WordPress admin panel. After that create in the admin panel new pages and connect the right template to each (new) page. So the coded pages are connected to the pages that are created in the admin panel.

  • Run npm install in the theme folder (with package.json)

Make sure Ngrok and/or Localtunnel is installed globally:

Ngrok

https://ngrok.com/download

Localtunnel

npm install -g localtunnel https://www.npmjs.com/package/localtunnel

Run

  • Start MAMP server
  • Run npm run start to start the SCSS compiler

Share localhost app over the internet

Ngrok
  • Run npm run ngrok to share the localhost app over the internet using Ngrok (Not working atm).

Will run: ngrok http --host-header=myapp.dev 8888 ^ Will connect to Mollie webhook, but will return you to not existing webpage: myapp.dev:8888/xxx/xxx/xxx

You can also use rewrite to tell ngrok to use the local address hostname. ngrok http --host-header=rewrite 8888 ^ Will not connect to Mollie webhook.

Localtunnel

  • Run npm run localtunnel to share the localhost app over the internet using localtunnel.

Settings

wp-config.php file

Add this piece of code at the top to set site url and home url dynamically.

define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']);
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']);

Sources

wptheme.snoepshop's People

Contributors

rowinvanamsterdam avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.