Custom filename for category template
-
Hello,
I am trying to do something I think is quite simple but I can’t for the life of me find how to do it.
I am using WP mainly as a CMS and news portal. However, I also have a true “blog” subsection (defined as a special WP article category for journal-like entries, let’s say ID = 6). It appears as a separate tab in my menu.
I have a special template file for it and I know that, using the hierarchy, I can just invoke it through category-6.php.
Only it’s not very obvious to my visitors and I would like them to get to this page through a special template file called blog.php (for instance) and not category-6.php. Redirects wouldn’t do the thing as I would like the users to
– see domain.tld/blog.php in their browser when they’re in the category
– see domain.tld/blog.php as a clear link in the menu (I’m using a straightforward HTML link). But of course, if I do that, WP can’t find the file, since it’s not looking in its own directory but in the real domain root.How can I get it to understand where to look? Can I register a custom-named file in a template to achieve this result and how? I would really like to obfuscate the “category-ID.php” filename everywhere.
With my thanks!
- The topic ‘Custom filename for category template’ is closed to new replies.