Hey Guys,
I have been spending 2 hrs on this work. I just can't figure out how to get this page aligned properly. Here is the link to the html page Click Here

and here is the susbsequent wp page's link Click Here

I'm so drained looking at the PHP code.

Could you guys please help me fix this? Here is the PHP Code

<?php
    // Template Name: Blog Template
?>
<?php get_header(); ?>
<?php 
    global $more;
    $more = 0; 
?>
<?php
 query_posts('cat=7');
$title = get_the_title();
if ( $title == "Big Image + Left Sidebar")  $data['blog_sidebar_position'] = "Left Sidebar";
if ( $title == "Mini Image + Right Sidebar")  $data['sl_blog_style'] = "Medium Images";
if ( $title == "Mini Image + Left Sidebar")  $data['sl_blog_style'] = "Medium Images";
if ( $title == "Mini Image + Left Sidebar")  $data['blog_sidebar_position'] = "Left Sidebar";

?>
            <div class="main_content_area">
            <div class="container">
                <div class="row">
                    <?php if ($data['blog_sidebar_position'] == "Left Sidebar") { ?>
                    <!--Sidebar-->
                    <div class="span3 blog_sidebar">
                        <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Blog Sidebar") ) : ?>                
                        <?php endif; ?> 
                    </div>
                    <!--/Sidebar-->
                    <?php } ?>
                    <!--Page contetn-->
                    <div class="span12">
                        <?php if ( !is_archive() ) { ?>
                        <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts('paged='.$paged.'&cat='.$cat); ?>      
                        <?php } ?> 
                        <?php if (!(have_posts())) { ?><div class="span12"><h2 class="colored">There is no posts</h2></div><?php }  ?>   
                        <?php  if ( have_posts() ) : while ( have_posts() ) : the_post(); 
                        ?>
                        <?php $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large'); ?>

                            <?php if ($data['sl_blog_style'] == "Large Images") { ?>
                            <div class="row <?php post_class(); ?>" id="post-<?php the_ID(); ?>" style="margin-bottom:50px;">
                                <div class="span12">
                                    <div class="blog_item">
                                        <?php if (( has_post_thumbnail())) { ?>

                                        <div class="row">
                                            <div class="span4 slider_area">
                                                <div class="view view-first <?php if ($data['blog_image_hover_icons'] == "Zoom icon only") { ?>nolink <?php } ?> <?php if ($data['blog_image_hover_icons'] == "Link icon only") { ?>noinfo <?php } ?>">
                                                    <img src="<?php echo $large_image_url[0]; ?>" alt="" />
                                                    <div class="mask">
                                                        <?php if ($data['blog_image_hover_icons'] == "Zoom icon + Link icon") { ?>
                                                        <a href="<?php echo $large_image_url[0]; ?>" rel="prettyPhoto" title="<?php the_title(); ?>" class="info"></a>
                                                        <a href="<?php echo get_permalink(); ?>" class="link"></a>
                                                        <?php } ?>
                                                        <?php if ($data['blog_image_hover_icons'] == "Zoom icon only") { ?>
                                                        <a href="<?php echo $large_image_url[0]; ?>" rel="prettyPhoto" title="<?php the_title(); ?>" class="info"></a>
                                                        <?php } ?>
                                                        <?php if ($data['blog_image_hover_icons'] == "Link icon only") { ?>
                                                        <a href="<?php echo get_permalink(); ?>" class="link"></a>
                                                        <?php } ?>
                                                    </div>
                                                </div>
                                                <div class="clearfix"></div>
                                                 <div class="span4" style="margin-bottom:0px !important;"></div>
                                        </div>

                                        <?php } ?>
                                        <div class="span8">
                                        <div class="blog_head">

                                            <?php if($data['blog_show_posts_date'] == true ) {
                                                    ?><div class="date">
                                                    <h6><?php if($data['blog_show_date_icon'] == true ) { ?>
                                                            <i class="icon-calendar icon-white"></i>
                                                        <?php } ?>
                                                    <?php the_time('d') ?>
                                                    <?php if ($data['blog_date_format'] == "American Style") { ?><?php the_time('M') ?><?php } ?>  <?php if ($data['blog_date_format'] == "European Style") { ?><?php the_time('m') ?><?php } ?> <?php the_time('Y') ?></h6></div><?php } ?>
                                            <h3><a href="<?php echo the_permalink(); ?>"><?php the_title(); ?> </a></h3>
                                            <div class="meta" <?php if(($data['blog_show_posts_meta_author'] == false) & ($data['blog_show_posts_meta_category'] == false ) & ($data['blog_show_posts_meta_comments'] == false )) { ?>style="margin-bottom:24px;"<?php } ?>>
                                                <?php if($data['blog_show_posts_meta_author'] == true ) { ?><span <?php if(($data['blog_show_posts_meta_category'] == false ) & ($data['blog_show_posts_meta_comments'] == false )) { ?>  class="last_item"<?php } ?> ><strong>By</strong> <?php the_author_posts_link() ?></span><?php } ?>
                                                <?php if($data['blog_show_posts_meta_category'] == true ) { ?><span <?php if(($data['blog_show_posts_meta_comments'] == false )) { ?>  class="last_item"<?php } ?>><?php $tag = get_the_tags(); if (! $tag) { ?> There are no tags<?php } else { ?><?php the_tags(''); ?><?php } ?></span><?php } ?>
                                                <?php if($data['blog_show_posts_meta_comments'] == true ) { ?><span class="last_item"><a href="<?php the_permalink() ?>#comments"><?php comments_number('0','1','%')?>  comments</a></span><?php } ?>
                                            </div>
                                        </div>

                    <?php if (get_post_meta($post->ID, video, true));{ ?>
                                            <div style=" margin-bottom:-5px !important;">
                                                <?php echo get_post_meta($post->ID, video, true); ?>
                                            </div>
                                        <?php }?>

                                        <div class="blog_item_description" <?php if($data['blog_item_description_padding'] == 0 ) { ?>style="margin-top:20px;"<?php } ?>>
                                            <?php the_content('<h6 class="read_more"><a style="margin-top:15px;" href="'. get_permalink($post->ID) . '">'. __("Read More","commander") .'</a></h6>'); ?>
                                        </div>
                                    </div>
                                </div>
                            </div>
</div>
                            <?php } ?>



                            <?php if ($data['sl_blog_style'] == "Medium Images") { ?>
                            <div class="row <?php post_class(); ?>" id="post-<?php the_ID(); ?>" style="margin-bottom:50px;">
                                <div class="span12">
                                    <div class="blog_item">

                                        <?php if (( has_post_thumbnail()) || (get_post_meta($post->ID, video, true))) { ?>

                                        <div class="row">
                                            <?php if (( has_post_thumbnail())) { ?>
                                            <div class="span4 slider_area"> 
                                                <div class="view view-first <?php if ($data['blog_image_hover_icons'] == "Zoom icon only") { ?>nolink <?php } ?> <?php if ($data['blog_image_hover_icons'] == "Link icon only") { ?>noinfo <?php } ?>">
                                                    <img src="<?php echo $large_image_url[0]; ?>" alt="" />
                                                    <div class="mask">
                                                        <?php if ($data['blog_image_hover_icons'] == "Zoom icon + Link icon") { ?>
                                                        <a href="<?php echo $large_image_url[0]; ?>" rel="prettyPhoto"  title="<?php the_title(); ?>" class="info"></a>
                                                        <a href="<?php echo get_permalink(); ?>" class="link"></a>
                                                        <?php } ?>
                                                        <?php if ($data['blog_image_hover_icons'] == "Zoom icon only") { ?>
                                                        <a href="<?php echo $large_image_url[0]; ?>" rel="prettyPhoto"  title="<?php the_title(); ?>" class="info"></a>
                                                        <?php } ?>
                                                        <?php if ($data['blog_image_hover_icons'] == "Link icon only") { ?>
                                                        <a href="<?php echo get_permalink(); ?>" class="link"></a>
                                                        <?php } ?>
                                                    </div>
                                                </div>
                                                <div class="clearfix"></div>
                                            </div>
                                                <?php }?>
                                                <?php if (get_post_meta($post->ID, video, true));{ ?>
                                                    <div class="span4" style="margin-bottom:0px !important;">
                                                    <?php echo get_post_meta($post->ID, video, true); ?>
                                                    </div>
                                                <?php }?>


                                            <div class="span5">
                                                <div class="blog_head">
                                                    <?php if($data['blog_show_posts_date'] == true ) { ?><div class="date"><h6><?php if($data['blog_show_date_icon'] == true ) { ?><i class="icon-calendar icon-white"></i> <?php } ?><?php the_time('d') ?> <?php the_time('M') ?> <?php the_time('Y') ?></h6></div><?php } ?>
                                                    <h3><a href="<?php echo the_permalink(); ?>"><?php the_title(); ?> </a></h3>
                                                    <div class="meta" <?php if(($data['blog_show_posts_meta_author'] == false) & ($data['blog_show_posts_meta_category'] == false ) & ($data['blog_show_posts_meta_comments'] == false )) { ?>style="margin-bottom:24px;"<?php } ?>>
                                                        <?php if($data['blog_show_posts_meta_category'] == true ) { ?><span <?php if(($data['blog_show_posts_meta_comments'] == false )) { ?>  class="last_item"<?php } ?>><?php $tag = get_the_tags(); if (! $tag) { ?> There are no tags<?php } else { ?><?php the_tags(''); ?><?php } ?></span><?php } ?>
                                                        <?php if($data['blog_show_posts_meta_comments'] == true ) { ?><span class="last_item"><a href="<?php the_permalink() ?>#comments"><?php comments_number('0','1','%')?>  comments</a></span><?php } ?>
                                                    </div>
                                                </div>
                                                <div class="blog_item_description" <?php if($data['blog_item_description_padding'] == 0 ) { ?>style="margin-top:20px;"<?php } ?>>
                                                    <?php the_content('<h6 class="read_more"><a style="margin-top:15px;" href="'. get_permalink($post->ID) . '">'. __("Read More","commander") .'</a></h6>'); ?>
                                                </div>
                                            </div>

                                        </div>
                                        <?php } ?>


                                        <?php if (!( has_post_thumbnail()) & !(get_post_meta($post->ID, video, true))) { ?>

                                        <div class="row">
                                            <div class="span12">
                                                <div class="blog_head">
                                                    <?php if($data['blog_show_posts_date'] == true ) { ?><div class="date"><h6><?php if($data['blog_show_date_icon'] == true ) { ?><i class="icon-calendar icon-white"></i> <?php } ?><?php the_time('d') ?> <?php the_time('M') ?> <?php the_time('Y') ?></h6></div><?php } ?>
                                                    <h3><a href="<?php echo the_permalink(); ?>"><?php the_title(); ?> </a></h3>
                                                    <div class="meta" <?php if(($data['blog_show_posts_meta_author'] == false) & ($data['blog_show_posts_meta_category'] == false ) & ($data['blog_show_posts_meta_comments'] == false )) { ?>style="margin-bottom:24px;"<?php } ?>>
                                                        <?php if($data['blog_show_posts_meta_category'] == true ) { ?><span <?php if(($data['blog_show_posts_meta_comments'] == false )) { ?>  class="last_item"<?php } ?>><?php $tag = get_the_tags(); if (! $tag) { ?> There are no tags<?php } else { ?><?php the_tags(''); ?><?php } ?></span><?php } ?>
                                                        <?php if($data['blog_show_posts_meta_comments'] == true ) { ?><span class="last_item"><a href="<?php the_permalink() ?>#comments"><?php comments_number('0','1','%')?>  comments</a></span><?php } ?>
                                                    </div>
                                                </div>
                                                <div class="blog_item_description" <?php if($data['blog_item_description_padding'] == 0 ) { ?>style="margin-top:20px;"<?php } ?>>
                                                    <?php the_content('<h6 class="read_more"><a style="margin-top:15px;" href="'. get_permalink($post->ID) . '">'. __("Read More","commander") .'</a></h6>'); ?>
                                                </div>
                                            </div>

                                        </div>


                                        <?php } ?>







                                    </div>
                                </div>
                            </div>
                            <?php } ?>




                        <?php endwhile;  ?> 
                        <?php endif; ?>
                        <section style="padding:0px !important;">
                            <hr style="margin-top:0px;">
                            <?php if (function_exists('wp_corenavi')) { ?><div class="pride_pg"><?php wp_corenavi(); ?></div><?php }?>
                        </section>
                    </div>
                    <!--/Page contetn-->
                    <?php if ($data['blog_sidebar_position'] == "Right Sidebar") { ?>
                    <!--Sidebar-->
                    <div class="span3 blog_sidebar">
                        <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Blog Sidebar") ) : ?>                
                        <?php endif; ?> 
                    </div>
                    <!--/Sidebar-->
                    <?php } ?>
                </div>
            </div>
            </div>


<?php get_footer(); ?>

Thanks in advance!

Member Avatar for iamthwee

You've totally massacred your wordpress site. You've managed to nest the divs somehow which is causing the indentation.

You should have one div for the sidebar and then all the pictures inside without nesting.

<div class="sidebar">
    <?php
        //pull content from db here
    ?>
</div>

iamthwee: its not me who massacred the code. Its a file from thr commander wp theme in themeforest. I generally dont code in wordpress. I dont want the content to be in the sidebar. Honestly, when i saw the code i went like "WTF!!" and my company is insisting on using this theme but am kinda stuck here.

i got it resolved finally :D it was a silly template setting. Changed large image to medium! Thanks anyways! Tc

90% of the time it isn't the themes fault. Try reading the documentation first.

Please mark as solved

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.