I have blog and forum, and I need to put wordpress external logout link. What files do I need to add to make wp_logout_url(); work?
Thank you.
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityI have blog and forum, and I need to put wordpress external logout link. What files do I need to add to make wp_logout_url(); work?
Thank you.
To allow WordPress functions to operate outside of the WordPress environment, you need to let your external pages know about and have access to the WordPress Core and API environment.
http://codex.wordpress.org/Integrating_WordPress_with_Your_Website
The above link is one such reference which covers this very purpose.
Specifically,
In order to transform regular PHP pages into ones that utilize WordPress, you need to add either of the following code snippets to the start of each page.
<?php
/* Short and sweet */
define('WP_USE_THEMES', false);
require('./wp-blog-header.php');
?>
or
<?php
require('/the/path/to/your/wp-blog-header.php');
?>
Getting your paths right is very important, without, you'll have no joy.
Refer to the link provided for even greater detail. Any problems thereafter please let us know along with what you have tried, code samples used, etc.
Good luck!
wp-load.php
, as wp-blog-header.php
will handle requests (which the OP probably won't want).
– TheDeadMedic
Nov 14 '12 at 20:49