Topic: Footer Mystery (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=31069" title="Pages that link to Topic: Footer Mystery (Page 1 of 1)" rel="nofollow" >Topic: Footer Mystery <span class="small">(Page 1 of 1)</span>\

 
SleepingWolf
Paranoid (IV) Inmate

From:
Insane since: Jul 2006

posted posted 06-19-2009 21:45

I created customized category pages in Wordpress using a 3 step process.

1. Start with single.php (theme file) and add some text describing the category and save as a category.php file (e.g. category-19.php)

2. Associate the category page (e.g. category-19.php) with its own css file (e.g. category-19.css)

3. Modify the file header.php (optional) with if clauses to change header for the category if desired.

Worked fine but I've noticed a problem. For some categories the footer displays below the content container.

To rule out possible causes, I actually took the php and css from one category and renamed them for the other category and the footer was still broken.

Those are the only 2 variables i could identify.

Any ideas?

Proper footer: http://www.sleepingwolves.com/blog/?cat=24

Broken footer: http://www.sleepingwolves.com/blog/?cat=19

Nature & Travel Photography
Main Entrance

(Edited by SleepingWolf on 06-19-2009 22:00)

reisio
Paranoid (IV) Inmate

From: Florida
Insane since: Mar 2005

posted posted 06-20-2009 00:59

Your problem is the 28th of 52 errors detected by the W3C markup validator.

In the first, the 'Out of Storage' class="post" is missing its </div>, which moves every </div> up in order, and places #footer inside #content.

In the second, this (specific) syntax error situation is not present, leaving #footer merely inside #wrap, but not #content.

The (most obvious) solution to get the #footer how you want it when this syntax error is not present is to move the #content's </div> immediately preceding the #footer <div> to immediately following the #footer </div>, placing #footer within #content.

You could also cheat and add this:
#wrap { background: #303030; } #footer { overflow: auto; }

(Edited by reisio on 06-20-2009 01:01)

SleepingWolf
Paranoid (IV) Inmate

From:
Insane since: Jul 2006

posted posted 06-20-2009 01:03

Thanks...will check it out later...still don't understand why category x works when cateory y doesn't though.

Nature & Travel Photography
Main Entrance

reisio
Paranoid (IV) Inmate

From: Florida
Insane since: Mar 2005

posted posted 06-20-2009 01:17

I'm assuming all the categories that "work" are missing a closing tag somewhere before the footer.

SleepingWolf
Paranoid (IV) Inmate

From:
Insane since: Jul 2006

posted posted 06-20-2009 01:29

The categories are all based on exactly the same file, single.php.
When I took two "working" files (category + css) and renamed them - they still caused a footer error - so that rules out any differences in code.
Wordpress obviously generates these files..but still doesn't explain whey there would be a difference.
All other files, header, footer, etc. are shared.

Nature & Travel Photography
Main Entrance

reisio
Paranoid (IV) Inmate

From: Florida
Insane since: Mar 2005

posted posted 06-20-2009 08:46

Can't comment on (unseen) PHP.

SleepingWolf
Paranoid (IV) Inmate

From:
Insane since: Jul 2006

posted posted 06-20-2009 18:49

reisio: thanks for your help.
I'm going to save the files to my hdd and strip out all the php.

Nature & Travel Photography
Main Entrance

SleepingWolf
Paranoid (IV) Inmate

From:
Insane since: Jul 2006

posted posted 06-20-2009 23:05

RESOLVED!

Well that turned out to be fun.
reisio was dead right about the problem being a closing div tag...a missing one in this case....but the problem was more complicated than I thought.

I took all the posts from one broken category and added them to a working category. As a result it broke the working category.
I then deleted the posts one by one. At the sixth post, the style was restored. Going back to my production blog and editing the post the answer jumped up at me.
In this post I had added a div to align the image center...but I didn't close the div!

So all the categories now render properly. I need to find a missing tag in the un-categorized posts however.

thanks again reisio.

Nature & Travel Photography
Main Entrance

reisio
Paranoid (IV) Inmate

From: Florida
Insane since: Mar 2005

posted posted 06-21-2009 03:56

Was a fun one.



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu