Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to have my Index page show posts from a certain Category ('news'). I have that functionality, but is there a way I can make a 'News' Page, where the slug just points to the index?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

I would take the current code you have and drop it into a page template called tpl-news.php or whatever you choose. Add the following to the header before your index.php code:

<?php
/*
Template Name: News
*/
//Add your index.php code here
//You can also use wp_redirect(home_url()) here as well if I misunderstood your question

Now, create a page called 'News' with a slug of 'news' and select the 'News' page template. That should do the trick for you.

I would also look at how Wordpress template hierarchy works and build template files that target a specific category - Example: category-news.php would force this file to be used when the 'news' category permalink is viewed rather than the default archive template.

http://codex.wordpress.org/Template_Hierarchy

share|improve this answer
    
great thanks for that. Works great! –  dtj Sep 19 '11 at 2:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.