Have a look at in_category() in the codex. You would either insert this into your theme within the post loop or create a function in functions.php
that’ll insert the image and text you want when a post from that category is displayed on screen.
Here’s a test bit of code I put together that works well in the Twenty Fourteen theme. I put it inside the loop in content.php
as a quick test.
if (in_category(1)) {
the_title();
echo "<p style="font-size:80px">Category 1 Test</p>";
}
Related Posts:
- Block multiple categories from Blog
- Gutenberg editor add a custom category as wrapper for custom blocks
- How can I hide a category from Contributors in the edit/add new post screen?
- WordPress Multiple Category Search
- 404 Error On Category and Tags Pages
- Decreasing the Memory Consumption of a WordPress Site?
- Multiple Domain Names – One WP Install (non-Multisite) – Default Each Domain name to Category Archive
- How can I select a primary category?
- how to use a different domain/subdomain for authors/catagories on single site?
- Deleting default category in wordpress
- Delete a specific category when deleting a user
- How to list child categories in custom category template?
- Trash bin for categories
- View category in the preview of Theme Customizer
- One WordPress Install, Two Categories. Each Category Gets a Domain
- Create single.php for specific category by category id
- Show posts of one category only with Custom Taxonomy on single.php
- Save metabox checkboxes values to custom content type
- Select category in custom query
- Remove “Parent” Selection When Adding/Editing Categories?
- Order Taxonomy Term by date created
- Apply custom category template to subcategories
- Format Brand value in Category view [closed]
- Add custom taxonomy under the category title
- How to show in search results posts with a particular tag in a particular category?
- Remove ‘rel’ attributes from the_category() output
- Multiple menu items highlighted
- How to view WordPress’ default category IDs?
- Multiple Category Search
- How do I add a function on a specific post category?
- How to create button to direct to certain category
- How to customize category template?
- Category-slug.php not being used
- How would I go about adding custom header images per category?
- WordPress Genesis not excluding category from blog
- Display posts separated by Category in Author’s page
- Filtering *out* a taxonomy from the admin post list
- How to rewrite the post URL according to the category?
- How to build a simple nav system of custom post type categories and its posts?
- how to “not” display new posts with a specific category on the main page?
- Display thumbnails for certain category posts
- Is it possible to remove from default category widget?
- How to customize my category pages
- How can I display tags as categories?
- Display content from a specific category using cat ID not working
- Different CSS class by category
- Wrong category nice name is displayed on archive page
- How can i change what one category displays?
- Remove any product that is featured from regular display loop [WooCommerce]
- Two Sections on Woocommerce Catergory Page [closed]
- How to let the user create a selection of categories via the backend
- Display subcategories in dropdown
- Theme for subcategories
- Hide a category of posts from main blog, and only show in category view
- Use blog as base for tags and categories
- Custom css per category and per single post belong in each category
- Restrict CSS on one page
- How to hide widget from certain category
- custom query for both category and pages using global $wpdb;
- I would like to feature a tip on the homepage
- How to add icon over specific thumb
- Rebuilding a Site: How to Show Several Category Posts in Woo Framework Theme?
- Problem with Custom Post Type Categories
- SQL query to get posts from multiple categories but not in a category
- wp_delete_term or wp_delete_category?
- Select posts that match multiple category names, must match all categories listed
- Custom Portfolio Page
- Last x Posted Categories?
- show only sub categories if available?
- How to add meta description, keywords, custom title to a category template
- separate posts to have (kind of) 2 blogs?
- Category post count is not correct
- How to create category filter on a blog like on the site below?
- Blog page with posts from specific categories
- Is it possible to set up blog categories without changing permalink structure
- problem with filter of custom portfolio categories
- Deleted categories still listed until additional page refresh
- Redirect Category pages to blog page with query string
- How can I make a category function as a page?
- Category custom template is not showing correct posts
- Search Replace Database ONLY for posts of certain category?
- Filter custom taxonomy posts via AJAX
- Need help to structure our a complex hierarchy
- Read More showing only on first post
- Inserting categories as a hierarchical terms from frontend form
- Show posts from all categories
- How to add a post with new Taxonomy without assigning to default category?
- Getting page/category content to show up in my custom page template
- List post categories that link to a page showing those posts
- How do you add Author and date Published on Category Pages?
- If it is a top level category show children otherwise show sibling categories
- Own Custom Tags/Category page ( posts)
- How to create default categories in new installs?
- Pages, Categories, and working with someone else’s code
- display certain category on custom template page
- Multiple Categories under one URL, where ‘Front Page’ is used already
- Restricting certain blog posts by date?
- why is the delete option missing from just one category?
- How to prevent page re-sizing for mobile browsers [closed]
- Woocommerce custom taxonomy order