简体   繁体   中英

Wordpress Controlling Pages Outside of the Root Directory with a Hitch

So we've got WP installed in a the /news directory, and Magento in the website root. Trying to get WP to control something like the /landingpage directory.

Hitch is, I'm not sure we want to fool around with adding too much in terms of .htaccess or the index.php file on the Magento end (Ecommerce is the priority for the project).

Would dropping an include for wp-load.php and/or wp-blog-header.php in and index.php file in the /landingpage directory work? Or is some .htaccess magic the path to pursue?

Many thanks in advance!

You can load WordPress core and remove some of the overhead by declaring the constant WP_USE_THEMES to be false and then including wp-load.php. Something like.

if( !defined( 'WP_USE_THEMES') ) {
    define( 'WP_USE_THEMES', false );
}
if( !class_exists( 'WP_Query' ) ) {
    require_once( '../wordpress/wp-load.php' );
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM