I was doing fine with customizing my WordPress blog today. I was just fine tuning some code in my index.php & style.css files (didn't even touch the footer) when all of a sudden I noticed my footer DIV went bye bye. I was messing around with some code in the index.php file but only related to the .comment DIV One of the last things I remember tweeking was some code related to the ".comment" div in the style.css file and the very last thing I remember doing was editing the ".searchbutton" div (i had gotten rid of the "text-indent:-9999px" so the text "search" would show up in the button).
The URL of my blog is:
http://criticall.co.cc/
Here is the index.php code:
<?php get_header(); ?>
<div id=\"content\">
<div id=\"contentpadding\">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div <?php post_class() ?> id=\"post-<?php the_ID(); ?>\"> <h2><a href=\"<?php the_permalink() ?>\" rel=\"bookmark\" title=\"Permanent Link to <?php the_title_attribute(); ?>\"><?php the_title(); ?></a></h2>
<div class=\"date\">
<?php the_time('l, F jS, Y') ?> <!-- by <?php the_author() ?> -->
also looking at your footer code, looks like your trying to call the footer in the footer, take out the <?php wp_footer(); ?> within the footer
Hi ikthius,
Yes the footer and sidebar are located in my theme folder along with all the other .php files you'd expect in a default WP theme. I have taken out the <?php wp_footer(); ?> in the footer.php file but to no avail.
"apostrophe" said:
Looks like you are missing a sidebar too. Are you using any plugins? Are the footer and sidebar still absent if you switch back to the default theme?
Hi apostrophe,
Yes, I was focusing so much on my footer that I forgot to mention that the side bar is not showing either. I actually am using the default Akismet 2.2.3 plug-in but that code does not show up in the side bar. In fact, my side bar is rather bare, code wise.
<?php /* If this is the frontpage */ if ( is_home() || is_page() ) { ?>
<?php } ?>
<?php endif; ?>
</div>
</div>
UPDATE: I should also mention that I made an adjustment to my footer.php code with a friend's help. They found an unclosed ending DIV tag that looked like " </div ". So I corrected that along with ikthius's suggestion of removing the footer call function code " <?php wp_footer(); ?> ".
Are you definitely using index.php as your home page or have you set a wp page? If you click on comments and go to single.php then the footer shows.
I am certain index.php is my homepage because i just changed some code around, uploaded it and then refreshed http://criticall.co.cc/ and the change manifested. Not sure what a WP page is.
You are right. The footer shows on single pages. Thanks for pointing that out.
So you are using posts for your about and contact pages? :?
Oh duh. WP page. Yes now I know what that is. I use WP pages for my "about" and "contact" pages.
[quote]You are right. The footer shows on single pages. Thanks for pointing that out.
So what have you done different in single.php to index.php?[/quote]
That is the tricky part. I have to sift through the code and cross reference. I am on that now. The answer must be there. If not, at least a major clue.
<p class=\"postmetadata alt\"> 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: http://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 post_comments_feed_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(); ?>\" 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(); ?> \" 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','','.'); ?>
Strangeness, for some reason the footer and sidebar are getting sucked up into the content and content padding DIVs on the main index.php page. However on a single.php page with out any comments, I only see the sidebar getting sucked up into the content DIV. And on single.php page with 1 or more comments, the footer and sidebar appear perfectly. This is nuts!!! If anyone else wants to give a shot, be my guest!
Hey I just changed servers. All the code is the same but I made new posts.
I see what you mean about the #sidebar being inside the post div inside the #contentpadding but how did it get there? I checked my index.php and single.php pages and the #footer and #sidebar come after all the other DIVS (content, contentpadding, post) have been sealed with the </div> tags.
Also I do not quite understand the error messages I am getting back from the Validator like this one:
# Info Line 55: start tag was here
><div id="content">
What is wrong with this? and What does "start tag was here" mean? I guess I have to research all this.
Hey thanks apostrophe. I added 2 </div> tags and the index.php page is 100% valid now :)
I also added 1 </div> at the end of single.php and now there is only one error which is :
Error Line 142, Column 103: Attribute "aria-required" is not a valid attribute
…ize="22" tabindex="1" aria-required='true' />
...but that is Wordpress code that I did not touch. Thats' a language I dont get.
Anyways, so the single.php layout looks as it should IF there are no comments. If there are any comments, the only problem is that the sidebar starts towards the bottom of the page. The footer is in place though. Remember, before adding that extra </div> at the end of the single.php document (but before the php calling code for the sidebar and footer) the single.php pages with posts were showing up fine. So now this seems to be a major conundrum. Any more suggestions?
Just ran a single page with comments through the validator http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fcriticall.co.cc%2F%3Fp%3D3 and you still have mismatched tags in there. Check comments.php, I'm pretty sure that's where the problem will be.
As for "aria-required='true'" - don't worry about it http://comox.textdrive.com/pipermail/wp-testers/2008-November/010081.html.
Just ran a single page with comments through the validator http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fcriticall.co.cc%2F%3Fp%3D3 and you still have mismatched tags in there. Check comments.php, I'm pretty sure that's where the problem will be.
As for "aria-required='true'" - don't worry about it http://comox.textdrive.com/pipermail/wp-testers/2008-November/010081.html.
Hey apsotrophe, Thanks for letting me about the "Aria-required=true" situation. So I found out the culprit tag was actually in the footer.php. To be more specific, it was the </div> that followed <div id="push"></div>. When I got rid of that and ran it through the Validator it said my document was ok but here is the catch....The sidebar still starts near the bottom of the page. So no visual change happening here.
On top of that, the footer for my index.php and my NON-commented single.php page stretch 1000px wide when it is supposed to go 100% of the browser width. When I run the index.php and my NON-commented single.php page through the Validator it says that I have 4 errors. 3 of them are related to problems with the </body> and </html> tags. Then there is the one that is related to the <div id="pagewrap">. Here are the URLS:
I am at the point where I am seriously thinking about starting over with the coding because I feel I have reached an sever impass where by solving one problem I create another. It's highly frustrating. Once again though, any help would be appreciated.
this has appeared to solve the problem in Firefox and Chrome. the only issue is that on a NON-commented single.php page I am getting the sidebar showing up at the bottom of the page and footer appearing within the sidebar DIV with a 300px width. when i take out the 'width:100%;' footer code, I solve the problem there and then the whole site is looking perfect.
the problem is when i look at the site in IE 7.0.6 the NON-commented single.php page does not display properly. When I have the 'width:100%' footer code included it displays the sidebar right above the footer. the footer is displayed with a 1000px width only. additionally when I take out the 'width:100%' footer code the page displays with the sidebar at the bottom and the footer in the sidebar DIV with a 300px width (just like it was displaying in Firefox and Chrome).
so this is nuts. one problem gets solved only to create a new problem, then again I never checked out how IE was displaying my page as I am not the biggest fan of it but still many people use it. anyways I hope there is a fix for this.
oh wait a second, the NON-commented single.php page is displaying wrongly with and without that width:100% footer code. i could have sworn I saw it appear correctly before. i even cleared my cache. i will check it later.
Go through your files and comment every closing div so that you can see which closing tag goes with which div. Then you will find your problem.
Ok I did what you suggested and discovered that it was the <div class="comments"> div that was screwing my NON-commented single.php page up so I took out that DIV from the comments.php file and all pages display correctly now. The problem is that now I am not able to style this piece of code from the comments.php file:
Another thing that is funny is that when a post has no comments, the code above does not display "no comments" as it should. On posts with comments it displays '1 comment' or '2 comments' as it should. so this bit is a bit annoying.
Also when I placed <div class="comments"> </div> around the above PHP code that it created a DIV around the <div id="respond"></div> (which contains the comment form) on NON-commented single.php pages. But on COMMENTED single.php pages the <div class="comments"> </div> surrounds only the "1 comment" and "2 comment" H3 text. So I am thinking that some code deeper in the PHP is screwing up the way my page is displaying. Specifically it would be a piece of PHP code that is not displaying the text "no comments" as well as wrapping the 'comments' DIV around the 'respond' DIV.
i have decided to leave the <div class="comments"> </div> around the above PHP code in order to better demonstrate to you what is going on. Also I have colored every DIV on my page so you can see better what is going on too. The comments DIV you will see to be orange with a green outline. Also, on the single.php page http://criticall.co.cc/?p=4 the pagewrap DIV is not reaching the footer DIV and jsut stops half way down the page.
// Do not delete these lines if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) die ('Please do not load this page directly. Thanks!');
if ( post_password_required() ) { ?> <p class=\"nocomments\">enter the password to view comments</p> <?php return; } ?>
<div class=\"navigation\"> <div><?php previous_comments_link() ?></div> <div><?php next_comments_link() ?></div> </div> <?php else : // this is displayed if there are no comments so far ?>
<?php if ('open' == $post->comment_status) : ?> <!-- If comments are open, but there are no comments. -->
<?php else : // comments are closed ?> <!-- If comments are closed. --> <p class=\"nocomments\">Comments are closed.</p>
<?php endif; ?> <?php endif; ?>
<?php if ('open' == $post->comment_status) : ?>
<div id=\"respond\">
<h3><?php comment_form_title( 'post a comment', 'post a comment to %s' ); ?></h3>
<?php if ( get_option('comment_registration') && !$user_ID ) : ?> <p>You must be <a href=\"<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>\">logged in</a> to post a comment.</p> <?php else : ?>
<p>Logged in as <a href=\"<?php echo get_option('siteurl'); ?>/wp-admin/profile.php\"><?php echo $user_identity; ?></a>. <a href=\"<?php echo wp_logout_url(get_permalink()); ?>\" title=\"Log out of this account\">Log out »</a></p>
<?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) { // Both Comments and Pings are open ?><a href=\"<?php trackback_url(); ?>\" rel=\"trackback\">trackback</a>
<?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(); ?> \" 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','','.'); ?>
interesting, the display problem has been solved. the "pagewrap" DIV shoots all the way to the footer now and the "respond" DIV is not encased in the "comments" DIV. thanks a bunch apostrophe : ) !
do you have any clue as to why on the NON-commented single.php page it is not displaying "no comments"?
Tbh, no I don't have a clue. Are you using any kind of comments plugin?
No I am not using a comments plug in. It bothers me that it will not say 'no comments' only because it is not behaving as the program is intended to. i really do not care if it does not say it. but still. it should be performing. i think it is a deep PHP issue. what else could it be?
do you knwo any site or set of tutorials that goes through the word press PHP code line by line explaining what all of it does?
Well there's a simple test. Just switch to the default theme, if it's working there then you know the problem is somewhere in your code.
Hey again, well it seems with the WordPress Default 1.6 Theme, it does not display "no comments" but on the "WordPress Classic 1.5" it does actually display "No comments" so the code must be somewhere deeper in the PHP.
I was doing fine with customizing my WordPress blog today. I was just fine tuning some code in my index.php & style.css files (didn't even touch the footer) when all of a sudden I noticed my footer DIV went bye bye. I was messing around with some code in the index.php file but only related to the .comment DIV One of the last things I remember tweeking was some code related to the ".comment" div in the style.css file and the very last thing I remember doing was editing the ".searchbutton" div (i had gotten rid of the "text-indent:-9999px" so the text "search" would show up in the button).
The URL of my blog is:
http://criticall.co.cc/
Here is the index.php code:
Here is my style.css code:
I will also post the header and footer files for good measure.
header.php
footer.php
If you need anymore information or have any questions then let me know and I will provide. Thank you so much!
also looking at your footer code, looks like your trying to call the footer in the footer, take out the <?php wp_footer(); ?> within the footer
Hi ikthius,
Yes the footer and sidebar are located in my theme folder along with all the other .php files you'd expect in a default WP theme.
I have taken out the <?php wp_footer(); ?> in the footer.php file but to no avail.
Hi apostrophe,
Yes, I was focusing so much on my footer that I forgot to mention that the side bar is not showing either. I actually am using the default Akismet 2.2.3 plug-in but that code does not show up in the side bar. In fact, my side bar is rather bare, code wise.
Here is the side bar code:
UPDATE:
I should also mention that I made an adjustment to my footer.php code with a friend's help. They found an unclosed ending DIV tag that looked like " </div ". So I corrected that along with ikthius's suggestion of removing the footer call function code " <?php wp_footer(); ?> ".
Here is the updated footer.php code:
Thanks for the help so far.
I am certain index.php is my homepage because i just changed some code around, uploaded it and then refreshed http://criticall.co.cc/ and the change manifested. Not sure what a WP page is.
You are right. The footer shows on single pages. Thanks for pointing that out.
So you are using posts for your about and contact pages? :?
So what have you done different in single.php to index.php?
Oh duh. WP page. Yes now I know what that is. I use WP pages for my "about" and "contact" pages.
So what have you done different in single.php to index.php?[/quote]
That is the tricky part. I have to sift through the code and cross reference. I am on that now. The answer must be there. If not, at least a major clue.
Here is the "single.php" page code:
http://criticall.co.cc/
As always, validate.
index.php http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fcriticall.co.cc%2F
single.php http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fcriticall.co.cc%2Fthis-post-will-have-no-comments-for-the-first-few-minutes-of-its-life%2F
Hey I just changed servers. All the code is the same but I made new posts.
I see what you mean about the #sidebar being inside the post div inside the #contentpadding but how did it get there? I checked my index.php and single.php pages and the #footer and #sidebar come after all the other DIVS (content, contentpadding, post) have been sealed with the </div> tags.
Also I do not quite understand the error messages I am getting back from the Validator like this one:
# Info Line 55: start tag was here
><div id="content">
What is wrong with this? and What does "start tag was here" mean? I guess I have to research all this.
I also added 1 </div> at the end of single.php and now there is only one error which is :
...but that is Wordpress code that I did not touch. Thats' a language I dont get.
Anyways, so the single.php layout looks as it should IF there are no comments. If there are any comments, the only problem is that the sidebar starts towards the bottom of the page. The footer is in place though. Remember, before adding that extra </div> at the end of the single.php document (but before the php calling code for the sidebar and footer) the single.php pages with posts were showing up fine. So now this seems to be a major conundrum. Any more suggestions?
As for "aria-required='true'" - don't worry about it http://comox.textdrive.com/pipermail/wp-testers/2008-November/010081.html.
Hey apsotrophe, Thanks for letting me about the "Aria-required=true" situation. So I found out the culprit tag was actually in the footer.php. To be more specific, it was the </div> that followed <div id="push"></div>. When I got rid of that and ran it through the Validator it said my document was ok but here is the catch....The sidebar still starts near the bottom of the page. So no visual change happening here.
On top of that, the footer for my index.php and my NON-commented single.php page stretch 1000px wide when it is supposed to go 100% of the browser width. When I run the index.php and my NON-commented single.php page through the Validator it says that I have 4 errors. 3 of them are related to problems with the </body> and </html> tags. Then there is the one that is related to the <div id="pagewrap">. Here are the URLS:
index.php http://validator.w3.org/check?uri=http%3A%2F%2Fcriticall.co.cc%2F&charset=(detect+automatically)&doctype=Inline&group=0
NON-commented single.php http://validator.w3.org/check?uri=http%3A%2F%2Fcriticall.co.cc%2F%3Fp%3D4&charset=(detect+automatically)&doctype=Inline&group=0&verbose=1&user-agent=W3C_Validator%2F1.654
I am at the point where I am seriously thinking about starting over with the coding because I feel I have reached an sever impass where by solving one problem I create another. It's highly frustrating. Once again though, any help would be appreciated.
That closes the page wrapper, and then just add this to the stylesheet:
#footer {width: 100%;
}
this has appeared to solve the problem in Firefox and Chrome. the only issue is that on a NON-commented single.php page I am getting the sidebar showing up at the bottom of the page and footer appearing within the sidebar DIV with a 300px width. when i take out the 'width:100%;' footer code, I solve the problem there and then the whole site is looking perfect.
the problem is when i look at the site in IE 7.0.6 the NON-commented single.php page does not display properly. When I have the 'width:100%' footer code included it displays the sidebar right above the footer. the footer is displayed with a 1000px width only. additionally when I take out the 'width:100%' footer code the page displays with the sidebar at the bottom and the footer in the sidebar DIV with a 300px width (just like it was displaying in Firefox and Chrome).
so this is nuts. one problem gets solved only to create a new problem, then again I never checked out how IE was displaying my page as I am not the biggest fan of it but still many people use it. anyways I hope there is a fix for this.
take care,
adam
Ok I did what you suggested and discovered that it was the <div class="comments"> div that was screwing my NON-commented single.php page up so I took out that DIV from the comments.php file and all pages display correctly now. The problem is that now I am not able to style this piece of code from the comments.php file:
Another thing that is funny is that when a post has no comments, the code above does not display "no comments" as it should. On posts with comments it displays '1 comment' or '2 comments' as it should. so this bit is a bit annoying.
Also when I placed <div class="comments"> </div> around the above PHP code that it created a DIV around the <div id="respond"></div> (which contains the comment form) on NON-commented single.php pages. But on COMMENTED single.php pages the <div class="comments"> </div> surrounds only the "1 comment" and "2 comment" H3 text. So I am thinking that some code deeper in the PHP is screwing up the way my page is displaying. Specifically it would be a piece of PHP code that is not displaying the text "no comments" as well as wrapping the 'comments' DIV around the 'respond' DIV.
i have decided to leave the <div class="comments"> </div> around the above PHP code in order to better demonstrate to you what is going on. Also I have colored every DIV on my page so you can see better what is going on too. The comments DIV you will see to be orange with a green outline. Also, on the single.php page http://criticall.co.cc/?p=4 the pagewrap DIV is not reaching the footer DIV and jsut stops half way down the page.
take care,
adam
PS here is the comments.php code:
and single.php:
Should be :
do you have any clue as to why on the NON-commented single.php page it is not displaying "no comments"?
thanks again and take care,
adam
Tbh, no I don't have a clue. Are you using any kind of comments plugin?
No I am not using a comments plug in. It bothers me that it will not say 'no comments' only because it is not behaving as the program is intended to. i really do not care if it does not say it. but still. it should be performing. i think it is a deep PHP issue. what else could it be?
do you knwo any site or set of tutorials that goes through the word press PHP code line by line explaining what all of it does?
Hey again, well it seems with the WordPress Default 1.6 Theme, it does not display "no comments" but on the "WordPress Classic 1.5" it does actually display "No comments" so the code must be somewhere deeper in the PHP.
Thanks for your help again :)
Take care,
Adam
NB I only just noticed that you have <div class="navigation"> twice, once before the comments list and once after, is that right?