I have a shortcode added to the listing grid and the shortcode is working fine but then it displays it as text on the search result.

function booking_popup_snippet() {    

// Get the wpcode shortcode output
$output_employee_id = do_shortcode('[jet_engine_data dynamic_field_source="meta" dynamic_field_post_meta="employee-id"]');     

// Combine the two outputs into a single output
$output = do_shortcode( '[booking trigger="booking-popup-' . $output_employee_id . '" trigger_type="id" in_dialog="1" employee="' . $output_employee_id . '"]' ); //original

// Return the combined output
return $output; } add_shortcode('booking_popup_snippet', 'booking_popup_snippet'); >

so it will come out like [booking trigger=booking-popup-1 trigger_type="id" in_dialog="1" employee=1]

take a look at this demo https://app.screencast.com/KhZvxyVFZuYxC

the moment user did the search, the shortcode comes out as text... Im not sure why and it's shortcode issue or search function issue or something else..

Can anyone advise me on this? This is really killing me..

Thank you

  • Please also add your ajax filter code for better understand.
    – Jenny
    Jan 3 at 12:37

1 Answer 1


There is a stray > at the end of our code above, make sure that is a ?> instead of >

Try another shortcode, something simple to verify it is not shortcodes in general.

Clear you caching, clear permalinks by going to the permalinks page and clicking update. Check if the search plugin has caching on it. Etc Not sure, sorry.

  • Thx for the info. I have tested the script is working fine. With my limited knoweldge, I got to know that its something to do with ajax. the filter is running via ajax but the particular shortcode is running via admin-ajax. Is there a way to run this shortcode via admin-ajax ? I tried to understand this but got it out codex.wordpress.org/AJAX_in_Plugins
    – futureyoon
    Jan 3 at 9:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.