| name | language | licence |
|---|---|---|
| WordPress custom post listing | PHP | BSD |
| Export WordPress tables | PHP | BSD |
| Untitled Snippet | Other | |
| Colored | CSS | Other |
| SHOW WORDPRESS POST ATTACHMENTS | PHP | BSD |
| WORDPRESS GET URL | PHP | BSD |
| truncate a wordpress post - PHP - Snipplr | PHP | BSD |
| CUSTOM TEMPLATES FOR POSTS IN WORDPRESS | PHP | BSD |
< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 >
language: PHP
licence: BSD
CUSTOM TEMPLATES FOR POSTS IN WORDPRESS
options: view full snippet • send to code collector
function custom_template($template) {
global $wp_query;
$cats = get_the_category($wp_query->post->ID);
$cat = $cats[0];
if (file_exists(TEMPLATEPATH."/category-".$cat->cat_ID.'.php')) {
return TEMPLATEPATH."/category-".$cat->cat_ID.'.php';
}
return $template;
}
add_filter('single_template', 'custom_template');



library
buttons (3)
wp (93)