nickallain
Member
Posted 1 year ago #
This one is a little tricky but it's probably something simple or fundamental that I've overlooked. I may just be wrong about the way I'm using CSS positioning in the content of my page?
I'm working on a wordpress site for a friend. I have a page template file that basically says:
If this is the news page...
... do the wordpress loop
else
... load the page contents.
On the news page, the site loads correctly:
http://nicholasallain.com/robertsite/org/?page_id=7
On any other page, the page ignores the content and draws the footer right under the header:
http://nicholasallain.com/robertsite/org/?page_id=15
Here's my page content:
http://pastebin.com/pNf9D2La
Hello,
Why don't you create a new file CSS and separate the style of code?
The structure of the site is messy.
<div id="wrap">
<div id="header">
your code here..
</div>
<div id="container">
<div id="content">
your code here..
</div><!-- end content -->
<div id="sidebar">
your code here..
</div><!-- end sidebar-->
</div> <!-- end container -->
<div class="clear"></div>
<div id="footer">
your footer code...
</div><!--end footer-->
</div><!-- end wrap -->
and create a style.css
#wrap{
width:1024px;
margin:auto;
}
#header{
.....
}
#content{
padding:20px;
....
}
.clear{
clear:both;
}
#footer{
....
}
If you do a good structure of your site, its easier to find any mistake.
nickallain
Member
Posted 1 year ago #
Thanks WillxD,
I've actually been doing that as I go along. I initially created a prototype with all this messy code. I've cleaned up the rest of the pages - this is the last one to fix up.
I'm just weary of separating this all out then having to bounce between two files to find the issue.
I agree that the mess is part of the problem.
have you checked, if this
$pageid = $id;
in line 5 actually contains anything?
imho, this is unlikely;
i would use something like:
$pageid = $post->ID;
For my 2 cents that looks like uncleared floats. if u float one or more elements in a div you need to do something to bring the container down behind the floats otherwise subsequent content rides up. These days we add width : xxx; overflow:hidden; to the parent. But mixing yr html and CSS inline is a disaster.
nickallain
Member
Posted 1 year ago #
Thanks everyone,
Turns out I was using absolute positioning on the page contents (maincontent) where I should have been using relative. Turns out all I needed was fresh eyes and some good pointers. :) This issue is officially resolved.
alchymyth, strangely enough they both seem to work.