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]'); ?>
" into div <div class="top-search">
... </div>
correctly?
Show this error:
Parse error: syntax error, unexpected ''); ?></div></div></li>'' (T_CONSTANT_ENCAPSED_STRING) in functions.php on line 137