WordPress display Catgeory Posts on Page

I want to do almost exactly this: http://codex.wordpress.org/Pages#A_Page_of_Posts

But Im confused by the last line:

Read More

Save this to pageofposts.php and then assign PageofPosts as the
Template when creating the action Page:

How do I tell WordPress to go to index.php, (or anything else) when, for example, it receives an ‘events’ slug?

Related posts

Leave a Reply

1 comment

  1. If you have followed the example in your link then you have created a file ‘pageofposts.php’ and uploaded it to your theme’s directory.

    Now when you create a new page in your wordpress admin, on the right side you will see a section for choosing the template – if you have uploaded the ‘pageofposts.php’ to the correct theme directory then it should appear as an option in the list of templates available for your new page.

    That should help with your understanding of that last line that was confusing, however your final question about slugs requires a different answer – if you want to use a specific template for specific slugs then you’ll need to look into the template hierarchy which is explained at :

    http://codex.wordpress.org/Template_Hierarchy

    That page also includes a diagram explaining how the templates are selected – so for example you can rename a template to match a category name or page title and it should be automatically selected when that category or page is selected :

    The diagram on the link above is useful but here’s another diagram to help clarify :

    http://wpcandy.com/files/2008/04/wp-diagram.jpg

    Anyway you probably don’t need to do this, I only wrote it since you asked specifically about slugs, but you can probably just follow the first part of this answer to specify that your new page uses your new template.