Title: Call Shortcode using Jquery
Last modified: October 13, 2021

---

# Call Shortcode using Jquery

 *  [amarmustaqim](https://wordpress.org/support/users/amarmustaqim/)
 * (@amarmustaqim)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/call-shortcode-using-jquery/)
 * Hi there,
 * I would like to append Ajax Search Lite form beside my search icon (at right 
   side) of my navigation menu. I tried to call the shortcode using Jquery but its
   not working.
 * `$j('<div class="language"><div class="left lang-col" style="color:white;"> |&
   emsp;<a id="show-search" onclick="showSearch()" class="search_button" href="javascript:
   void(0)"><img src="https://designvillage.benova.com.my/wp-content/uploads/2021/
   09/search-icon.png" width="18px"></a> [wpdreams_ajaxsearchlite]</p</div>').insertBefore('.
   header_top_bottom_holder' );`
 * I tried to replace the shortcode with this code also doesn’t work. `<?php echo
   do_shortcode('[wpdreams_ajaxsearchlite]'); ?>`
 * Is there any way to achieve this?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcall-shortcode-using-jquery%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [wpdreams](https://wordpress.org/support/users/wpdreams/)
 * (@wpdreams)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/call-shortcode-using-jquery/#post-14966150)
 * Hi,
 * The jQuery code will not work for sure, you need to append the shortcode on the
   server side – that is the place where shortcodes get executed. Shortcodes are
   not parsed on the front-end, if you place them via javascript.
 * To make this work, you need to find the corresponding template file in the child
   theme directory, and place the shortcode there:
 * `<?php echo do_shortcode('[wpdreams_ajaxsearchlite]'); ?>`
 * Best,
    Ernest M.

Viewing 1 replies (of 1 total)

The topic ‘Call Shortcode using Jquery’ is closed to new replies.

 * ![](https://ps.w.org/ajax-search-lite/assets/icon-256x256.png?rev=3192672)
 * [Ajax Search Lite - Live Search & Filter](https://wordpress.org/plugins/ajax-search-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ajax-search-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ajax-search-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/ajax-search-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ajax-search-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ajax-search-lite/reviews/)

## Tags

 * [jquery](https://wordpress.org/support/topic-tag/jquery/)

 * 1 reply
 * 2 participants
 * Last reply from: [wpdreams](https://wordpress.org/support/users/wpdreams/)
 * Last activity: [4 years, 7 months ago](https://wordpress.org/support/topic/call-shortcode-using-jquery/#post-14966150)
 * Status: not resolved