WordPress.org

Support

Support » Themes and Templates » [Resolved] Gap in Content Posts & Background

[Resolved] Gap in Content Posts & Background

  • I have errors in how the posts/content is positioned. I originally added a div wrapping the left side which worked, but only on the homepage – which didn’t make sense.

    I removed that div thinking that was my error but I still can’t get the content & background to be at the top, no matter what kind of width or float I add to my sidebars and image or content, no combination seems to work. In 2 days I haven’t been able to resolve this! PLEASE, PLEASE HELP. I am trying but I am also pulling my hair out and no one likes a bald woman!

Viewing 14 replies - 1 through 14 (of 14 total)
  • esmi

    @esmi

    Forum Moderator

    Site url? Help is free but psychic costs extra. 🙂

    Is it that messed up that you don’t know where to start with your reply?

    esmi

    @esmi

    Forum Moderator

    No – just in a different time zone to you.

    Get rid of the clear:both; on .entry-title. and width:100%; on div#container.

    I know, I was stalking you earlier 😉

    Pardon my impatience. I am unemployed and excited and anxious to complete this but also beyond challenged and overwhelmed. I CAN’T THANK YOU ENOUGH.

    THIS ONLY WORKS on my homepage. The only difference in the other template is that I added an additional sidebar that just references another photo. The image settings are the same for both photos.

    I take that back. I just realized I had and extra DIV from when I deleted the LEFT div I added. When I removed that it reverts to falling under the photo again – correct ‘x’ position but not correct ‘y’ position.

    WHAT I DON’T UNDERSTAND IS THAT IF MY SIDEBAR HAS A WIDTH AND A FLOAT” LEFT, THEN HOW DOES THE CONTENT NOT FLOAT LEFT? ANY SPACE TO THE RIGHT OF THAT PHOTO SHOULD BE ‘CLIPPED’ SO THAT THE COPY AND WHT BACKGROUND CAN MOVE UP.

    esmi

    @esmi

    Forum Moderator

    You still need to get rid of the clear:both; on .entry-title. You do need to wrap the two sidebars inside a single containing div and float that left.

    Oh. So I was right to have my left div to begin with. I thought that was what was making it not work on the other templates. This works with every page except this one, http://myownway.com/blog/?page_id=8, which should be the same as the homepage…

    THIS IS WHERE my confusion comes in about how this can work with other ID’s ;( but that’s conditional tags and I am hoping you can confirm my question on that next 😉 MANY, MANY, MANY, THANKS.

    esmi

    @esmi

    Forum Moderator

    Are you using is_home() and/or is_front_page() on your home page template (index.php)? If so, try using is_page('8') in page.php.

    I actually don’t see either exact conditional tag anywhere.

    This is the 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="comments-link"><?php comments_popup_link('0', '1', '%', 'commentslink', 'Closed'); ?></span>
                            <span class="meta-sep">|</span>
                        	<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>
    				<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>
                    <div class="bottom-meta">
                    	<small class="metadata"><?php the_tags(__('<span class="tag-links">Tagged in: ', 'sandbox'), ", ", "</span>\n") ?></small>
                    </div>
    			</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 this is the page.php

    <?php get_header() ?>
    
    	<div id="container">
    
    <?php include ('sidebar2.php'); ?>
    
    		<div id="content">
    
    <?php the_post() ?>
    			<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(); ?><?php edit_post_link(__('Edit', 'sandbox'),'<span class="edit-page-link">','</span>') ?></h1>
    
    				<div class="entry-content">
    <?php the_content() ?>
    
    <?php wp_link_pages("\t\t\t\t\t<div class='page-link'>".__('Pages: ', 'sandbox'), "</div>\n", 'number'); ?>
    
    				</div>
    			</div><!-- .post -->
    		</div><!-- #content -->
    	</div><!-- #container -->
    <?php get_footer() ?>
    esmi

    @esmi

    Forum Moderator

    In index.php, you’re using sidebar.php. In page.php, you’re using sidebar2.php. So is http://myownway.com/blog/?page_id=8 assigned to a custom page template that uses sidebar.php?

    http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

    I will check out your link above. I am sure it is yet another missing piece of my puzzle.

    I actually am questioning what you ask above in my other post “How to Access Dynamic Page Id’s”. Thank you, Thank you, Thank you. I shall return and I hope you do as well! If not SLEEP TIGHT.

    I DID NOT HAVE TEMPLATES MADE. THIS WAS THE PROBLEM HERE. THANKS!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘[Resolved] Gap in Content Posts & Background’ is closed to new replies.