0
votes

I bought a non-wordpress theme that I'm currently adapting to wordpress. The only problem I have is the location of the sidebar. It loads in the same area as the main content for some reason.

End of header file:

    <!--Content Sec -->
        <div id="content_sec1">
            <!--Main Section-->
            <div class="col1">

And the start of the footer file:

 </div> <!--col1 end -->
<div class="col2">
                <?php
                    /* 
                     *  Load the sidebar
                     */
                    get_sidebar();
                ?>
</div>

As said the sidebar loads in the end of the col1 div instead of in the col2 div as it should. The col2 div remains empty.

Any ideas why this happens?

1
Can you show us the code between these two snippets? - Nikolay Yordanov
theres no code between these snippets, besides the code generated by wordpress. - Jacob
I suppose so, but the idea behind my request is that some div may get messed up somewhere between header and footer - have you checked that? get_sidebar() doesn't do anything that can lead to this behaviour. As far as I'm aware, it just prints the sidebar, nothing that may rearrange the code. - Nikolay Yordanov
I doubt it, seems like the get_sidebar() doesn't actually do anything. If i remove it the same thing happen. If I on the other hand put something else, like text etc, in the same place as the get_sidebar(), it's placed as it should - Jacob

1 Answers

1
votes

Based on what we've discussed, I assume that there is a call to get_sidebar() somewhere between header and footer - take a look at single.php, page.php, etc. Or just run a grep in the theme directory and see where it is: grep -rn 'get_sidebar' .