• I recently installed wordpress – installed wonderfully – very easy to use but at some point all my entries which were showing up fine in the middle of the page are now squished to the right side of the page.

    https://www.davestravelcorner.com/above-the-clouds

    I think, in the Admin >> Themes >> Editor — is where I would need to fix this, but Im not sure what code to change, what code to update or where to start with this. Any suggestions or fixes are greatly appreciated. Thanks.

    Regards,

    Dave

Viewing 8 replies - 1 through 8 (of 8 total)
  • You are missing a closing div….hard to say where, but my guess is if you edit sidebar.php and add:
    </div>
    to the very end, it *may* work properly for you.

    Just remember exactly what you do when editing the file so you can un-do it if it doesn’t fix the problem.

    Thread Starter frank464

    (@frank464)

    Jrav001 – thanks for the post. Thats good to know about the </div> – the sidebar.php already has that snippet of code as the last piece of code in that file. I also checked the main index template file – </div> is also present at the end of that file. Are there any other template files I should look for this in? I could also place any code from any file here for review.

    Thanks again.

    Regards,

    Dave

    Try adding another </div> to the end of sidebar.php – there is one missing, but without seeing all your files, it’s hard to say where exactly it should be.

    Thread Starter frank464

    (@frank464)

    Thanks – I added a few more and saved and tested each one but the main entries still squished over to the right side. I’ve listed the code for the Sidebar.php below in case there is somewhere else this piece of code should be implemented. Its strange that this would happen as I wasn’t aware of actually editing any of the files.

    Anyhow, here is the code:

    ‘<div id=”sidebar”>
    <?php if ( !function_exists(‘dynamic_sidebar’)
    || !dynamic_sidebar(‘Main Sidebar (Left)’) ) : ?>

    <div class=”boxhead_cont”>
    <div class=”boxhead”><h3><?php _e(‘Author’, ‘travelogue’); ?></h3></div>
    </div>
    <div class=”boxbody_cont”>
    <div class=”boxbody”>

    • Hello! My name is — and I love WordPress!

    </div>
    </div>

    <div class=”boxhead_cont”>
    <div class=”boxhead”><h3><?php _e(‘Pages’, ‘travelogue’); ?></h3></div>
    </div>
    <div class=”boxbody_cont”>
    <div class=”boxbody”>

      <?php wp_list_pages(‘title_li=’); ?>

    </div>
    </div>

    <div class=”boxhead_cont”>
    <div class=”boxhead”><h3><?php _e(‘Archives’, ‘travelogue’); ?></h3></div>
    </div>
    <div class=”boxbody_cont”>
    <div class=”boxbody”>
    <form name=”archiveform” action=”” style=”margin:0;padding:5px;”>
    <select name=”archive_chrono” onchange=”window.location = (document.forms.archiveform.archive_chrono[document.forms.archiveform.archive_chrono.selectedIndex].value);”>
    <option value=”><?php _e(‘By Month’, ‘travelogue’); ?></option>
    <option value='<?php bloginfo(‘url’); ?>/archives/’>- <?php _e(‘Browse Entire Archive -‘, ‘travelogue’); ?></option>
    <?php wp_get_archives(‘format=option’); ?>
    </select>
    </form>
    </div>
    </div>

    <div class=”boxhead_cont”>
    <div class=”boxhead”><h3><?php _e(‘Calendar’, ‘travelogue’); ?></h3></div>
    </div>
    <div class=”boxbody_cont”>
    <div class=”boxbody”><?php get_calendar(2); ?></div>
    </div>

    <div class=”boxhead_cont”>
    <div class=”boxhead”><h3><?php _e(‘Links’, ‘travelogue’); ?></h3></div>
    </div>
    <div class=”boxbody_cont”>
    <div class=”boxbody”>

      <?php wp_list_bookmarks(‘title_li=&categorize=0’); ?>

    </div>
    </div>

    <div class=”boxhead_cont”>
    <div class=”boxhead”><h3><?php _e(‘Meta’, ‘travelogue’); ?></h3></div>
    </div>
    <div class=”boxbody_cont”>
    <div class=”boxbody”>

    </div>
    </div>

    <?php if (function_exists(‘wp_theme_switcher’)) { ?>
    <div class=”boxhead_cont”>
    <div class=”boxhead”><h3><?php _e(‘Themes’, ‘travelogue’); ?></h3></div>
    </div>
    <div class=”boxbody_cont”>
    <div class=”boxbody”><?php wp_theme_switcher(); ?></div>
    </div>
    <?php } ?>

    <?php endif; ?>
    </div>
    </div>
    </div>’

    Oops – You have too many closing divs now. ??

    Have a look at this: https://validator.w3.org/check?uri=http%3A%2F%2Fwww.davestravelcorner.com%2Fabove-the-clouds%2F&charset=%28detect+automatically%29&doctype=Inline&group=0

    I am sure that once you get the divs straightened out your problem will be solved. The structure you have now is something like this:

    content
    – right column
    – – boxbody (your main content)
    – footer

    What you want is this:

    content
    – right column
    – boxbody (your main content)
    – footer

    What you ahve to do is get the boxbody ourside of your right column where it now resides.

    Hmmm…..do you have a file called rightcolumn.php or rightsidebar or something similar?

    Thread Starter frank464

    (@frank464)

    Thanks very much for looking at this – yep the main box body is stuck in the right column for the main posts – (however if you view a month – ie click on May then the page looks fine with all the entries showing up in the main box body) – I do have a rightcolumn.php and I have listed that code directly below.

    ‘<?php
    if ( function_exists(‘dynamic_sidebar’) && is_sidebar_active(2) ) {
    // there is active widgets for sidebar-1
    // do something
    echo ‘<div id=”rightcolumn”>’.PHP_EOL;
    dynamic_sidebar(2);
    echo ‘</div>’.PHP_EOL;
    } else {
    // no widget active for sidebar 2
    // do custom sidebar stuff …

    // Actually in this case, we don’t want to output anything.
    }
    ?>’

    and this code is for the

    Wanna do a little more trial and error stuff?

    In the above, change this line:
    echo '</div>'.PHP_EOL;

    to this:
    echo '</div></div>'.PHP_EOL;

    We’re adding another closing div in case one of your widgets isn’t behaving properly. Did you add a new widget before your site went wacky?

    Thread Starter frank464

    (@frank464)

    Yea Im trying to think back when the center started having problems with all being moved to the right…as when I first installed the software and added a few entries I’m pretty sure it was fine. The only widgets I know of adding were the ones that are built in to the software, rss, search, blogroll, recent comments, tagcloud and archives.

    I also installed the “travelogue” theme but I think the entries were still centered after that installation.

    You are right on! That little change to the code moved the text back center. Thanks very much for helping with this!

    Regards,

    Dave

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Posts all squished to the left’ is closed to new replies.