- This topic has 9 replies, 2 voices, and was last updated 1 year, 7 months ago by
David.
-
AuthorPosts
-
July 29, 2019 at 1:55 pm #970458
david
Hi, I’d like to include the following jquery into my sites home page:
$(“.test”).chosen({
search_contains: false,
enable_split_word_search: false
});Please can you explain exactly where and what I need to insert for this to work
Thanks
DavidJuly 29, 2019 at 2:35 pm #970484David
StaffCustomer SupportHi there,
simplest way is to add the script to a Hook Element:
https://docs.generatepress.com/article/hooks-element-overview/
Add the script like so:
<script> jQuery(".test").chosen({ search_contains: false, enable_split_word_search: false }); </script>
Select the WP_footer hook from the list and set your display rules to the Front Page.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/July 29, 2019 at 10:13 pm #970706david
Hi David,
Thanks for this, how do I “set your display rules to the Front Page.”Thanks
DavidJuly 30, 2019 at 5:22 am #970932David
StaffCustomer SupportWhen editing the Hook element – go to the Display Rules tab – Select Location: Front Page.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/July 30, 2019 at 7:12 am #970998david
Hi David,
Don’t see a “Display rules tab”Only options I see are Execute PHP, Disable Hook and Save Hooks
Thanks
July 30, 2019 at 8:36 am #971206David
StaffCustomer SupportAah ok – looks like you’re still using the old Hooks module. You can enable Appearance > GeneratePress > Elements module then you should see Appearance > Elemements and they will have a Display Rules tab.
Any old Hooks or Page Headers will appear in the Elements module under legacy.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/July 30, 2019 at 9:54 am #971315david
I now have Appearance > Elements, but all I see at the top of the page is:
Add New, Legacy Page Headers, Legacy Hooks
Clicking Legacy Hooks brings up my wp-footer hook
July 30, 2019 at 9:57 am #971318David
StaffCustomer SupportClick Add New > Hook.
This document shows the Hook Element settings:https://docs.generatepress.com/article/hooks-element-overview/
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/July 30, 2019 at 12:06 pm #971429david
ok, so now where do I put
<script> jQuery(".test").chosen({ search_contains: false, enable_split_word_search: false }); </script> Do I place it in the empty box (with no title) above the settings bar
July 30, 2019 at 12:13 pm #971435David
StaffCustomer SupportBelow the ‘Add New Element’ is the Title field, followed by the content field, where you add that code, which is above the settings bar
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.