Jump to content
Sign in to follow this  
cruiser

Sidebar help on a page of posts template.

Recommended Posts

cruiser

I set up a Page Of Posts template found at http://codex.wordpress.org/Pages on the Wordpress.org support site. The only trouble is I am using the Whitehouse Pro template and the sidebar end up floating below the post, on the left side is there and way I can fix this? Here is a copy of the template code

	<?php
	/*
	Template Name: PageOfPosts
	*/
	
	get_header(); ?>
	
	<div id="content" class="narrowcolumn">
	
	<?php
	if (is_page() ) {
	$category = get_post_meta($posts[0]->ID, 'category', true);
	}
	if ($category) {
	  $cat = get_cat_ID($category);
	  $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
	  $post_per_page = 4; // -1 shows all posts
	  $do_not_show_stickies = 1; // 0 to show stickies
	  $args=array(
	    'category__in' => array($cat),
	    'orderby' => 'date',
	    'order' => 'DESC',
	    'paged' => $paged,
	    'posts_per_page' => $post_per_page,
	    'caller_get_posts' => $do_not_show_stickies
	  );
	  $temp = $wp_query;  // assign orginal query to temp variable for later use
	  $wp_query = null;
	  $wp_query = new WP_Query($args);
	  if( have_posts() ) :
			while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
		    <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
	        <h2>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></h2>
	        <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>
	        <div class="entry">
	          <?php the_content('Read the rest of this entry ?»'); ?>
	        </div>
	        <p class="postmetadata"><?php the_tags('Tags: ', ', ', ''); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('No Comments ?»', '1 Comment ?»', '% Comments ?»'); ?></p>
	      </div>
	    <?php endwhile; ?>
	    <div class="navigation">
	      <div class="alignleft"><?php next_posts_link('?« Older Entries') ?></div>
	      <div class="alignright"><?php previous_posts_link('Newer Entries ?»') ?></div>
	    </div>
	  <?php else : ?>
	
			<h2 class="center">Not Found</h2>
			<p class="center">Sorry, but you are looking for something that isn't here.</p>
			<?php get_search_form(); ?>
	
		<?php endif;
	
		$wp_query = $temp;  //reset back to original query
	
	}  // if ($category)
	?>
	
		</div>
	
	<?php get_sidebar(); ?>
	
	<?php get_footer(); ?>
	[/code]

Share this post


Link to post
Share on other sites
cruiser

I have been going in circles on this since last night, and still hav not gotten anywhere, any of the theme experts able to lend a hand?

Share this post


Link to post
Share on other sites
cmunns

The sidebar being pushed down is a css issue. Send over a live link to the site and I'll take a look.

Share this post


Link to post
Share on other sites
cruiser

the link is www.CruiserFootball.com the two post I do have up I have turned off the sidebars as a quick fix, do you want me to turn them back on so you can see what is happening? Thank for the assistant it is greatly appreciated Rob

Share this post


Link to post
Share on other sites
cruiser

I reset it so that the two posts I have up one in the "world Cup 2010" and one in the "Europe" sections so you can see what the sidebar is doing.

Share this post


Link to post
Share on other sites
cmunns

So basically what happened is that you copied the code, but certain divs/classes aren't the same. You need to add a div with an id of "maincontent" just after your "content" div. You'll also need to assign classes that match our as well and potentially add some other divs to get some detail back. It might be easier to just describe exactly what you're trying to do with that code? The copied section above is all that you have in that template file, correct?

Share this post


Link to post
Share on other sites
cruiser

Yeah that is the whole template I got, it was taken from the wordpress.org instructional document. esetially I wantt the have a half dozen different blog pages on the top menu to us as a news cast from for different regions in the world and be able to simple type up a post and drop it in the right catagory and it will be in the right section I am attempting to get a sports page up and running If you have any other suggestions or some how alter what I have to work I would greatly appreciate it. Rob

Share this post


Link to post
Share on other sites
cmunns

My honest opinion...if you're not familiar with php, html, or css is to hire someone to do this for you. If you mess up something it might just give you a bigger headache than you had before. We do offer customization, you can get a hold of us through email if you are interested.

Share this post


Link to post
Share on other sites
cruiser

I got it up and running last night, still needs a few tweaks but seems to be working well.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×