Adding Saburly Headless WP theme inspired by postlights serverless solution

This commit is contained in:
Moris Zen
2018-06-25 00:06:37 +02:00
parent f069f6782f
commit 9d7f3de76a
12 changed files with 431 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
<?php
// Redirect individual post and pages to the REST API endpoint
if ( is_single() ) {
header( 'Location: /wp-json/wp/v2/posts/' . get_post()->ID );
} elseif ( is_page() ) {
header( 'Location: /wp-json/wp/v2/pages/' . get_queried_object()->ID );
} else {
header( 'Location: /wp-json/' );
}