Answer the question
In order to leave comments, you need to log in
How to display a variable in DOM?
Hello.
My knowledge of PHP is scanty, so please do not throw stones, I will try to describe the task in as much detail as possible.
I have the following function:
function theme_menu_extras( $menu, $args ) {
if ( 'primary' !== $args->theme_location )
return $menu;
ob_start();
get_search_form();
$search = ob_get_clean();
$menu .= '<li class="right search">' . $search . '</li>';
return $menu;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question