• 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 to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author wpdreams

    (@wpdreams)

    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.