Support » Themes and Templates » [Resolved] Search button not working

[Resolved] Search button not working

  • I’m using Twenty Fourteen theme in my site http://www.camminandomontievalli.it (Hosting Linux).
    Search button doesn’t work (i click it but it happens nothing). I have the same problem with my mobile and in this case I can’t use main menu too. In fact even the button to the right of the search button doesn’t work.
    I don’t use Minify.
    How could i fix this problem?

Viewing 12 replies - 1 through 12 (of 12 total)
  • Hi @ilpanzio,

    I checked your site and found the JavaScript that is adding and removing “hide” class to #search-container is not working.

    Have you made any changes in the theme file?

    Try addinf following code in the functions.php file of your child theme or add it in your site using the following plugin.

    function add_custom_script(){ ?>
    	<script type='text/javascript'>
    	jQuery( document ).ready(function() {
    			// Search toggle.
    			jQuery( '.search-toggle' ).on( 'click.twentyfourteen', function( event ) {
    				var that    = jQuery( this ),
    					wrapper = jQuery( '.search-box-wrapper' );
    				that.toggleClass( 'active' );
    				wrapper.toggleClass( 'hide' );
    				if ( that.is( '.active' ) || jQuery( '.search-toggle .screen-reader-text' )[0] === event.target ) {
    					wrapper.find( '.search-field' ).focus();
    			} );
    			} );
    <?php }
    add_action('wp_footer', 'add_custom_script');


    Best Regards,

    I didn’t made changes in theme files and i have no child theme.

    I’ve just installed code-snippets plugin and added your function. Unluky it doesn’t work….

    I tried to deactivate all other plugins but search button doesn’t work.

    Other suggestions?

    Thenk you very much

    Hi @ilpanzio,

    Could you please try deleting current theme and installing new fresh version of Twenty Fourteen theme?


    You have a lot of various javascripts being loaded all over the place in the header and footer.

    The problem is one of those scripts either in the footer or the footer widget area is not being loaded correctly and therefore rendering the functions.js to be output incorrectly.

    Take a look at your site’s source code and you’ll see that this code
    <script type='text/javascript' src='http://www.camminandomontievalli.it/wp-content/themes/twentyfourteen/js/functions.js?ver=20131209'></script> is not rendered correctly.

    If you noticed, your site’s footer is not showing either.

    I followed your suggestion: I analyzed all my plugins and widgets that generate javascripts calls. I found the culprit!! It was the Hitstats counter. I used the same script code during the last 4 years. But now Hitstats standard javascripts countetr’s code is changed. I copied and paste the new one in my widget. Now hitstats’counter is running and TWENTYFOURTEEN’S SEARCH BUTTON IS RUNNING!

    Thanks for your help


    Hi @ilpanzio,

    Awesome, great to see you got that fixed.

    In the future if you face any similar type of issue then you can just try on your development site deactivating all other plugins and using default WordPress theme like Twenty Twelve as displayed in the flowchart on the following page to know which theme/ plugin is conflicting if any.

    [ link deleted, please keep Twenty Fourteen support in these forums and not send people to your site ]

    If the above solution doesn’t help then try removing any code added in widgets, post / page etc.


    Jan Dembowski
    Volunteer Mod. & Brute Squad


    Side note and off topic:

    @wpmu DEV? Hey thanks for helping in these forums. But with all of the available resources in the Codex, these forums, AMAZING volunteers such as yourself please keep the support in these forums.

    Much thanks and back to the topic at hand.


    I didn’t made changes in theme files and i have no child theme.

    That’s good.

    I followed your suggestion: I analyzed all my plugins and widgets that generate javascripts calls. I found the culprit!! It was the Hitstats counter.

    That’s better. 😉 If your problem has been resolved can you mark this topic resolved in the right hand column? You’ll be helping others who have a similar problem when you do.



    Hi Guys,

    I was wondering if any of you know how to change the linking area of the search button within the Twenty Twelve theme, as mine appears to only link in corners of the button and I’d like to make it the entire area.

    My site is http://www.marionhume.com

    Thanks for any help anyone may have!


    Hi Marion,

    Thanks for posting on the forums but to help keep support tickets separate, could you please open a new thread for your new question and also as per the Forum Welcome, you should post your own topic.


    Top Menu doesn´t work on mobile and when i shrink my computer screen


    Does someone know what is the JavaScript that’s supposed to be loaded with the theme that handles things like the search bar and the navigation menu. The script should be located at js/functions.js.

    theme twenty fourteen




    I am using the twentyfourteen theme and the search button was working till a few days back but now it is not working.

    I suspect caching problem but unable to clear cache (Probably the hosting service is not allowing to do so.)

    Can any body help.

    my site is http://rajtech.in


    Hi @cecivusa, MHK,

    I hope you are well today.

    As per the Forum Welcome, you should post your own topic instead of posting reply on the already resolved topic.

    This might also help other members looking for a similar answer. 🙂 Just a suggestion, no stress !

    Have a great day!


Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Resolved] Search button not working’ is closed to new replies.