1

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.

2

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>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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