Thread Starter
dmd54
(@dmd54)
If anyone is reading this…I have partially solved the problem but still would like to know if what I want to achieve is possible.
I made a category “blog” that is representing what I want to show up as the blog page. http://danielpaymar.com/category/blog
basically i want to figure out how I can eliminate having to have the directory going through “category” to get to the main blog page for my site.
Checkout http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates and look at section “A Page of Posts” this should be what you are looking for.
Thread Starter
dmd54
(@dmd54)
I had already created a page template. I added and tweaked the code in the codex referenced “A page of posts” but it’s still not showing anything.
Thread Starter
dmd54
(@dmd54)
All right, I got it working but the formatting is all messed up, posts are appearing outside of the left column. Any idea why that would be?
For what i can see there is an additional </div> that closes the left content after the first post. Can you please paste here your page template so i can check it?
Thread Starter
dmd54
(@dmd54)
This is the template I’m using for the blog page:
<?php
/*
Template Name: category
*/
?>
<?php
get_header();
?>
<!-- Begin #colLeft -->
<div id="colLeft">
<h1><?php the_title(); ?></h1>
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args= array(
'category_name' => 'Blog', // Change these category SLUGS to suit your use.
'paged' => $paged
);
query_posts($args);
if( have_posts() ) :?>
<?php while ( have_posts() ) : the_post(); ?>
<div class="postItem">
<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<div class="meta">
<?php the_time('M j, Y') ?> // by <span class="author"><?php the_author_link(); ?></span> // <?php the_category(', ') ?> // <?php comments_popup_link('No Comments', '1 Comment ', '% Comments'); ?>
</div><!-- END META -->
<?php the_excerpt() ?>
<div class="postTags"><?php the_tags(); ?></div> <?php comments_template(); ?>
</div><!-- END POST TAGS -->
<?php comments_template(); ?>
</div><!-- END OF POST ITEM -->
<?php endwhile; else: ?>
<p>Sorry, but you are looking for something that isn't here.</p>
<?php endif; ?>
</div><!-- END LEFT COL -->
<div id="colRight"></div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Thanks for checking it
Try to remove this:
</div><!-- END POST TAGS -->
Thread Starter
dmd54
(@dmd54)
Yeah, that did it. Thanks a lot for double checking and the help.
cheers