create file in a different location

2019-08-05 10:22发布

I want to with wordpress create a page in a different location of common wordpress posts and pages, like this: http://example.com/sitemap.xml and yet I want use WP Loop and all of wordpress functions please help me

标签: wordpress
1条回答
趁早两清
2楼-- · 2019-08-05 11:11

You should call "wp functions" at the beginning of your file using

header('Content-Type: text/html; charset: UTF-8');
require( '../../../../wp-load.php' );

where ../../ ... is the path to your wp-load.php file depending on where you put it.

After this, you can use loop the way you like.

查看更多
登录 后发表回答