Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Let's say that I have a URL path that is not handled by wordpress,like /custom/ but I want to add the admin bar to these pages.

What should I add to these pages in order to make the admin bar available in them.

share|improve this question
add comment

1 Answer

Try the following code:

<html>
<head>
<script type="text/javascript" src="wp-includes/js/admin-bar.js"></script>
<link rel="stylesheet" type="text/css" href="wp-includes/css/admin-bar.css">
</head>
<body>
<?php
require_once( dirname(__FILE__) . '/wp-load.php' );

wp_admin_bar_render();
?>
</body>
</html>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.