Forums

Creating a special category php file (2 posts)

  1. ravenzachary
    Member
    Posted 3 years ago #

    Hello there! I am tying to create a special view for a post category that looks and acts differently from other post categories.

    I want to create a php file in the theme, such as specialcategory.php, which basically acts as a customized index.php+archive.php for displaying posts of that category only. I know how to make only that category appear on page, just not for the special page to be recognized by the WordPress.

    I then want http://www.example.com/specialcategory/ to go right to that page and for http://www.example.com/category/specialcategory/ to auto redirect to the special page, in case the category name gets clicked. I can probably do that last part with an .htaccess entry, but I don't know how to make specialcategory.php in my theme directory actually get loaded by http://www.example.com/specialcategory/ and function like a theme php file.

    Any quick tips? Thank you!

  2. Eric Amundson
    Member
    Posted 3 years ago #

    Hey Ravenzachary,

    May want to check out:

    http://codex.wordpress.org/Category_Templates

    It'll show you how to create a category-specific page that is recognized by WordPress.

    Regarding having it show without the /category base, I'm not positive how you'd do that. I'm sure you could setup a redirect of sorts, but I'm sure someone else has an answer for you.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.