• Resolved georginaswancom

    (@georginaswancom)


    Hello!

    I’m having a little trouble with the layout of my WordPress blog at http://www.georginaswan.com

    Everything is in place apart from the hyperlink of the most recent post, which is at the very top but has a huge gap above it! (Please click through and have a look to see what I mean.)

    I’ve checked my margins and all my coding, but I can’t figure out why this is happening! If you click on the title and go onto the post, the white gap disappears.

    Advice would be appreciated!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter georginaswancom

    (@georginaswancom)

    Anyone?!

    You’re going to have to modify the theme a little bit. On the front page the title of the post is wrapped within the div with the .post class.

    While on a single post page the title of the post isn’t wrapped within this div.

    In the style.css file there is

    #content .post {
    	margin: 2em 0em 0em;
    }

    The 2em states the top margin which is providing the extra space above the post title on the main page.

    I am not sure how much you know about HTML/CSS but you are going to have to do some editing. In the single post page the div with the .post class starts at the post picture so if you just simply remove the 2em from the above code it places the image over some of the meta text for the post.

    Hope that helps, if you need some more guidance let me know 🙂

    Thread Starter georginaswancom

    (@georginaswancom)

    Hello, thank you for your help.

    I’ve already tried changing that ‘2’ to a ‘0’, and removing it all completely so that there are only two ‘0’s there, but it’s making no difference!

    It will make a difference on both the home page and single post pages. I tested it myself using a live CSS editor and changing the 2em moves the post title up decreasing the white space.

    But to remedy the problem completely you will need to edit the HTML as I previously mentioned in my post.

    Thread Starter georginaswancom

    (@georginaswancom)

    Thank you for your help, I really appreciate it!

    Changing the value of the margin/s is really making no difference at my end. Is the problem in this bit?

    <?php while (have_posts()) : the_post() ?>
    
    		<?php if (is_single() || is_page()) { /* for single-item pages, make that thing big */ ?>
    
    <font size="3"><b><?php the_title(); ?></font></b><br><font color="#666666"><?php the_time('j F Y')?></font>
    			<div class="post" id="post-<?php the_ID(); ?>">
    
    <?php } else { /* otherwise, make it small since you'll have one of the headings above */ ?>
    
                            <div class="post" id="post-<?php the_ID(); ?>">
    
    <font size="3"><b><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></b></font><br><font color="#666666"><?php the_time('j F Y')?></font>
    
    			<?php } ?>
    				<div class="entry">
    					<?php the_content('More... &raquo;'); ?>
    				</div>

    If the margin isn’t moving enough for you you can always use negative margins as well. Instead of using 1em or 0em you can use -1em, -2em, etc.

    But like I mentioned, due to the way the theme is coded and as is shown in the code you posted the theme author built it odd. If you can post the entire code from that file that you took a section out of I can help you better.

    Thread Starter georginaswancom

    (@georginaswancom)

    Negative margin almost worked, but then the post title gets covered up by the image, like you said before.

    Okay, here is the whole of the Main Index Template, index.php

    <?php get_header(); ?>
    
    <?php /* this is to deal with author pages */
    if(isset($_GET['author_name'])) :
    $curauth = get_userdatabylogin($author_name); // NOTE: 2.0 bug requires get_userdatabylogin(get_the_author_login());
    else :
    $curauth = get_userdata(intval($author));
    endif;
    ?>
    <div id="content">
    	<?php if (have_posts()) : ?>
    		<?php if (!is_single() && !is_page()) echo "<h2 class=\"pagetitle\">";
                            if (is_home()) {
    			echo '';
    		} elseif (is_category()) {
    			echo 'Posts categorized “' . single_cat_title('', false) . '”';
    		} elseif (is_tag()) {
    			echo 'Posts tagged  “' . single_tag_title('', false) . '”';
    		} elseif (is_author()) {
    			echo 'Posts by ' . $curauth->nickname;
    		} elseif (is_day()) {
    			echo 'Posts from ' . get_the_time('F jS, Y');
    		} elseif (is_month()) {
    			echo 'Posts from ' . get_the_time('F Y');
    		} elseif (is_year()) {
    			echo 'Posts from ' . get_the_time('Y');
    		} elseif (is_time()) {
    			echo 'Posts from a particular time on ' . get_the_time('F, jS, Y');
    		} ;
    		if (!is_single() && !is_page()) echo "</h2>"; ?>
    		<?php while (have_posts()) : the_post() ?>
    		<?php if (is_single() || is_page()) { /* for single-item pages, make that thing big */ ?><font size="3"><b><?php the_title(); ?></font></b><br><font color="#666666"><?php the_time('j F Y')?></font>
    			<div class="post" id="post-<?php the_ID(); ?>">
    		<?php } else { /* otherwise, make it small since you'll have one of the headings above */ ?>
    			<div class="post" id="post-<?php the_ID(); ?>">
    <font size="3"><b><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></b></font><br><font color="#666666"><?php the_time('j F Y')?></font>
    
    			<?php } ?>
    				<div class="entry">
    					<?php the_content('More... &raquo;'); ?>
    				</div>
    
    				<?php if (is_single() || is_page()) { ?>
    					<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    				<?php } ?>
    
    				<p class="postmetadata">
    <br>
    <img src="http://georginaswan.com/wp-content/uploads/2011/01/signature.png"></font><p>
    
    <?php comments_popup_link('Comment', '1 comment', '% comments', 'comments-link', ''); ?><br />
    				<?php /* pages don't have categories or tags */ if (!is_page()) { ?>  <?php /* } */?>
    				<?php if (get_the_tags()) the_tags('Read other posts tagged ', ', ', ''); ?><?php } ?></p>
    			</div>
    
    		<?php comments_template(); ?>
    
    <center><br><p>
    <script type="text/javascript"><!--
    google_ad_client = "pub-1109230667366730";
    /* Images only banner */
    google_ad_slot = "6288875316";
    google_ad_width = 468;
    google_ad_height = 60;
    //-->
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    <br><p><br></center>
    
    		<?php endwhile; ?>
    
    		<?php if (!is_single() && !is_page()) { ?>
    			<div class="navigation">
    						<div class="goback"><?php next_posts_link('Older'); ?></div>
    						<div class="goforward"><?php previous_posts_link('Newer'); ?></div>
    			</div>
    		<?php } ?>
    
    	<?php else : ?>
    
    		<h2>Not Found</h2>
    		<p>Sorry, but you are looking for something that isn't here.</p>
    
    	<?php endif; ?>
    </div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

    Thread Starter georginaswancom

    (@georginaswancom)

    Anyone?

    Try removing is_single() from the following piece of code.

    <?php if (is_single() || is_page())

    so it looks like

    <?php if (is_page())

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Empty space in content area above post – margin? Or what? Help!’ is closed to new replies.