Add Compact search box to specific page whith out Widget

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Add Compact search box to specific page whith out Widget

This topic contains 1 reply, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 1 year, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #32493
    fox80
    fox80
    Participant

    Hi there,

    I just bought AjaxSearch Pro and It’s great product, very satisfied.

    However, I can’t use it. I installed it and configured it and everything is working fine but I can’t integrate the ”compact search box” in specific pages of the website.

    Neither with a sidebar nor through the menu sidebar.The Theme I have (DvpnVersion: 1.3 By Themelooks) doesn’t allow to add a side bar for all pages and bypass theme configurations even with Elementor Pro.

    Besides, entering the ”shortcode” somewhere in each page (which I wouldn’t like to do) are their any other options?

    Please advise

    #32497
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Well, if there is no widgetized area, nor any other way to place the shortcode manually, then probably using a custom code is the only option.

    Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!

    add_action('wp_footer', 'asp_add_shortcode_footer');
    function asp_add_shortcode_footer() {
    	// Page IDs where the plugin should be displayed
    	$show_on_page_ids = array(1, 2, 3, 4);
    	
    	if ( in_array(get_queried_object_id(), $show_on_page_ids) ) {
    		echo do_shortcode('[wd_asp id=1]');
    	}
    }

    So this code will print the plugin shortcode on pages within the $show_on_page_ids array.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.