[Plugin: Code Snippets] Code formatting
-
I have a code snippet I like to use to place a default image for a category when there is not one already on the post. I am having trouble getting it to work in this plugin. Thoughts?
// category-specific post thumbnails function category_specific_post_thumbnails() { if ((function_exists('has_post_thumbnail')) && (has_post_thumbnail())) { the_post_thumbnail('thumbnail'); } else { $category = get_the_category(); //echo '<img src="'. get_bloginfo('template_directory') .'images'. $category[0]->cat_name .'.png">'; } }
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘[Plugin: Code Snippets] Code formatting’ is closed to new replies.