WordPress Integration

WORDPRESS PLUGINS

The following WordPress plugins should be installed on your website:

NB: Please clean your site cache and permalinks after installing all the plugins to avoid issues.

CONNECT YOUR SITE WITH THE APP

In order to connect your site with the app you have to change the site URL in the following file:
www/js/providers/constants/routes-config.js

Change the URL here:
var siteURL = 'http://invision.surfit.mobi/';

CONFIGURE SIDE MENU

WP API Menus plugin provides few additional paths for WP API plugin:

  • your-site.com/wp-json/wp-api-menus/v2/menus – list of every registered menu.
  • your-site.com/wp-json/wp-api-menus/v2/menus/{id} – data for a specific menu.
  • your-site.com/wp-json/wp-api-menus/v2/menu-locations – list of all registered theme locations.
  • your-site.com/wp-json/wp-api-menus/v2/menu-locations/{location} – data for menu in specified menu in theme location.

If you want to change the default menu location in the app you have to edit the following file:
www/js/providers/constants/app-config.js
Find menuLocation: 'primary' and change primary with the desired WP menu from your site.

CUSTOM MENU LINK

If you want to add custom link in menu item you have to leave the URL field empty and add the URL in the Description field.
For example, if you want to create Home link in Description field you have to write app.categories.
If you want to configure link to a Featured category view you have to write app.category-featured({categoryId:8}), where 8 is the ID of the category.
If Description field is not visible you have to enable it in Screen Options config of the current page.