Black Friday Sale! Get $20 off GP Premium, $40 off our new Lifetime license, and 45% off license renewals/extensions! Learn more

[Resolved] direct links to FAQ's

Home Forums Support direct links to FAQ's

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #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,
    Russ

    Vincent’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>

    GeneratePress 1.4
    GP Premium 1.4.3
    #409461
    Leo
    Staff
    Customer Support

    Hi there,

    You can try copying and pasting that block of code, from <script> to </script> in the wp_footer hook.

    Let me know if this works or not.

    #411424
    Russell

    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?

    #411540
    Leo
    Staff
    Customer Support

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

    #411855
    Russell

    will do

    #412044
    Russell

    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>

    #412129
    Leo
    Staff
    Customer Support
Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.