/ Published in: PHP
This is helpful if you want to create a "Page" that displays specific "Categories" in wordpress.
- Duplicate your themes "page.php"
- Rename it to something more specific "page_mycategory.php"
- Edit that file with the code below.
- In your Wordpress admin, when editing a page look under the "attributes" panel and select your new page from the "templates"
- // code for your custom page.php file. Put this near the top:
- Template Name: MyCategory Page
- // then to make it display specific categories put this code just above the area that says something like <?php if (have_posts().....
- <?php query_posts('cat=5'); ?>
You need to login to post a comment.