Tagged: 

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #310014

    Hi there,

    I’ve edited the Search.php and loop-search.php a bit to get it styled like it is now.

    I’ve got two more questions related to the search function:

    1) Is it possible to reset the searchbox after searching, currently the search term keeps displayed in the searchfield.
    2) When nothing is typed and people click on the search icon, the page displays nothing. Normally it shows you the Not happy try again with search field, but i disabled that.

    Then IE8:

    1) Menu background misses round corner (See Chrome for example).
    2) Favicon isn’t showing.
    3) Text Search (Zoek) is missing in Searchbar
    4) On the FAQ page i use :before class to show images as bullets (See Chrome for example). Isn’t showing on IE8.

    Please let me know.

    • This topic was modified 10 years, 2 months ago by m00n.
    #310179

    Hi m00n!

    1) Its probably possible but I don’t think it would be good UX. The trigger would need to be when a user clicks out of the window or something like that and if it was by accident it would cause the person to need to re-type the original query.

    The issues you are having with IE8 are due to that browser not supporting them. You would need to use a plugin or script that attempts to force IE8 to use css3/html5 in order for those things to work in the retired browser.

    Cheers!
    Devin

    #310329

    Hi Devin, thanks for the response.

    1) But how do i achieve that when people search for something and the results are shown, on that moment/page the search field in the menu is reset to: Search (Zoek).

    2) How do i achieve when people search for nothing and just hit the Search Icon that the result page shows a search-fail message like it does when people search for something and it hasn’t been found on the site.

    In that instance it shows:

    <article class="entry entry-content-wrapper clearfix" id="search-fail">
                <p class="entry-content" itemprop="text">De zoekopdracht heeft geen resultaten opgeleverd.</p>
    </article>

    How do i get that to show op?

    And for the IE8 problems, I solved 1) and 4) both just using images. 1) an image as background as fallback for IE8 and 4) just inserting a Image in front of toggle title and removing the :before class. 2) I’ve uploaded a new favicon and going to upload 1 to the base of the wp installation and recommend the client to clear IE8 browser history cause that would solve it in most cases. But i presume that problem 3) is fixable.

    • This reply was modified 10 years, 2 months ago by m00n.
    #311944

    Anyone any suggestions?

    domein.com/?s= should return:

    <article class="entry entry-content-wrapper clearfix" id="search-fail">
                <p class="entry-content" itemprop="text">De zoekopdracht heeft geen resultaten opgeleverd.</p>
    </article>

    I have edited the search.php do exist out of 1/4(empty) a 1/2 (element with search results) and a 1/2 (with static image).

    What code should i use to insert a created widget area name searchsidebar in the 1/4 element?

    • This reply was modified 10 years, 2 months ago by m00n.
    #312382

    Hi!

    1) If you just want to display the word “search” in the search field and not the last search term open up wp-content/themes/enfold/searchform.php and replace:

    
    <input type="text" id="s" name="<?php echo $search_params['search_id']; ?>" value="<?php if(!empty($_GET['s'])) echo get_search_query(); ?>" placeholder='<?php echo $search_params['placeholder']; ?>' />
    
    

    with

    
    <input type="text" id="s" name="<?php echo $search_params['search_id']; ?>" value="<?php echo $search_params['placeholder']; ?>" placeholder='<?php echo $search_params['placeholder']; ?>' />
    
    

    You can also place the modified searchform.php into your child folder.

    2) Kriesi uses a filter to redirect the user to a 404 not found error page if the search query is empty. You can remove it by adding this code to the enfold/functions.php or child theme functions.php file:

    
    add_action('after_setup_theme','avia_remove_search_redirect');
    function avia_remove_search_redirect(){
    remove_filter('pre_get_posts', 'avia_search_query_filter');
    }
    

    Best regards,
    Peter

    #312443

    Hi Peter,

    Thanks for your response.

    Problem 1) is solved, changed the code a bit so that “Search” isn’t hardcoded in the searchbox (if that makes sence).

    Problem 2) thats almost what i want. Can i make that script to redirect to ?s= to ?s=noresult (Noresult is a madeup string with no search results).

    And as last: I edited the search.php to exist out of 1/4 1/2 1/4 elements. In the first 1/4 element i want to load a custom created widgeteara named searchleft. Is this possible and if yes? What php code should i use.

    • This reply was modified 10 years, 2 months ago by m00n.
    #312982

    Hey!

    2) You can try to use this plugin: https://wordpress.org/plugins/safe-redirect-manager/ to redirect any url which contains your domain to another url. It should also be possible to redirect http://mywebsite.com/?s= to http://mywebsite.com/?s=noresult

    3) Yes, you can embed any widget area by using the dynamic_sidebar() function: http://codex.wordpress.org/Function_Reference/dynamic_sidebar

    If the widget area is called “searchleft” use it like:

    
    dynamic_sidebar("searchleft");
    

    Kriesi uses the function in enfold/sidebar.php to display all sidebar widget areas.

    Cheers!
    Peter

    #313025

    Hi Peter,

    Thanks for your followup.

    Problem 2) is solved indeed with an redirect plugin. Not really a nice way but it works. Maybe something for Kriesi to look at in one of the following updates?

    Thanks for the solution for my 3) problem. It worked like a charm.

    Last question i swear :) Is it possible to use the Search field without the live search? I’ve allready display: none the live results, but when typing a search string, it still tries to do a live search and sometimes interrups the input.

    • This reply was modified 10 years, 2 months ago by m00n.
    #313569

    Hi!

    Yes – insert this code into the enfold/functions.php or child theme functions.php file:

    
    add_filter('avf_frontend_search_form_param', 'avia_deactivate_ajax_search',10,1);
    function avia_deactivate_ajax_search($params)
    {
    	$params['ajax_disable'] = true;
    	return $params;
    }
    

    Cheers!
    Peter

    #313885

    Thanks! Solved!

    #313890

    Hey!

    Great – glad I could help you.

    Cheers!
    Peter

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Questions about Search function and IE8’ is closed to new replies.