Creating a non-homepage blog main page
-
I am new to wordpress themes and am looking to create my own page template.
My homepage is not going to list all of the posts like a typical blog but a sub-page will.
I came up with the following page template but it is not behaving as I would like it and I just can’t seem to figure out what is going on.
Some things not working are:
Tags not showing up, number of comments not showing up I cant seem to get prev next to work when I add it in.
Any help or being pointed to resources/documentation would greatly be appreciated.
Thanks
Brian<?php /* Template Name: Blog Listing */ ?> <?php get_header(); ?> <div id="content"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><?php the_title(); ?></h2> </div> <?php endwhile; endif; ?> <?php // Declare global $more, before the loop. global $more; ?> <?php $lastposts = get_posts('numberposts=10'); foreach($lastposts as $post) : setup_postdata($post); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h4><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h4> <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: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p> </div> <?php endforeach; ?> </div> <?php get_sidebar(); ?> <?php get_footer(); ?>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Creating a non-homepage blog main page’ is closed to new replies.