Styling Page of Posts
-
Hi,
I’ve looked at all the entries dealing with styling a page of posts, but I can’t get my list of posts to stay put on the left side of the page. It extends all the way across the page and dumps the sidebar below it. That’s the main problem I’m having.http://www.theamazingagingmind.com/seniors-people-with-abilities/
Can anyone help?
Thanks!
-
You got the:
<div id="content" class="narrowcolumn">Try applying width to the narrowcolumn:
.narrowcolumn {width:500px}In the stylesheet? I tried putting it exactly like this in the stylesheet:
.narrowcolumn {
width:500px;
}No go, though.
Here’s the pageofposts code in case the problem is here:
<?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 = 14; // -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’ => $showposts,
‘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><?php the_title(); ?></h2>
<div class=”entry”>
<?php the_content(‘Read the rest of this entry »’); ?>
</div>
</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(); ?>It was div=”content” that was messing things up. Changed it to div=”content1″ and created a new style for it–will some new cool features!
Thanks
The topic ‘Styling Page of Posts’ is closed to new replies.