skywire / wordpressapi
Wordpress integration
Installs: 713
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 6
Forks: 1
Open Issues: 3
Type:magento2-module
Requires
- php: ^7.0|^7.1|^7.2|^7.3|^7.4|^8
- guzzlehttp/guzzle: ^7.4
- magento/magento-composer-installer: *
- skywire/testframework: *
- dev-master
- 3.1.4
- 3.1.3
- 3.1.2
- 3.1.1
- 3.0.1
- 3.0.0
- 2.0.1
- 2.0.0
- 1.15.1
- 1.15.0
- 1.14.0
- 1.13.0
- 1.12.0
- 1.11.3
- 1.11.2
- 1.11.1
- 1.11.0
- 1.10.2
- 1.10.1
- 1.10.0
- 1.9.0
- 1.8.0
- 1.7.3
- 1.7.2
- 1.7.1
- 1.7.0
- 1.6.0
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.1
- 1.4.0
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.0
- 1.1.0
- 0.2.6
- 0.2.5
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
- dev-tests
- dev-magento2.44
- dev-cypress
This package is auto-updated.
Last update: 2025-03-05 12:07:30 UTC
README
Skywire Magento 2 Wordpress API
Wordpress API integration for M2
Installation
Install via composer
composer require skywire/wordpressapi
Admin Configuration
Configure the base URL of the Wordpress instance, this should be on a unique URL or subdomain, subdirectories are not explicitly supported but may work depending on your web server config.
Configure the WP API path, the default for this is /wp-json/wp/v2
and should not need to be changed.
It is possible to password protect the wordpress install with HTTP Basic auth, if this is the case configure the username and password so that Magento can access the API.
Usage
A custom router will kick in before a 404 and check if the page slug exists in wordpress as a page, post or category.
If a match is found the wordpress content will be rendered inside a Magento template.
Layouts are controlled by standard layout XML.
Siblings
There is an additional sibling block which is added to post pages by default, this will show other posts from the same category as the post you are currently viewing
The number of sibling posts can be modified via the layout.
Advanced Custom Fields
https://www.advancedcustomfields.com/ is nearly always installed on the WordPress instance but the fields added do not automatically appear in the WP API.
To add them to the API data install https://wordpress.org/plugins/acf-to-rest-api/
This data can then be used in your post templates .phtml file via $post->getAcf('footer_call_to_action_link')