Website Theme Problem
-
Hi, Our WordPress theme is doing some strange things when the user is not logged in and goes to comment on a post.
Here is a sample: https://hoosieraccess.com/blog/2008/04/14/we-blog-you-decide/
The main page is fine, but whenever a post is clicked on- the columns go underneath the comment area.
Any suggestions would be greatly appreciated.
Thanks!
-
Start cleaning up those 58 XHTML errors.
https://validator.w3.org/Greenshady’s suggestion should help a lot. I’m not sure that I’m seeing what you are seeing, and I don’t undertsnd what you mean by “the columns go underneath the comment area”. Where do you want your posts, and where do you want your comments?
Wow, I had no idea I had all of those errors.
I’ll look into seeing what I can do to resolve those, but I am not that strong of a coder, and if you have any quick ways to fix them. Please let me know!
When I view the link, in IE7 It has the Header, the menu bar, the post, the comment area, then the 2 columns on the right are underneath the comment area.
I would like the columns to be on the right side of the page, not at the bottom.
Hopefully that clarifies things.
Thanks!
Sounds like a CSS problem…….something about a width is different when you click on the the post (not tightly controlled by your CSS I mean) so it’s forcing your columns below instead of floating them where they should be.
Look at your theme’s php file for that page (single.php maybe?) to see what the DIV is that holds that particular section, then check your CSS to see how wide that section is, then see if you have enough total width to hold it with your columns next to it.
Keep in mind that different browsers interpret widths differently – IE adds up the numbers between width, padding, margins, and borders differently that the others do, so I generally allow a few pixels of ‘slop’ between DIVs to keep IE from doing just what you describe…..
I think you have a bug in your theme in index.php. Right after the comment “You can start editing here” you have an additional
<div class="content">
which is not closed by a
</div>
anyplace that I can see. Because .content is float left, and encloses your sidebar, it appears next in the document flow under entry.I think you might be able to just eliminate the extra opening DIV I have indicated above, or close the DIV as I have indicated if those two columns need to inherit the formatting of your content class.
Since this happens when a single post is clicked on, the problem MIGHT be in a file called “single.php” if your theme has one – if you don’t then it uses index.php, but since the problem doesn’t happen on your home page I suspect the missing closing DIV (</div>) is absent from single.php
Here is my single.php. I can’t seem to figure it out:
<?php get_header(); ?> <div id="post"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="content"> <div class="date"><?php the_time('F jS, Y') ?> by <?php the_author() ?></div> <div class="entry"> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php echo get_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h2> <?php the_content('<p class="serif">Read the rest of this entry »</p>'); ?> <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> <div class="postmeta">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> </div> </div></div> <p class="postmetadata"> <small> This entry was posted <?php /* This is commented, because it requires a little adjusting sometimes. You'll need to download this plugin, and follow the instructions: https://binarybonsai.com/archives/2004/08/17/time-since-plugin/ */ /* $entry_datetime = abs(strtotime($post->post_date) - (60*120)); echo time_since($entry_datetime); echo ' ago'; */ ?> on <?php the_time('l, F jS, Y') ?> at <?php the_time() ?> and is filed under <?php the_category(', ') ?>. You can follow any responses to this entry through the <?php comments_rss_link('RSS 2.0'); ?> feed. <?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) { // Both Comments and Pings are open ?> You can <a href="#respond">leave a response</a>, or <a href="<?php trackback_url(true); ?>" rel="trackback">trackback</a> from your own site. <?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) { // Only Pings are Open ?> Responses are currently closed, but you can <a href="<?php trackback_url(true); ?> " rel="trackback">trackback</a> from your own site. <?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) { // Comments are open, Pings are not ?> You can skip to the end and leave a response. Pinging is currently not allowed. <?php } elseif (!('open' == $post-> comment_status) && !('open' == $post->ping_status)) { // Neither Comments, nor Pings are open ?> Both comments and pings are currently closed. <?php } edit_post_link('Edit this entry.','',''); ?> </small> </p> </div> <?php comments_template(); ?> <?php endwhile; else: ?> <p>Sorry, no posts matched your criteria.</p> <?php endif; ?> </div> <?php get_sidebar(); ?> <?php get_footer(); ?>
Look in comments_template, and see if you have these two lines:
<div class="content"> <div class="entry">
right under this comment:
<!-- You can start editing here. -->
Otherwise I’m not sure what is going on here.
Yes, I do…
Any other suggestions?
Please understand that I can only look at the code your blog generated and make some assumptions. I don’t think those two lines belong in that script if they are not closed by closing DIV’s. Someone put them there who presumably had a reason I may not understand. That said, I would run a quick test to delete those two lines annd see what happens. You can replace them if I’m wrong.
Fixed, Thank you SO much!!
Whoops, Not quite fixed…
It looks fine in IE, but now it looks like the sidebars have moved to align to the right, and the background content area (which is supposed to be ‘white’ has disappeared in Firefox.
Any more ideas?
I have played around enabling/disabling some of the various div’s I removed, but no success.
I looked at your source code – you have a few unclosed DIV tags……that will throw off your layout and styles.
Also, equally as important, you have several instances of class names and ID names being the same – this is invalid CSS and can cause problems.
First print out the source code for your index page as displayed in HTML, then go through it carefully and mark where your DIVs open and where they close so you can identify which ones are left unclosed, and be sure you close them where you want them closed, don’t just stick in some </div> tags at the end.
Second, look more closely at how you are calling your styles (for example right at the top of your code you have <div id=”navtop”> and a few lines down you have <ul class=”navtop”> )…..You should rename one or the other and modify your stylesheet to create the correct style for the new class/id name you’re creating.
I imagine that finding and closing the open DIVs in the right place and cleaning up your CSS will go a long way to fixing your problem….
Yes, run it through the validator again, and start working on those errors. That should get you a lot closer.
thanks mechx1!, but i ran into one problem, now i just have 98 errors, my fist one apears everytime i put a link in any post that opens in a new window, i know if i leave it to open in the same window it will fix it but i don′t want to loos visitors this way, how could i solve it??
- The topic ‘Website Theme Problem’ is closed to new replies.