Ehsan
Ehsan

Reputation: 2285

create file in a different location

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

Upvotes: 1

Views: 52

Answers (1)

Adib Aroui
Adib Aroui

Reputation: 5067

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.

Upvotes: 2

Related Questions