Wordpress page-template: page with posts in a category

With wp-page_category template you can customize your Wordpress adding a page template with a typical page followed by the index of posts in a specific category (look at an example).

  1. Open the page-template Page with category and save it from your browser (File > Save page as…).
  2. Rename the file wp-page_category.txt in wp-page_category.php.
  3. Open the template Navigate posts and save it from your browser (File > Save page as…).
  4. Rename the file navigate_posts.txt in navigate_posts.php.
  5. Using an free software ftp client (like Filezilla) copy both the files wp-page_category.php and navigate_posts.php into your wp-content/themes/<your theme folder>/.
  6. Login at your website and write a new page.
  7. Select the Page with category template as page-template.
  8. Create a custom field with displayed_categories as Key and the numeric id of the category you want to display as Value.
  9. Publish the page.
  10. Visit the page you have just published.

License

©2008 by Lorenzo De Tomasi. Copyleft/Some rights reserved. The php code has been released under a Gnu/Gpl 3.0 license.

Future improvements

  • Make the <!--more--> work. [Can you help to understand the problem? Thanks]
  • Set the number of post listed for each page, using pagination buttons. If no value is set, display the default number of posts.
  • Display more than one category at time (for example books and dvds), using comma separated numeric category-ids (131, 12, 36).
  • Check if displayed_categories is set.
  • Check if categories exist.

Tags: , , ,

Leave a Reply

CategoriesCategorie

Upcoming eventsProssimi eventi

  • No events.

SubscriptionAbbonamento

Ricevi gli articoli di Isotype via e-mail, attraverso il servizio fornito da FeedBurner.

ValidationsStandard

Valid XHTML 1.0 Transitional

Listen to Radio popolare RomaAscolta Radio popolare Roma

Da oggi Roma si sente meglio. Radio popolare Roma 103.3. Vede. Sente. Dice. Diretta 0682003666. Abbonamenti 0689929141 Abbonati online Ascolta