Load WordPress page from a different directory?
-
Instead of using .htaccess rewrites to load a WordPress page from a subdomain, I’m now looking to try just making a .php file that will load a masked page.
Example:
– Load example.com/page (a WordPress page)
– in example.com/folder/index.php (just a basic web directory with an index.php file in it)Contents of the index.php file:
<?php $_GET['page_id']=132; define('WP_USE_THEMES', true); require('../wp-blog-header.php');
While this loads the page, it basically redirects to the page with an ID of 132. I added this to my theme’s functions.php file, but this resulted in the page not being found:
remove_action('template_redirect', 'redirect_canonical');
- The topic ‘Load WordPress page from a different directory?’ is closed to new replies.