- This topic has 6 replies, 2 voices, and was last updated 6 years, 1 month ago by
Leo.
-
AuthorPosts
-
October 24, 2017 at 11:07 am #409338
Russell
Hi Tom,
I’m using the lates versions of GP Premium and elementor pro » I want to put direct links to all my present and future FAQs. (https://agnetic.com/faqs/).Elementor’s Vincent sent me this helpful piece of information. If my review of the GP support material is accurate, I need to use GP Hooks to insert the recommended javascript. But I don’t know were to begin…
It was the posting at the following page that convinced me to, uncharacteristically ask for help: http://demo.generatepress.com/hook-locations/
so help: Where do I put the GP hook / javascript, what does that look like?
Thanks,
RussVincent’s note
You will need to alter the title of the tab using the following for example: Accordion #1 <span id=”test”></span> .
The id will need to be placed in the button widget link for example http://example.com/#test. This will allow you to scroll to the location of the FAQ.
You will, however, need to use JavaScript to detect when the hash changes for the window and find the tab content and set it’s style property to display:block;
Example:
<script>
jQuery(function($) {
window.onhashchange = function() {
var hash = location.hash;
$(hash).parent().trigger(“click”);
};
});</script>
October 24, 2017 at 3:16 pm #409461Leo
StaffCustomer SupportHi there,
You can try copying and pasting that block of code, from
<script>
to</script>
in thewp_footer
hook.Let me know if this works or not.
October 27, 2017 at 9:09 am #411424Russell
This works, under the following scenario:
I’m already on the page and put the #test at the end of the webpage as in (localhost:8888/agneticdev/faqs/#test)
But » the progress bar sticks about 15% in and doesn’t progress
Also » when I enter in “localhost:8888/agneticdev/faqs/#test” directly into a blank webpage it doesn’t go to the faq where “test” is…thoughts?
October 27, 2017 at 12:38 pm #411540Leo
StaffCustomer Supportnot sure what you mean? Is the code not working like it supposed to?
If so might be best to check with where the code came from.
October 28, 2017 at 6:14 am #411855Russell
will do
October 28, 2017 at 10:37 am #412044Russell
Vincent @ elementor came through like at champ » is updated code (below) allows me to crate tags to FAQs via elementor’s accordion widget and GP’s wp_footer GPHook. Thanks Leo!
Here is the cod that went into wp_footer gp hook:
<script>
jQuery(function($) {
window.onhashchange = function() {
var hash = location.hash;
$(hash).parent().trigger(“click”);
};$( document ).ready(function() {
window.onhashchange();
});
});</script>
October 28, 2017 at 4:57 pm #412129Leo
StaffCustomer SupportGlad you figured out!
-
AuthorPosts
- You must be logged in to reply to this topic.