Tagged: 

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #464561

    Hello Kriesi,

    I have a problem on my frontpage. I use a right sidebar and have content with a button which I would like to link to another part of that page (more down). A simple anchor will not work as the content linked to will scroll under the top menu which is sticky. Also the nice scrolling effect is gone.

    I thought I’d add a section, linking to a section works beautifully but this will push my sidebar to the bottom of the page as content sections are always full-width. It breaks up the whole lay-out

    What is the right way to go? Can I add an anchor with a HTML code block which will scroll beautifully like linking to a section does? Please advise.

    #465045

    Hey Luc!

    Instead of using a codeblock element try creating a color section and give it an ID of “tel”. That will make it scroll nicely and take in to effect the fixed header size.

    Regards,
    Elliott

    • This reply was modified 9 years, 5 months ago by Elliott.
    #465093

    Thanks Elliot,I already tried that but it will create a fullwidth section pushing my sidebar down :-(

    #465913

    Hey!

    Please add following code to Functions.php file in Appearance > Editor

    function add_custom_target(){
    ?>
    <script>
    jQuery(window).load(function(){
    jQuery('.home section.avia_code_block_0').attr('id','bestellijn');​
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_target');

    This should give ID to your code block element and you can link your button to #bestellijn

    Best regards,
    Yigit

    #466194

    Hi There Yigit,

    Thanks for your code, however when added to my child theme functions file nothing happens and when added to the functions file of enfold, site ends up as a white screen. Any idea’s?

    Maybe you can have a look? Thanks in advance.
    See your login details in the private section.

    #466200

    Hey!

    Are you copying the code from the email or from the forums?

    Best regards,
    Basilis

    #466202

    from the code section of this forum, not from the e-mail

    #468903

    Hey!

    Did you remove it? I do not see the link anymore.

    Regards,
    Elliott

    #468910

    Helli, it is still there, on the homepage of Boosty.nl. We had some DNS changes today and the site is now live on http://www.boosty.nl

    #469119

    Hey!

    Yigit’s code appears to be working fine. You forgot to add an element inside your codeblock with the ID.

    Cheers!
    Elliott

    #486713

    Fixed, thanks!

    Ticket can be closed!

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Link to content section is not what I want but I need an anchor’ is closed to new replies.