I NEED HELP! and my php needs some correcting too.

Hi there,

I am new to this forum, and new to editing PHP files for my wordpress sites.

I am having a problem with one of my sites and have no clue how to fix it:

there are date tabs to the left hand side of my homepage for every post.

they are stair-stepping to the right every time i add a new post.

check this out and let me know if you can help:

http://www.karmaloopdiscountcodes.net

thanks,

eric

looks like you’ve got nested divs using post class within parent div’s simply fix can you post your code for that pages theme.

will be in wp-content/themes/your-theme/index.php

This theme has a weird index.php, but i’ll paste what I think you’re looking for and you can let me know if it is. thanks a ton for the help.

[b]here is the index.php

[/b]<?php if (get_option('artsee_format') == 'Blog Style') { ?>

<?php include(TEMPLATEPATH . '/includes/blogstyle.php'); ?> <?php } else { include(TEMPLATEPATH . '/includes/default.php'); } ?>

[b]here is the default.php

<?php get_header(); ?>
<?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <?php $thumb = get_post_meta($post->ID, 'Thumbnail', $single = true); ?>
        <div style="float: left; margin-left: -71px;" class="ie6float">
            
            <div class="date"> <span class="month">
                <?php the_time('M') ?>
                </span> <span class="day">
                <?php the_time('j') ?>
                </span> </div>
                
            <div style="float: left; width: 570px; clear: right; margin-top: 3px; margin-bottom: 0px; padding-top: 10px;  margin-left: 5px;" class="iehack">
                <h2 class="h1-link"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
                    <?php the_title(); ?>
                    </a></h2>
                
                <div style="clear: both;"></div>
            </div>
            
        </div>
        
        <div style="clear: both;"></div>
        <div class="post">
        <div style="clear: both;"></div>
    <?php endwhile; ?>
    <p class="pagination">
        <?php next_posts_link('&laquo; Previous Entries') ?>
        <?php previous_posts_link('Next Entries &raquo;') ?>
    </p>
    <?php else : ?>
    <h1>No Results Found</h1>
    <p>The page you requested could not be found. Try refining your search, or use the navigation above to locate the post.</p>
    <?php endif; ?>
</div>
<?php get_sidebar(); ?> <?php get_footer(); ?>

here is the blogstyle.php

<?php get_header(); ?>
<?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <?php $thumb = get_post_meta($post->ID, 'Thumbnail', $single = true); ?>
    <div class="post-wrapper">
        <div style="float: left; margin-left: -71px; position: relative;" class="ie6float2">
            <div class="date"> <span class="month">
                <?php the_time('M') ?>
                </span> <span class="day">
                <?php the_time('j') ?>
                </span> </div>
            <div style="float: left; width: 570px; clear: right; margin-top: 3px; margin-bottom: 0px; padding-top: 10px;  margin-left: 5px;" class="iehack">
                <h2 class="h1-link"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
                    <?php the_title(); ?>
                    </a></h2>
                <div class="articleinfo">Posted by
                    <?php the_author() ?>
                    in
                    <?php the_category(', ') ?>
                    on
                    <?php the_time('m jS, Y') ?>
                    |
                    <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?>
                </div>
                <div style="clear: both;"></div>
            </div>
        </div>
        <div style="clear: both;"></div>
        <div class="post">

                <?php the_content(); ?>

        </div>
    </div>
    <?php endwhile; ?>
    <p class="pagination">
        <?php next_posts_link('&laquo; Previous Entries') ?>
        <?php previous_posts_link('Next Entries &raquo;') ?>
    </p>
    <?php else : ?>
    <h1>No Results Found</h1>
    <p>The page you requested could not be found. Try refining your search, or use the navigation above to locate the post.</p>
    <?php endif; ?>
</div>
<?php get_sidebar(); ?> <?php get_footer(); ?>

here is the header.php just in case

> <?php if (is_home()) : ?> <?php bloginfo('name'); ?> - <?php bloginfo('description'); ?> <?php else : ?> <?php wp_title('', 'false'); ?> - <?php bloginfo('name'); ?> <?php endif; ?> <?php global $options; foreach ($options as $value) { if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); } } ?> <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?> <?php wp_head(); ?>
logo
facebook follow twitter follow rrs feed
  • Home
  • <?php wp_list_pages("sort_order=$artsee_order_page&depth=1&exclude=$artsee_exclude_page&title_li="); ?>

[/b]

looks like the closing div for post is missing in default.php:

[php]



<?php endwhile; ?>[/php][b]

Should be:

[/b][php]


<?php endwhile; ?>[/php]

Thanks for seeing that. I corrected it and still seeing the same stair-stepping problem.

anything else it could be?

yeah you’ve got 3 divs inside the loop but only close 2 of them and miss the 3rd

the three divs:

[php]

        <div style="float: left; margin-left: -71px;" class="ie6float">
           
            <div class="date"> <span class="month">
                <?php the_time('M') ?>
                </span> <span class="day">
                <?php the_time('j') ?>
                </span> 
             </div>
               
            <div style="float: left; width: 570px; clear: right; margin-top: 3px; margin-bottom: 0px; padding-top: 10px;  margin-left: 5px;" class="iehack">[/php]

the end of the loop:

[php]


        </div>
       
        <div style="clear: both;"></div>
        <div class="post">
        <div style="clear: both;"></div>[/php]

should be:

[php]




        <div style="clear: both;"></div>
        <div class="post">
        <div style="clear: both;"></div>
         </div>[/php]

You probably don’t need all the extra divs but look at them later:

[php]



[/php]

dude you are awesome, totally fixed the problem.

I’m an SEO so let me know if you need any SEO tips or help.

thanks,

Eric
ericwilliamrea at gmail dot com

happy to help :smiley: I’m always trying to learn all I can with SEO so if you know of any good resource I’d be grateful.

do you have any sites that you’d like me to audit?

maybe we could trade, you help me with php/html stuff, i help you with seo?

let me know because i think that could work out for both of us.

that sounds good you could take a look at my site http://www.daveismyname.com I’ve recently updated it waiting for Google to reindex it.

Sponsor our Newsletter | Privacy Policy | Terms of Service