Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #1348343

    Hey Enfold team,

    I´d like to make some styling changes to the ajax search (which I just integrated into my website) like adjust spacing, change colors, remove shadows etc.
    Please see screenshots.

    Also I`d like the search results to be only available in the drop-down menu after clicking the magnifying glass, with no option to go to a results page.
    Is that even possible to completely prevent a redirect to a result page in a quick way?

    Thank you very much in advance for your reply/support.

    Best regards, fkm

    #1348477

    Hey fkm,

    Thank you for the inquiry.

    To adjust the portfolio post type title or label, try to add this code in the functions.php file.

    add_filter('avf_ajax_search_label_names','avf_ajax_search_label_names_mod', 10, 1);
    function avf_ajax_search_label_names_mod($label)
    {
         if($label == 'Portfolio Items') $label = 'New Label Here';
         return $label;
    }

    You can then use this css code to adjust the styles of the ajax search based on your specifications. Please make sure to toggle or temporarily disable the Enfold > Performance > File Compression settings after adding the css.

    .av_ajax_search_image {
        border-radius: 0;
    }
    
    .av_ajax_search_content {
        top: 10px;
        position: relative;
    }
    
    #top div .av_ajax_search_entry:hover {
        background-color: inherit;
    }
    
    .avia-search-tooltip .avia-arrow-wrap {
        display: none;
    }

    Best regards,
    Ismael

    #1348915

    Hey Ismael,

    every single code works just fine – thank you so much.

    As you adviced, I deactivated the functions for file compressions (CSS and Javascrit) under Enfold/Performance.
    Should I keep it like that in the long term?

    In addition, please let me know how to redesign the search results box (change position, add/remove borders, adjust spacing) – please see screenshots.

    Is it possible to disable the connection to the search results page and only use the above-mentioned box for the search?
    If so, please let me know how to disable the redirect to a search results page feature.

    Thank you very much in advance.

    Best regards, fkm

    #1349320

    Hi,

    Thank you for following up.

    The target state for the AJAX search results only works on wide screens or when the main content is located on the right side of the page as shown on your screenshot. It doesn’t work really well on smaller screens, when the main content is center aligned. The search results are not clearly visible without the white background because it blends in with the main content.

    This is how the AJAX search looks like when we removed its default background and box shadow.

    Screenshot: https://1drv.ms/u/s!AjjTfXSRbKTvwFbfXs8sJgniwYpI?e=mN7caF

    Best regards,
    Ismael

    #1349367

    Hi Ismael,

    thank you very much for your reply and for the screenshot you made.

    This is a misunderstanding – please excuse, I think I was unclear:
    The background was intended as a white background (not transparent), just without any borders or shadows.
    Please see screenshot: https://www.dropbox.com/scl/fo/zbfksedvzvl9z4gkqf853/h?dl=0&rlkey=s0yqm92o4jsh8z409ytoi6ths

    Thank you very much in advance for another feedback.

    Best regards, fkm

    #1349750

    Hi,

    Thank you for the clarification.

    Try to use this css code to remove the box shadow and borders of the AJAX search container.

    #top .avia-search-tooltip {
        box-shadow: none;
        border: none;
    }
    

    Again, toggling the file compression settings and purging the cache might be necessary.

    Best regards,
    Ismael

    #1349814

    Hi Ismael,

    thank you so much for your reply – the css code works fine.
    This also allowed me to make a couple of other small styling changes on my own. :)

    There are still a handful things I´d like to change within this topic – I tried myself, unfortunately without success.
    So I´d be very grateful for your help (please also see screenshot):

    1. remove the loading icon in the search field
    -> I already removed the magnifying glass in the search filed using the Enfold Forums with the following css code:
    #searchsubmit {
    display:none;
    }

    2. reduce the height of the search result items

    3. remove the light grey background color of the search result items

    4. reduce the size of the magnifying glass next to the burger menu on mobile devices

    5. disable the funktion/link of being redirected to the search results page by clicking the magnifying glass or enter

    Thank you very much in advance for another reply.

    Best regards, fkm

    #1350055

    Hi,
    Thank you for your patience, to remove the loading icon and the item background color, try this css:

    #top .ajax_loading_now > div > div {
    	opacity: 0 !important;
    }
    #top div .av_ajax_search_entry:hover {
        background-color: rgba(0,0,0,0) !important;
    }

    After applying the css, please clear your browser cache and check.

    Best regards,
    Mike

    #1350165

    Hi Mike,

    thank you so much for your reply and the css.
    It works just fine – great!

    Please also let me know how to reduce the height of each search result to bring them closer together vertically (please see screenshot point 2).

    Thanks a lot in advance.

    Best regards, fkm

    #1350173

    Hi,
    Glad to hear, try changing the top and bottom padding to zero from 10px with this css:

    #top #menu-item-search .av_ajax_search_entry {
        padding: 0px 16px;
    }

    If that is too close together try changing the top and bottom padding to 5px like this:

    #top #menu-item-search .av_ajax_search_entry {
        padding: 5px 16px;
    }

    try adjust the number to suit.
    After applying the css, please clear your browser cache and check.

    Best regards,
    Mike

    #1350279

    Hi Mike,

    this works fine too – so motivating, thank you very much!

    Please let me know the CSS to also adjust the spacing between search results and headings as well as the spacing at the bottom of the search box.
    Also, the letter spacing of the headings (“Pages”, “Projects”) is a bit too wide. Please let me know how to change these.
    Please see screenshots.

    Thanks a lot in advance.

    Best regards, fkm

    #1350307

    Hi,
    Please try this code in the General Styling ▸ Quick CSS field or in the WordPress ▸ Customize ▸ Additional CSS field:

    #top #searchform .ajax_search_response h4 {
        letter-spacing: 0.10em !important;
        padding-bottom: 10px;
    }
    #top #searchform .ajax_search_response {
        padding-bottom: 10px;
    }

    adjust the padding-bottom & letter-spacing to suit.
    After applying the css, please clear your browser cache and check.

    Best regards,
    Mike

    #1350437

    Hi Mike,

    exactly like that, works great again – thank you so much!

    I have three final points on this topic, for whose help I would be very grateful:
    1. I´d like to reduze the size of the magnifying glass on mobile devices (I tried by myself again and again without success)
    2. I´d like to stop redirecting to the search page when pressing enter/return (and in general) after typing the search term
    3. when I type into the search field on the iPhone, the view zooms in. Is it possible to prevent this, too?

    Thanks a lot in advance for your reply.

    Best regards, fkm

    #1350480

    Hi,
    To change the mobile search icon size try this css:

    @media only screen and (max-width: 767px) {
    .responsive #top #wrap_all .menu-item-search-dropdown > a {
        font-size: 12px !important;
    }
    }

    and adjust to suit.
    To stop the search form from submitting with the enter key, try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:

    function custom_script() { ?>
        <script>
    (function($) {
    $('#menu-item-search').click(function(){
    	setTimeout(function(){
     $("form").attr('onSubmit', 'return false');
    	},500);
    });
    })(jQuery);
    </script>
        <?php
    }
    add_action('wp_footer', 'custom_script');

    As for the search field on the iPhone view zooms in, this is the iPhone itself and we can not change.

    Best regards,
    Mike

    #1350592

    Hi Mike,

    everything works great, just as imagined.
    I’m really happy – thank you so much! :)

    I just noticed during testing that the standard text for no search results is a bit long for my case:
    “Entschuldigung, aber kein Eintrag erfüllt Deine Suchkriterien”
    Although I spoke of “final points” before, I would like to ask you again for your help in this case.
    Is it possible to shorten/change the text?
    Please also see screenshot.

    Thanks a lot in advance.

    Best regards, fkm

    #1350615

    Hi,
    Try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:

    function ajax_not_found_text() { ?>
        <script>
    (function($){
    setInterval(function () {
    $('#searchform .ajax_search_response .av_ajax_search_entry.ajax_not_found .av_ajax_search_content .av_ajax_search_title').text(function(index, text) {
        	return text.replace('Entschuldigung, aber kein Eintrag erfüllt Deine Suchkriterien', 'Entschuldigung, nicht gefunden');
    });
    }, 50);
    })(jQuery);
    </script>
        <?php
    }
    add_action('wp_footer', 'ajax_not_found_text');

    adjust the Entschuldigung, nicht gefunden text to suit

    Best regards,
    Mike

    #1350771

    Hi Mike,

    it works and looks great!
    So this topic can be closed.

    Thank you so much Mike and the Enfold team.

    Best regards, fkm

    #1350790

    Hi,
    Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 18 posts - 1 through 18 (of 18 total)
  • The topic ‘Ajax Search Styling’ is closed to new replies.