{"id":927,"date":"2012-12-14T18:30:15","date_gmt":"2012-12-15T04:30:15","guid":{"rendered":"http:\/\/mymonkeydo.com\/?p=927"},"modified":"2012-12-14T18:30:15","modified_gmt":"2012-12-15T04:30:15","slug":"how-to-use-your-own-template-for-specific-times","status":"publish","type":"post","link":"https:\/\/mymonkeydo.com\/how-to-use-your-own-template-for-specific-times\/","title":{"rendered":"How to use your own template for specific times"},"content":{"rendered":"
There’s a great post on how to get WordPress to use your own template and override the default template.<\/p>\n
The basic code looks like this;<\/p>\n
function my_template() {
\nif (is_category() && get_query_var(‘cat’) == get_cat_id(‘fun’)) {
\ninclude (TEMPLATEPATH . ‘\/category-fun.php’);
\nexit;
\n}
\n}<\/p>\n
add_action(‘template_redirect’, ‘my_template’);<\/p>\n
<\/p>\n
Be sure to use\u00a0STYLESHEETPATH instead of his\u00a0TEMPLATEPATH so that child themes respond to the code properly.<\/p>\n