Tag Archives: category

category or taxonomy image

Snippet: Add Category, Tag or Taxonomy Picture

WordPress core support two entities for contents one is called post and other is taxonomy. Most of you would think it should be post and pages. But, thats not true. post, pages, attachments and revisions are inherited from post. Taxonomy is way of grouping posts. Well known built-in examples are categories, tags and links. WordPress provided media gallery attach images and photos to your posts but how about if you want to attach images to your categories? May be you have custom taxonomy e.g. Location taxonomy for an Event post type and you want to add an icon or photo of the location to each location you add. This snippet will allow you to add a picture to all of your taxonomies or the ones you specify.

Snippet: Disable Category, Author, Date and Tag archives

Add following snippet to “functions.php” Snippet Result Snippet will redirect the category, date, tag and author links to “404 not found” page.

Snippet: Add default content to posts in a specific category

Add following snippet to “functions.php” Snippet

Snippet: Get list of all subcategories

Add following snippet to “functions.php” Usage Snippet Result This function returns a formatted unordered list of non-empty sub categories of specified category.