| name | language | licence |
|---|---|---|
| truncate a wordpress post - PHP - Snipplr | PHP | BSD |
| CUSTOM TEMPLATES FOR POSTS IN WORDPRESS | PHP | BSD |
| SHOW DIFFERENT AMOUNT OF POSTS ON WORDPRESS HOME PAGE THAN OTHER PAGES | PHP | BSD |
| ANAGE MULTIPLE WORDPRESS SITES WITH ONE DATABASE AND ONE CODE BASE | PHP | BSD |
| WORDPRESS QUERY POSTS OF CERTAIN CUSTOM FIELD VALUES | PHP | BSD |
| WORDPRESS LOAD JQUERY | PHP | BSD |
| WORDPRESS GET CONTENT | PHP | BSD |
| WORDPRESS: LATEST POSTS FROM CATEGORY | PHP | BSD |
< 1 2 3 4 5 6 7 8 9 >
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)