Cannot retrieve home url with custom queries
This is just driving me crazy. I cannot get wp to return the home page/url
link. I have tried various combinations of
<?php echo esc_url( home_url( '/' ) ) ?>
<?php echo esc_url( bloginfo( 'url' ) ) ?>
<?php echo home_url() ?>
But they all return the current page. In this case a page with attached
queries.
Now I should mention that 1. I am not using the loop. I have not yet got
to that stage though I did write it in to test this problem. 2. I have
registered custom search queries.
function add_query_vars($aVars) {
$aVars[] = "search";
$aVars[] = 'special';
return $aVars;
}
add_filter('query_vars', 'add_query_vars');
The problem only seems to occur in search.php when these custom queries
are in use. As you have probably guessed the returned home url is always
.../wp-install/?search=foo&special=bar.
Is there any way around this problem?
No comments:
Post a Comment