WordPress.org

Ready to get started?Download WordPress

Forums

Twenty Fourteen
[resolved] Search button not working (11 posts)

  1. ilpanzio
    Member
    Posted 4 months ago #

    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?

  2. WPMU DEV
    Member
    Posted 4 months ago #

    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();
    				}
    			} );
    			} );
    	</script>
    <?php }
    add_action('wp_footer', 'add_custom_script');

    http://wordpress.org/plugins/code-snippets/

    Best Regards,

  3. ilpanzio
    Member
    Posted 4 months ago #

    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

  4. WPMU DEV
    Member
    Posted 4 months ago #

    Hi @ilpanzio,

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

    Regards,

  5. Zulfikar Nore
    Member
    Posted 4 months ago #

    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.

  6. ilpanzio
    Member
    Posted 4 months ago #

    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

    Regards

  7. WPMU DEV
    Member
    Posted 4 months ago #

    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.

    Cheers,

  8. 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.

    @ilpanzio

    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.

  9. lauranoir
    Member
    Posted 4 months ago #

    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!

    Marion

  10. WPMU DEV
    Member
    Posted 4 months ago #

    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.

    Cheers,

  11. Cecivusa
    Member
    Posted 1 month ago #

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

    http://www.central-monterrico.com/

    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

Reply

You must log in to post.

About this Theme

About this Topic

Tags

No tags yet.