honeydipp
Member
Posted 4 years ago #
I made a custom header on my root directory which includes a WordPress archive code (wp_dropdown_categories) but I get an error when I use the header on pages without my WP blog. Is there a way to fix this?
<form action="<?php bloginfo('url'); ?>" method="get"><?php wp_dropdown_categories('orderby=name&order=ASC&show_count=1&hierarchical=1&show_option_all=Category Archives'); ?><input type="submit" name="submit" size="5" value="Go" /></form>
honeydipp
Member
Posted 4 years ago #
I use a header.php that I created in my root directory because it's easier to update my layouts that way. But when I try to use it in that code from the link above:
<?php
define('WP_USE_THEMES', false);
require('./header.php');
get_header();
?>
I get an error:
Fatal error: Call to undefined function: bloginfo() in /home/content/x/x/x/xxxx/html/header.php on line 98
Is there a way to use a header from the root directory that includes wordpress codes on pages without the blog on it?
Don't be "creative" - if the resources/documentation says you MUST have the code
require('./wordpress/wp-blog-header.php');
then don't re-invent the wheel. Use it as it is recommended.