Look at http://codex.wordpress.org/Function_Reference/in_category
Example:
<?php if ( in_category('rabbis-weekly-commentary') ) : ?>
<div id="inner_header">
<img src="http://www.ifcj.ca/ifcj_ca/images/elements/commentary_header.gif" border="0">
...
<?php elseif ( in_category('yaels-weekly-commentary') ) : ?>
<div id="inner_header">
<img src="http://www.ifcj.ca/ifcj_ca/images/elements/commentary_header.gif" border="0">
Related Posts:
- How do I get the category URL from get_the_category?
- Create single.php for specific category by category id
- How to get category id in single.php wordpress?
- in_category() works in single.php but not in page.php?
- functions.php conditional tag – only show in single.php?
- previous/next_post_link in the same sub-category?
- How do I toggle pagination on/off in search results and category listings via a link?
- Send to different single pages by category when multiple categories exist
- How to make the link to the category for a post go to corresponding page number in archive?
- How to conditionally hide author name on Single.php if category is “news”, otherwise if category is something else display author name?
- Conditional IF current cat is the smallest/last/end child cat THEN
- How do I display something on a particular category page?
- Exclude a category from a query that includes its parent category
- Single.php Category Post Count
- Get next post in same category not working WP 4.7.4
- Simple way to style posts of a single category differently in the loop and in single
- Home Page Template – Specific Category
- How to get nav to show current_page_parent class when on regular post (not blog), differentiated by category
- How can I check which archive has referred the single? [closed]
- Displaying links to all posts of the same category on the post page
- Ignore the Ad on Specific Categories
- custom wp_list_categories in single.php
- loop in single.php of the same category
- Display Some text in some specific category not all category
- When category name and title are the same … WP will select archive.php instead of single.php
- Using template file for single post in sub-directory multisite
- Conditional statement: if is_category, append at the end of page
- Code to display category-specific single.php is overriding normal single.php, too
- Display Referring Category on single post?
- Conditional statements based on custom meta value in category archives
- Modify / Rewrite single template url structure
- How do I get a single page navigation depending on the previous page?
- Weird html output of single_cat_title – is not inside of the html element?
- Can I set a default featured image for a category?
- What’s the URL for a category archive?
- Weird behaviour when adding terms/term_taxonomies programmatically
- How can I get category ID by category name?
- Randomise results from a category page?
- Is there a way to have duplicate category slugs?
- Multiple level category drop-down
- Adding Custom User Profile data based upon Categories
- Order posts by category name
- How can I make wp_list_categories output li with category-slug as class, for its children?
- Show post only if match all categories
- Output link to category from WP_Query loop of woocommerce products
- Password protect a specific category page/post
- If in category to be inside of a function
- How to exclude posts from a category when using this particular format
- Different excerpt styles per category, but chronological
- Show only one category
- Pagination Not Working on Category.php page
- Filter Home Page Posts in Buddypress [closed]
- Broken category pagination
- Additional featured post on first page
- Color different for the current category
- Displaying a full post instead of a slug per category?
- one category template for multiple categories
- How can I define a custom archive for childs of a specific category?
- Category shows only top level child categories
- List categories with custom code
- If in_category not working for multiple single.php pages
- Page display certain Category Posts
- REST API: Display Category names in JSON?
- List posts in alphabetical order
- Where is the category of a post stored?
- Categories list loop – add separator every 3 categories [closed]
- Add image to each podcast series (or category) in headless WordPress instance [closed]
- How to define multi categories posts number
- Trying to get variables in hacked category dropdown
- how to separate categories in loop.php?
- How can i remove the posts category class names from body_class
- Different Category Headers using in_category and elseif
- WordPress Show Parent Category Description for Sub-categories
- why get_the_post_thumbnail( the_ID()) echos extra post id
- How to fetch the highest category in the hierachry for a specific post?
- Woocommerce search form with category select
- How to not display subcategories in Recent Posts widget area?
- Getting the Most Recent Posts from Multiple Categories
- Add Date & Author Meta to Category Archive Page
- A dropdown with checklist
- How to store category and tags separatly on wordpress?
- wp_delete_term or wp_delete_category?
- Get post content intro text on category.php?
- Unable to browser posts in categories
- wp_get_post_categories not work currently on loop.php
- Inline If statement to echo CSS [closed]
- Get category base permalink
- Template category.php with page (no posts)
- WooCommerce showing active product categories on single product page
- how to exclude specific category types (uncategorized) from blog page?
- How to set featured image as background for a specific category?
- Confused about category.php template – not working
- Adding relevant categories to related post
- How to assign image on specified category and not show the image on other categories
- How can I add a Categories page link to a menu? [closed]
- Way to show content of a post, but if exceeds character limit revert to excerpt?
- get posts from 2 categories. (2 posts)
- Converting Categories (with ACF fields) to custom taxonomies
- Why does my WordPress index has a category?
- How to make /category/ URL load properly instead of 404 error?