WordPress.org

Ready to get started?Download WordPress

Forums

Content Background On Dynamic Pages (17 posts)

  1. khlota
    Member
    Posted 4 years ago #

    I can't figure out how to control the white background I have placed behind the content when on pages that deal with recent posts, archives, categories, etc.... There's a gap that I need to close - they all need to top align but I don't see where or how to do this ;) Go to the domain below and click recent posts to see what I mean. Any help would be appreciated.

    http://www.supportmyhabit.com

  2. stvwlf
    Member
    Posted 4 years ago #

    Your page looks fine in FF - the problem is in IE. It looks like the problem is bad HTML - validate your page
    http://validator.w3.org/check?uri=http://www.supportmyhabit.com/
    43 errors, some of them missing closing tags on DIV's - that is what often causes problems like this. The key errors are the last ones on the list - start there.

  3. khlota
    Member
    Posted 4 years ago #

    ;) I haven't even gotten far enough to test in anything but what I use, which is Firefox. I fear IE (and the PC), as nothing works there for a Mac user - not without a ton of massaging. But I shall take your advice, thanks.

  4. khlota
    Member
    Posted 4 years ago #

    I fixed all of the errors here but yet I still have a giant gap in Explorer 7.... at least on the homepage and probably others as well. I can't for the life of me figure this out. Any ideas?

  5. alchymyth
    The Sweeper & Moderator
    Posted 4 years ago #

    i tried a different positioning method for the 'div#content':
    (style.css)
    div#content { width: 454px; float:right; background-color:#fff; }

    instead of:
    div#content { width: 454px; margin:0px 0px 15px 496px; background-color:#fff; }

    seems to work on the homepage at least (in IE7 and firefox), i did not test other pages.

  6. khlota
    Member
    Posted 4 years ago #

    thanks, i'll give this a shot ;)

  7. khlota
    Member
    Posted 4 years ago #

    this seems to work on everything EXCEPT the Recent Posts page. Any idea how I adjust it here?

    http://www.supportmyhabit.com/?p=5

  8. alchymyth
    The Sweeper & Moderator
    Posted 4 years ago #

    probably in single.php, there seems to be a double tag <div id="left">. if i remove one of them, the design looks alright.
    below is the area from the html (the lines could come from header.php, single.php, and/or a sidebar.php) :

    </div><!--  #header -->	
    
    	<div id="container">    
    
            <div id="left">   
    
        <div id="left">
        <div id="photo" class="about"><img src="http://www.supportmyhabit.com/wp-content/themes/modmat/images/spacer.png" alt=""/></div>
    
    	<div id="primary" class="sidebar">

    have a look, if you can identify where the extra div comes from.

  9. khlota
    Member
    Posted 4 years ago #

    I was missing a closing div for <div id="left"> but only in the single.php. I don't see any other open or extra divs anywhere so the problem is still there. I do realize though that I did not add <div id="left"> to all other php files, as initially and even now to an extent I do not know or understand how they interact BUT I would think a template is a template and all pages should be set up (basically) like my homepage. So I added that div to all other php's. Now I will say consistently on any page that is not in my top navigation, comes up falling underneath my left sidebar cloumn.

    ANY THOUGHTS? http://www.supportmyhabit.com/?p=5

  10. alchymyth
    The Sweeper & Moderator
    Posted 4 years ago #

    as i said in my earlier response, REMOVING the div could resolve your problem. (also, an id should actually only be used once in a html file.)
    i think, adding the <div id="left"> to the other templates just spread the problem.
    i would rather suggest to remove the <div id="left"> from the single.php (and obviously from the other ones where you just added it).
    good luck ;-)

  11. khlota
    Member
    Posted 4 years ago #

    Sorry I misunderstood. I thought you meant I had an extra tag that didn't close somewhere. Unfortunately the <div id="left> is what makes my design work... well almost work. I know of no other way to do what I did to the left side.

    Being that I don't understand PHP creates a problem of course ;) But in CSS, as far as I thought - this should of worked. A left side and right side column - left column floats left so the right column stays put. ;(

  12. alchymyth
    The Sweeper & Moderator
    Posted 4 years ago #

    the <div id="left"> is OK. there is just one too many in the single.php. (as i posted earlier, your html shows TWO divs side-by-side in the http://www.supportmyhabit.com/?p=5 .)
    i still think, if you take the extra one out, your design should look fine.
    or you could post your index.php and single.php here for us to have a look at it, and see how they differ.

  13. khlota
    Member
    Posted 4 years ago #

    I thought I need two columns, <div id="left"> being the left and <div id="content"> being the right. Now I am surprised when I look at my index page that it doesn't have the left div!. Here are both pages.

    index.php

    <?php get_header() ?>
    
    	<div id="container">
    
    <?php get_sidebar() ?>
    
    		<div id="content">
    
    <?php while ( have_posts() ) : the_post() ?>
    			<div id="post-<?php the_ID() ?>" <?php if (function_exists(post_class)) { post_class(); } else { sandbox_post_class(); } ?>>
    				<h2 class="entry-title"><a href="<?php the_permalink() ?>" title="<?php printf(__('Permalink to %s', 'sandbox'), wp_specialchars(get_the_title(), 1)) ?>" rel="bookmark"><?php the_title() ?></a></h2>
    				<div class="top-meta">
                    	<small class="metadata">
                        	<span class="chronodata"><?php the_time('F jS, Y') ?></span>
                            <span class="meta-sep">|</span>
                            <span class="cat-links"><?php printf(__('Posted in %s', 'sandbox'), get_the_category_list(', ')) ?></span>
        <?php edit_post_link(__('Edit', 'sandbox'), "\t\t\t\t\t<span class=\"meta-sep\">|</span><span class=\"edit-link\">", "</span>\n"); ?>
    
                         </small>
    				</div><!-- top-meta -->
    
    				<div class="entry-content">
    <?php the_content(''.__('Read More <span class="meta-nav">&raquo;</span>', 'sandbox').''); ?>
    
    				<?php wp_link_pages('before=<div class="page-link">' .__('Pages:', 'sandbox') . '&after=</div>') ?>
    				<span class="clear"></span>
    				</div><!-- entry-content -->
    
                    <div class="bottom-meta">
                    	<small class="metadata"><?php the_tags(__('<span class="tag-links">Tagged in: ', 'sandbox'), ", ", "</span>\n") ?></small>
                   	</div><!-- added bottom-meta-->
    
                    <div class="bottom-meta"><!-- added -->
                  <span class="clear"></span><!-- added -->
                  <span class="comments-link"><?php comments_popup_link('LEAVE A REPLY', '1 Comment', '% Comments', 'commentslink', 'Closed'); ?></span><!-- this line was originally after first small class metadata -->
    				</div><!-- added bottom-meta -->
    			</div><!-- .post -->
    
    <?php comments_template() ?>
    <?php endwhile ?>
    
    			<div id="nav-below" class="navigation">
    				<div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav">&laquo;</span> Older posts', 'sandbox')) ?></div>
    				<div class="nav-next"><?php previous_posts_link(__('Newer posts <span class="meta-nav">&raquo;</span>', 'sandbox')) ?></div>
    				<span class="clear" />
    			</div>
    
    		</div><!-- #content -->
    	</div><!-- #container -->
    
    <?php get_footer() ?>

    and single.php

    <?php get_header() ?>
    
    	<div id="container">
    
            <div id="left">
    
    <?php include ('sidebar2.php'); ?>
    
    		<div id="content">
    
    <?php the_post(); ?>
    
                <div id="nav-above" class="navigation">
    				<div class="nav-previous"><?php previous_post_link('%link', '<span class="meta-nav">&laquo;</span> %title') ?></div><!-- #nav-previous -->
    				<div class="nav-next"><?php next_post_link('%link', '%title <span class="meta-nav">&raquo;</span>') ?></div><!-- #nav next -->
    				<span class="clear" />
    			</div><!-- #nav above -->
    
    			<div id="post-<?php the_ID(); ?>" <?php if (function_exists(post_class)) { post_class(); } else { sandbox_post_class(); } ?>>
    				<h1 class="entry-title"><?php the_title(); ?></h1>
    
                    <div class="top-meta">
                    	<small class="metadata">
                        	<span class="chronodata"><?php the_time('F jS, Y') ?> by <?php the_author_link(); ?></span>
                            <span class="meta-sep">|</span>
                            <span class="cat-links"><?php printf(__('Posted in %s', 'sandbox'), get_the_category_list(', ')) ?></span>
        <?php edit_post_link(__('Edit', 'sandbox'), "\t\t\t\t\t<span class=\"meta-sep\">|</span><span class=\"edit-link\">", "</span>\n"); ?>
                         </small>
    				</div><!-- #top-meta -->
    
    				<div class="entry-content">
    <?php the_content(''.__('Read More <span class="meta-nav">&raquo;</span>', 'sandbox').''); ?>
    					<?php wp_link_pages('before=<div class="page-link">' .__('Pages:', 'sandbox') . '&after=</div>') ?>
    					<span class="clear"></span>
    				</div><!-- #entry-content -->
    
                    <div class="bottom-meta">
                    	<small class="metadata"><?php the_tags(__('<span class="tag-links">Tagged in: ', 'sandbox'), ", ", "</span>\n") ?></small>
                    </div><!-- #bottom-meta -->
    
    			</div><!-- .post -->
    
    <?php comments_template(); ?>
    
    		</div><!-- #content -->
            </div><!-- #left -->
    	</div><!-- #container -->
    <?php get_footer() ?>
  14. alchymyth
    The Sweeper & Moderator
    Posted 4 years ago #

    the <div id="left"> comes probably from the sidebar.php - have a look there.

    is there a special reason that you call sidebar.php from index.php and sidebar2.php from single.php?
    and what is the difference between these sidebar files?

  15. alchymyth
    The Sweeper & Moderator
    Posted 4 years ago #

    just remove the <div id="left"> with the extra closing div from single.php and see if that resolves the display problem.

  16. khlota
    Member
    Posted 4 years ago #

    I use different sidebars for different photos. I didn't know how else to control the changing of that photo so I just made multiple sidebar files.

  17. khlota
    Member
    Posted 4 years ago #

    Ahh, this is why I used the <div id="left">. I just removed it from the single.php

    http://www.supportmyhabit.com/

Topic Closed

This topic has been closed to new replies.

About this Topic