Cat posts in page – almost there
-
Please don’t flame me for n00bnes!
I wanted only ‘events’ cat posts in a page called events which has a menu item and a nice url domain.com/events [which I always want to keep]
To do this I went into my themes root and created a copy of page.php and named it events.php
In the commented section a the top I added “Template Name: Events”
I then added “<?php query_posts(‘cat=4’); ?>” just before the line “<?php while ( have_posts() ) : the_post(); ?>”
I then created a page called events, added some static text to the top then selected template “Events”
I then added the events page to the menu
cat 4 is the ‘events’ category
This seems to work ok although I am guessing there is a lot more elegant / correct way to do this?
Anyways, my question is as follows; on posts on my main posts page, below the post title but before the post text there is ‘Date Author Leave a Comment’ however these do not appear on posts on my events page?
Can I add some code to my events.php to pull these in? The UPDATED and CATEGORIES info at the end of the post including the HR would also be useful. Not sure where blog posts derive these?
Thanks a mill!
- The topic ‘Cat posts in page – almost there’ is closed to new replies.