• Resolved Dragos Cristache

    (@dragoscristache)


    Hello!

    I’m currently working on a WordPress theme based on the underscores.me starter theme. After a few days of coding I noticed that the page automatically jumps to the footer on load. If I remove the part that loads the footer widgets

    <div class="footer-sidebar1">
    	<?php
    	if(is_active_sidebar('footer-sidebar-1')){
    	dynamic_sidebar('footer-sidebar-1');
    	}
    	?>
    </div>
    <div class="footer-sidebar2">
    	<?php
    	if(is_active_sidebar('footer-sidebar-2')){
    	dynamic_sidebar('footer-sidebar-2');
    	}
    	?>
    </div>
    <div class="footer-sidebar3">
    	<?php
    	if(is_active_sidebar('footer-sidebar-3')){
    	dynamic_sidebar('footer-sidebar-3');
    	}
    	?>
    </div>
    <div class="footer-sidebar4">
    	<?php
    	if(is_active_sidebar('footer-sidebar-4')){
    	dynamic_sidebar('footer-sidebar-4');
    	}
    	?>
    </div>

    it doesn’t jump anymore. Does anyone have any idea why it does this?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Hi dragos.cristache!

    Let’s see if when can find the culprit?

    Are you using any JavaScript in your theme other than what comes with underscores? Have you tried deactivating all your plugins to see if that could be an issue? Are you able to post a link to the site with the theme active?

    It is a little hard to troubleshoot with just that much information. If possible, are you able to write out the steps you’ve taken so far that lead up to this issue? I know at times I have to retrace my steps to see what I’ve missed or forgot to include. ??

    Thread Starter Dragos Cristache

    (@dragoscristache)

    Hello Jose!

    I disabled all JS using a Chrome extension but no luck, it works the same. Here’s a link to a live version: https://ivc.cristache.net/ – hopefully you can tell what’s going on.

    Thread Starter Dragos Cristache

    (@dragoscristache)

    I have a theory: I think the page jumps to the first ID element on the page. About solving that, I have no idea how.

    Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Try deactivating all your plugins.

    Thread Starter Dragos Cristache

    (@dragoscristache)

    The custom theme I’m developing is heavily using Advanced Custom Fields and if I deactivate it the theme is useless, it outputs no content if I disable ACF.

    Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Disable all others then. If still jumps it may very well be the ACF plugin.

    Thread Starter Dragos Cristache

    (@dragoscristache)

    It was because of the newsletter input field in the footer. I’ve replaced the hard coded input with a Contact Form 7 field and it doens’t jump anymore.

    *insert my code works i have no idea why meme*

    Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Weird!

    I’m glad you were able to get it figured out! ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Page jumps to footer on load’ is closed to new replies.