Side bar moves down when comments turned off

When comments are not allowed for a page, the left side bar moves down below the page content. Can you please help me solve this problem? Thank you.

  • hkim135
    • Flash Drive

    I’m sorry, I’m not online yet so I can’t show you. However, I’m using the bp-scholar theme. Simply, when the default template is used for a page, and comments are turned off, the page side bar slides down to below the page content. When comments are allowed, the page side bar stays where it’s supposed to (I guess it’s because the “reply” box is now under the page content). I have no idea how to start fixing this.

  • edit-ability
    • WPMU DEV Initiate

    @hkim135 – Are you able to cut and paste the code of the page and the CSS markup? It’s hard to troubleshoot without seeing what’s going on…

    When I’ve had this type of problem before, it was because the width of containers (or <div>’s on my webpage. For instance, the container for your widget might be wider than the sidebar’s parent container. In this scenario, when the widget is enabled, it stretches the parent container’s width.

    The pages main container might not be wide enough to accomodate the first container (with the content) + the newly widened sidebar container. As a result, it forces the sidebar container underneath the first container rather than side by side.

    Just a thought…but without seeing the code, it’s hard to say!

  • hkim135
    • Flash Drive

    I’m sorry to say I have to re-open this topic. Adding in the missing </div> did put the sidebar in the correct place when comments were disabled. However, when the comments were enabled again, now the side bar is way off to the left side. This happens with all of my pages (regular WordPress pages), using the default template option.

    I’ve downloaded bp-scholar a few times, and it’s the same: There is an unclosed div in the page.php file. I’m just not sure if I placed the </div> in the correct place. Would it be possible for you to look into this for me?

    Thank you.

  • hkim135
    • Flash Drive

    OK, I’m online now. The site is cosmoscommons.com

    From the navigation menu:

    “Another page” – example of page with comments *disabled* (looks good)

    “Sample page”- example of page with comments enabled (side bar to the far left)

    If I remove the </div> from my page.php file, then Another page has the side bar sliding down, while Sample page looks good.

    Thank you.

  • hkim135
    • Flash Drive

    I just downloaded the latest versions of Firefox and Chrome and rechecked the pages– still the same problem. I’m using a Mac. Could that be the issue? Are WPMU themes typically developed on Windows platform?

    Is it possible for you to point me in the right direction(s) for which parameters I could play with, in which file, just to see what happens? Are there too many possibilites? I don’t know a lick of code, but I can at least play around with it. [Also now I know it looks fine on some other computers.]

    Thank you. I know it’s hard to help when everything looks OK on your end.

  • Brian Purkiss
    • Smushie Pies

    I’m on a Mac as well. Our developers are on a mix of Windows, Mac, and Linux, however we test on all OSes.

    Let me dig into this issue and see what I can find. It really does sound like there is an improperly closed div somewhere, and if that’s the case, it’s a bug in our theme and we need to find and fix it.

  • Brian Purkiss
    • Smushie Pies

    I dug into this further, but was still unable to recreate the issue.

    Are you still encountering the problem? I tried going to your two sample pages and they were not found. If you could either publish those two pages again or link to pages that are having the issue, I’ll look into it again.

  • hkim135
    • Flash Drive

    I just uploaded the *original* page.php file (unmodified) to show you what it looks like on my site cosmoscommons.com. “Store” page has comments enabled and looks fine. “About” and “Start Here” pages have comments disabled, and the side bar has slid down.

    Do they all look fine on your end? Also, when you looked at the page.php file, was there really an unclosed div?

    Thanks!

  • Brian Purkiss
    • Smushie Pies

    Thanks. Let me poke around and see what I can find.

    Due to the different facets of this theme, finding the offending div isn’t as simple as looking at the page.php file. I need to look around at the theme in action to reverse engineer where the problem originates. Then I can go back and locate where in the theme the div should be added.

  • Brian Purkiss
    • Smushie Pies

    Ok. I was able to find the problem. And it just so happened to be in the page.php file.

    If you close a div on line 35 of page.php right before the #content closing div, that will fix the problem. Turns out the #blog-page div was not closed.

    I shall flag this for the developer to fix.

    Thank you very much for bearing with me and providing me the necessary info so we can properly fix the bug in this theme.

    If you have any other questions please don’t hesitate to ask. We’re happy to help!

  • hkim135
    • Flash Drive

    I think that’s what I did before. The </div> goes right after <?php do_action( ‘bp_after_blog_page’ ) ?>, correct?

    I just modified my page.php file with that correction. On my end, “Store” now has its side bar moved way over to the left (although “About” and “Start Here” are fixed). Do you see that on your end?

  • hkim135
    • Flash Drive

    I don’t know if this extra info is helpful, but here goes:

    The theme has several template options that can be accessed through admin panels. “About” and “Start” use the default templates. The “right side bar” template and the “3 column” template options seem to have the same problem that the default template does. However, the “blog and news” template shows up correctly whether the comments are enabled or disabled.

  • hkim135
    • Flash Drive

    Hi, Brian,

    I found another person having similar difficulties with the bp-scholar layout, so posted there. It might provide more clues, along with the problems spachase is having. I’m just baffled as to why the problem doesn’t seem to be showing up on test computers. I’ve reloaded the theme many times, wiped WordPress, and checked on two different computers, to no avail. ??!!!

    Hui Sun

  • 11 Plus for Parents
    • The Incredible Code Injector

    If I am reading correctly then every open <div> should have a closing </div> Yes?

    In template-3colum.php there are 9 open divs and only 7 closed divs. If someone can tell me where to close them that may hold the key to many of my Scholar problems.

    Thanks

    p.s. hkim135, sorry for muscling in on your action but you would notice that I am not getting any of my own over here

  • Brian Purkiss
    • Smushie Pies

    You are correct, each div should open and close.

    However, php files are used to pull together a smattering of different php files to generate the final output. So it isn’t important how many open/closed divs there are in one php file as sometimes themes will open a div in one php file and close it in another. What’s more important is how the final html renders out. So check out the source of the resulting page to determine if all divs are or aren’t closed properly.

    Did that make any sense?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.