is_single() is intend to work with post types, not categories.
To check for category you should use is_category('programming').
Note that is_category works on category archives, not on single view.
So, if you want to check in the current is a single view and has the category ‘programming’ you need the has_term tag:
if( is_single() && has_term('programming', 'category', get_queried_object()) ) {
include_once ('TEMPLATEPATH/get-messages.php');
exit();
}
See is_single, is_category and has_term on Codex.
Also have a look on how conditional tags works in WP.
Related Posts:
- Is it possible to stop selected plugins from loading on certain template pages?
- Way to force media uploader use custom image size
- Restrict access and display for categories
- Plugin for changing a post’s category based on it’s post date?
- Woocommerce category description as subtitle
- Why am I sometimes getting a 404 error when I try to update a page with Elementor?
- Get subcategories with JSON API plugin
- How to display a category list in a mediawiki like way?
- Template plugin for blog posts? [closed]
- How to show custom static content at top of each category page?
- How to use get_categories() with Event Organiser plugin
- Server-side subscribe by email?
- plugin for wp_list_categories with posts
- Adding a post shortcode to a page template?
- How to correctly detect accessing wp-content/uploads?
- Calling custom plugin class methods from a template
- Create a custom page template inside my wordpress plugin
- Custom Post Type Plugin not loading category template and loading 404 instead
- Display content from custom post type if match to main post category
- How can i list random post from multiple category?
- My Category is too big on the Menu what can i do?
- Getting a List of Categories for Use in a Plugin?
- Not able to open category post [closed]
- WordPress category add image field
- Register Page Template from Plugin
- Easy Digital Download Sub category
- Solutions to repost categories into multisite blogs?
- Assign post format to categories
- Using WP Category Lists Plugin to Dynamically Display Category (PHP)
- Events Plugin that works with existing categories?
- Trouble with editing template for “List category posts” plugin
- Any built-in function to associate a post to category through a plugin?
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- Search for categories
- Redirecting thousands of posts that currently have no category in their permalink when changing permalink structure to include category
- Automatically Assign Author to Category [closed]
- polylang + category/tag custom language link
- WordPress “Categories to tags converter” not working. Pointing to import.php instead
- How do I apply style to each category of a list?
- How to use get_template part in the plugin?
- Redirect to another page using contact form 7? [closed]
- Recent posts per category loop?
- Ambrosite Next/Previous Post Link Plus or WP next_post_link to cycle through top level category
- Default taxonomy template in plugin, override in theme
- Is changing post from category in a large blog a good practice?
- Trying to add a page template for my custom post type from a plugin, but it will not display in the template dropdown unless file is in theme
- How do I create a custom permalink structure for a page template
- check uncategorized category by default
- Plugin create pages and use templates
- Custom form not showing in correct place on page
- Call another page in forms
- How do I show content from a plugin using the template the site is currently working with?
- WooCommerce Hiding A Certain Category From Being Displayed On Single Product
- How to dynamically change spots of text in custom page?
- How can i listing current category and Featured Category post list?
- Add custom PHP and HTML to the_content()
- How to modify the Loop from a plugin (instead of a theme)
- How to get Recent Post From Each Category with Thumbnail?
- Category “same post” retreive and display
- Add a new category for posts
- how to show all posts of each category in pages
- Custom Post Type same name as Category
- Visual composer custom element error
- How to display the category name in the tab and post inside the tab in WordPress?
- What plugin would make this happen? If is the theme
- how can I edit the HTML of yith ajax product filter
- Unset plugins on front-end belonging to specific category
- WordPress Product Detail and catalog
- WordPress Categories as a Grid
- how do i fixe Page Builder on a custom page?
- How to allow editors to only edit certain categories?
- Plugin json page
- Category as Subdomain for One WP Install
- Woocommerce categories displayed on every category and shopping page
- woocommerce product search based only title
- Ajax Load More on Hierarchical Categories
- Sub Categories in drop down menu
- How to differently style pages that display posts of different category in WordPress?
- View more posts of a sub-category
- How to insert category name above post title in a featured pages plugin?
- WordPress Categories from Plugin
- Show all posts of all categories but excluding a category on custom blog page with pagination of my theme
- Is it possible to setup Category wise Subsciption?
- Retrieve post thumbnails
- Synch Custom Post Types (and Custom Fields, Cats, etc.) Between WordPress Sites
- How to add character to content of post?
- Editing “Kahi’s Highlight Used Categories” plugin code – highlighting parent and child category in post page
- WordPress “Categories to tag converter” not working on imported Blogger posts
- wp_insert_post_data filter to set category
- What happened to WP No Category Base?
- Sort Reviews/Ratings by date on Woocommerce
- Make a Custom template for a specific category in wordpress
- woocommerce retriving category name as div class?
- query_vars in plugin when using custom permalinks
- How to pre-set WordPress settings for specific posts?
- Resources for building a custom event page template
- How to provide page_template path in custom plugin using WordPress
- Need a Category List for the category slug
- How can I disable links for categories but keep showing them on my blog in an Elementor Template?
- How to check if the post exists in any of the categories?