-
AuthorPosts
-
October 28, 2015 at 5:52 pm #643909
Hey folks!
Is there a way I can force the header widget to show as open when a user lands on the website home page? Then…if they click the “plus” icon at that point, it will then close or open (to remain a toggle function).I only found something in the forum where it is permanently forced open…but we want the user to be able to close it.
OR…even better…possible for it to be open upon entry…then after a certain number of seconds…it eases closed? That’d be awesome.
Thanks, in advance, for any help or advice you can give us!
October 28, 2015 at 9:55 pm #644143Hi there,
Thanks for writing in! Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
Once you have your child theme setup, please find the _header.php file in the following location:
/wp-content/themes/x/framework/views/global/_header.php
Copy this file and paste it into the same directory within the child theme
/wp-content/themes/x-child/framework/views/global/_header.php
Next open this file in your code/text editor and add the following line of code:
<?php x_get_view( 'global', '_header-widget-areas' ); ?>
Add it directly above
<div id="top" class="site">
Save the file and close it.
You then need to add this under Custom > Javascript in the Customizer.
jQuery ( function($) { $(document).ready ( function() { $('.x-btn-widgetbar').trigger('click'); } ); } );
Hope this helps β thanks!
November 5, 2015 at 8:36 pm #654591Excellent work! BUT, what I realize, now, is that this is permanently covering the main menu or sticky menu.
Is there more script we can add to have this section auto-close after “x” number of milliseconds or whatever?
Otherwise, the code that you gave me works perfectly, so thank you.
And YES, we are already using a child theme πNovember 5, 2015 at 8:38 pm #654594OH additionally, I just realized it “pops open” whenever you visit any page. We only want it to pop open upon initial entry to the home page along with auto-closing (ease close) after “X” number of milliseconds.
Possible?
November 5, 2015 at 11:05 pm #654741Hi there,
You may try this one π
jQuery ( function($) { $(document).ready ( function() { $('.home .x-btn-widgetbar').trigger('click'); setTimeout( function() { $('.home .x-btn-widgetbar').trigger('click'); }, 3000 ); } ); } );
And 3000 is equivalent to 3 seconds π
Cheers!
November 12, 2015 at 2:26 pm #662998That was EXCELLENT. Worked like a charm. Thank you VERY much. π Excellent theme…excellent support π 5 stars!
November 12, 2015 at 4:20 pm #663124Weβre delighted to assist you with this.
-
AuthorPosts