Adding Saburly Headless WP theme inspired by postlights serverless solution
This commit is contained in:
9
wordpress/wp-content/themes/saburly-headless/index.php
Normal file
9
wordpress/wp-content/themes/saburly-headless/index.php
Normal 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/' );
|
||||
}
|
||||
Reference in New Issue
Block a user