1
add_filter('wp_nav_menu_items', 'add_search_form', 10, 2);
function add_search_form($items, $args) {
if( $args->theme_location == 'primary' )
$items .= '<li><div class="sp-search"><div class="top-search"><?php echo do_shortcode('[yith_woocommerce_ajax_search]'); ?></div></div></li>';
return $items;
}
How can I insert this shortcode "<?php echo do_shortcode('[yith_woocommerce_ajax_search]'); ?>
" inside the div <div class="top-search">
... </div>
correctly?
Shows this error:
Parse error: syntax error, unexpected ''); ?></div></div></li>'' (T_CONSTANT_ENCAPSED_STRING) in functions.php on line 137
And what error appears? Syntax error there are several, if can inform will facilitate ;)
– Guilherme Nascimento
Parse error: syntax error, Unexpected ''); ? ></div></div></li>'' (T_CONSTANT_ENCAPSED_STRING) in ..... /functions.php on line 137
– Fabricio Corrêa