hi! my sidebar does wierd things on page 2!
-
hiya,
My website looks fine on the front page, but when you go to the second page, the sidebar decides to fly out to the right! it looks like it’s outside of the page wrap for some reason, although as far as i am aware it should be fine as it’s all in the index.php!
what i am guessing, is that it has something to do with the if statement i am running… it checks to see if it’s the first page. if it is, then it shows a featured post and displays it. then runs the normal loop. but something seems to go wrong on page 2 etc…
this is my site https://allthebestvids.com/
and the code for the index.php is below.
If you could help me with this then i will think that you are a pretty swell guy!
<?php get_header(); ?> <div id="main"> <?php if ( !is_paged() ) : // check if this not a paged page of posts, then show featured post ?> <div class="loop"> <?php $my_query = new WP_Query('category_name=featured&posts_per_page=1'); while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID;?> <div id="post-<?php the_ID(); ?>"> <br class="clear"/> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"> <?php the_title(); ?></a></h2> <?php the_content('Read The Article / Have your say!'); ?> <?php echo get_post_meta($post->ID, 'video', true);?> <!-- <p><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments ?', '1 Comment ?', '% Comments ?'); ?> </p> --> </div> <!-- end of first styled loop --> <?php endwhile; ?> <?php endif; // end of if( !is_paged() ) condition, end of featured post ?> <!-- 2nd loop --> <?php if (have_posts()) : while (have_posts()) : the_post(); if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?> <div class="post" id="post-<?php the_ID(); ?>"> <div id="datebox"> <p class="day"><?php the_time('d') ?></p> <p class="month"><?php the_time('M') ?></p> <p class="year"><?php the_time('Y') ?></p> </div> <h2 class="floatLeft"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"> <?php the_title(); ?></a></h2> <br class="clear"/> <?php echo get_post_meta($post->ID, 'image', true);?> <?php the_content('Watch The Video / Have your say!'); ?> <p><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments ?', '1 Comment ?', '% Comments ?'); ?></p> <br class="clear"/> </div> <!-- end of 2nd loop --> <?php endwhile; ?> <ul> <li class="listLeft"><?php next_posts_link('« Older Entries') ?></li> <li class="listRight"><?php previous_posts_link('Newer Entries »') ?></li> </ul> <?php else : ?> <h2>Not Found</h2> <p>Sorry, but you are looking for something that isn't here.</p> <?php include (TEMPLATEPATH . "/searchform.php"); ?> <?php endif; ?> </div> </div> <!-- end of main --> <?php get_sidebar(); ?> <br class="clear" /> <?php get_footer(); ?>
- The topic ‘hi! my sidebar does wierd things on page 2!’ is closed to new replies.