Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Shortcode gets wrapped in and tags – looks messy › Reply To: Shortcode gets wrapped in and tags – looks messy
But how can I get it to work on my frontpage and my other site-templates (so i can use it inside the menu-header) ? Maybe if I put the shortcode inside “a page-content” and this page content is then displayed with another shortcode inside my page-templates?
That may work, but I hope it is not neccessary to over complicate it. I guess for some reason the page builder does some sort of a conversion for paragraphs and empty line break?
I think it might be just easier to ask the page builder support if they know what this is. There might be just an option to turn off or a line of code to use. It is also possible that this is a yet unknown bug, or it’s intentional for some reason.
I guess another possibility is to simply “minify” the search shortcode HTML output by removing any line breaks by wrapping it to a new shortcode, but that might be a bit fishy solution. Something like:
// use as [wd_asp_wrap]
add_shortcode( 'wd_asp_wrap', 'asp_wrap_shortcode' );
function asp_wrap_shortcode() {
$output = do_shortcode('[wd_asp id=1]');
return preg_replace(['/\>[^\S ]+/s','/[^\S ]+\</s','/(\s)+/s'],['>','<','\\1'],$output);
}
Then use this new shortcode [wd_asp_wrap], but I don’t know if this will actually do anything at all.