treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Something horrible has happened to my blog

  • It looks like my wordpress blog post are no longer separated into separate divs. Like all the content is just thrown into the same div. What could have happened?

    http://goodwynbuilding.com/blog/

    Thanks
  • I would look at the template. Either index.php or blog.php - maybe something got changed. Did you update a theme or a plugin?
  • Well, there is a missing closing after this paragraph:

    The results of this test are available as a PDF download.
    <a href="http://goodwynbuilding.com/wp-content/themes/Goodwyn/images/PDF/37 Cotton Gin Ct. REM Report Cerificate.pdf" title="Certification">Home Energy Rating Certificate</a>
    <br/>
    <br/>


    Try to correct that, if you have access to your html just remove the two
    (that I cannot see in any other posts) and add a

    Matteo

    PS: I don't think the posts were ever enclosed in divs
  • Sorry, the code got mangled: I meant a closing
    </p>
    and remove the two line break
  • No I didn't change any php.
    Do you know exactly what part adds divs around the post?

    This looks normal. <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>

    I dont have a blog.php, maybe when I installed it was called single.php?
  • Check your latest post as per my previous instructions! I think you messed up the html.
  • Closing didn't work.
  • Well, if you didn't change anything, I'm guess there were no divs around it in the first place?

    So you're saying you haven't changed ANYthing and then just out of no where you visited your site and it was screwed up?
  • Maybe you are right, looking back at the Starkers Naked theme there are none.

    But yes, I was just adding and previewing a new post I was writing when I noticed the problem.
  • Have a look at all my previous comments... you missed a closing paragraph tag.
  • Paragraph tags are self closing. That has never been a problem on the blog. But I closed the first 3 post anyway.
  • Seems like each individual blog post should be wrapped in a container such as

    <div id="post-357" class="post-357 post type-post status-publish format-standard hentry category-events">
    ......................
    </div>
    ...or something alike, but they're not. This is usually defined in loop.php I believe. Might want to check if that file has been updated recently?
  • Another thing that's possible.... Since ALL posts are wrapped in a div with ID "blogPost" (singular!), perhaps your list of blog posts is using the wrong template? Maybe one that should only be used for single posts instead of a listing?

    If you have a specific page that lists the posts and you can select a template in the admin, you may want to check there.
  • Yea actually I dont think the post are separated in divs. My personal blog is built the same way and it is not separated into divs.

  • I noticed that if I put a clear float at the end of my post it fixes that post. Where would I insert that clear float in the PHP so that I dont have to place it at the end of every post?
  • I would actually just wrap them each in a div and then you can put the clear on the div itself. Would need to see your loop in action to provide you exact code instructions.
  • By "In Action" you mean the actual loop?


    <?php while ( have_posts() ) : the_post(); ?>

    <img class="PostThumb" src="<?php echo get_post_meta($post->ID, 'Thumbnail', true); ?>" />


    <?php /* How to display posts in the Gallery category. */ ?>

    <?php if ( in_category( _x('gallery', 'gallery category slug', 'twentyten') ) ) : ?>
    <h2><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
    <?php twentyten_posted_on(); ?>

    <?php if ( post_password_required() ) : ?>
    <?php the_content(); ?>
    <?php else : ?>
    <?php
    $images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
    $total_images = count( $images );
    $image = array_shift( $images );
    $image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' );
    ?>
    <a href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a>

    <p><?php printf( __( 'This gallery contains <a %1$s>%2$s photos</a>.', 'twentyten' ),
    'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"',
    $total_images
    ); ?></p>

    <?php the_excerpt(); ?>
    <?php endif; ?>

    <a href="<?php echo get_term_link( _x('gallery', 'gallery category slug', 'twentyten'), 'category' ); ?>" title="<?php esc_attr_e( 'View posts in the Gallery category', 'twentyten' ); ?>"><?php _e( 'More Galleries', 'twentyten' ); ?></a>
    |


    <?php /* How to display posts in the asides category */ ?>

    <?php elseif ( in_category( _x('asides', 'asides category slug', 'twentyten') ) ) : ?>

    <?php if ( is_archive() || is_search() ) : // Display excerpts for archives and search. ?>
    <?php the_excerpt(); ?>
    <?php else : ?>
    <?php the_content( __( 'Continue reading &rarr;', 'twentyten' ) ); ?>
    <?php endif; ?>

    <?php twentyten_posted_on(); ?>
    |
    <?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?>
    <?php edit_post_link( __( 'Edit', 'twentyten' ), '| ', '' ); ?>

    <?php /* How to display all other posts. */ ?>

    <?php else : ?>
    <h2><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
    <?php twentyten_posted_on(); ?>

    <?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
    <?php the_excerpt(); ?>
    <?php else : ?>
    <?php the_content( __( 'Continue reading &rarr;', 'twentyten' ) ); ?>
    <?php wp_link_pages( array( 'before' => '' . __( 'Pages:', 'twentyten' ), 'after' => '' ) ); ?>
    <?php endif; ?>

    <?php if ( count( get_the_category() ) ) : ?>
    <?php printf( __( 'Posted in %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) ); ?>
    |
    <?php endif; ?>
    <?php
    $tags_list = get_the_tag_list( '', ', ' );
    if ( $tags_list ):
    ?>
    <?php printf( __( 'Tagged %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?>
    |
    <?php endif; ?>
    <?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?>
    <?php edit_post_link( __( 'Edit', 'twentyten' ), '| ', '' ); ?>

    <?php comments_template( '', true ); ?>

    <?php endif; // This was the if statement that broke the loop into three parts based on categories. ?>

    <?php endwhile; // End the loop. Whew. ?>
  • Since your original problem was "It looks like my wordpress blog post are no longer separated into separate divs", it would indicate that eacho post USED to be in a seperate, individual div, no?

    Putting clear floats at the end of each posts may make look things good again, but that's not the solution to your problem -- it's more like a workaround. Like @TheDoc says, the way to fix this is to wrap each post in its own div.

    Anyways, I'm a bit confused cause I'm not really sure what it's supposed to look like to be honest...

    EDIT: If you add:
    <div>
    as the second line of code, and:
    </div>
    as the second-to-last line of code, each post would be wrapped in its own div already I think.