How to make Compact Search appear on all pages in the site

Home Forums Product Support Forums Ajax Search Pro for WordPress Support How to make Compact Search appear on all pages in the site

This topic contains 5 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 4 years, 11 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #22727
    doracrow
    doracrow
    Participant

    Hello,

    I’ve purchased the Ajax Pro Search tool and would like to have a compact search display on every page. Fixed, right. I have created the Compact Search but I need some direction on where to place: <?php echo do_shortcode(‘[wpdreams_ajaxsearchpro id=1]‘); ?>

    We have a child theme. Would this code be placed in the functions.php, as described here:

    https://wp-dreams.com/knowledge-base/compact-pop-out-search-bar-placement/

    Some pages have a right sidebar. The home page and several other pages do not have side bars. Does this mean I should paste the code <?php echo do_shortcode(‘[wpdreams_ajaxsearchpro id=1]‘); ?> in two different areas in the php file? Or would that create two instances on some pages?

    (By the way, I did test Ajax Pro in in the mobile menu- it is still there in the menu- since the Ajax Lite Search had issues on mobile, but unfortunately the Pro is not compatible on this site for mobile, either. So now I want to test the Compact Search on pages. I think Pro will work fine on mobile if on pages — once I know how to make it display on every page on the site. 🙂

    Can you please assist me with this? Could I do something like this to make it appear on all pages, on the right, regardless of the pages’ different layouts?

    $exclude_on_pages = false;

    The site is:
    https://www.staging2.ebdesign.com/

    (The staging site is no longer private; I removed the password requirement)

    Thank you,
    Dora Crow

    P.S. I’m not sure how to create a FTP account via cPanel that leads directly to a staging site.

    #22739
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Dora,

    In your case I would recommend using the custom code as described within this knowledge base article (the one you linked). It already includes the shortcode, all you need to change is the variables at the beginning, such as if you want to exclude on some pages, and the search ID.

    For the plugin configuration, I would suggest this for the fixed layout: https://i.imgur.com/UZk7u7H.png

    If you are using the search bar replacement feature to replace the theme search bar automatically, then I suggest making another search instance specifically for this compact box layout, to avoid any conflicst. Then use the non-compact one as the replacement.

    Best,
    Ernest Marcinko

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


    #22745
    doracrow
    doracrow
    Participant
    You cannot access this content.
    #22753
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    Actually, yes, via a small custom CSS snippet. WordPress automatically adds the ‘home’ class to the document body, on the home screen. So using this custom CSS should do the trick:

    body.home>.asp_m {
        top: 30% !important;
    }
    Best,
    Ernest Marcinko

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


    #22754
    doracrow
    doracrow
    Participant

    Hi Ernesto,

    Thank you for providing the code! I’ve been testing it out – (trying different placements) — dealing with mobile is always a challenge! But it does work on mobile, so that’s awesome.

    I have it on my client’s live site now.

    Thanks again for your assistance. This is a very cool Search tool!

    Have a good day — about 3:00 am here so bedtime finally for me. 🙂

    Dora

    #22758
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

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


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

You must be logged in to reply to this topic.