You don’t need multiple functions. Use an array
with in_category
to pass multiple slugs:
if( in_category( array( 'ms-conversations', 'artist-of-the-month' ) ) ){
// do something
}
Related Posts:
- Attach parent category template to all subcategories
- Image loading function not working on archive.php template
- Display ACF category image on archive and single template files
- Display random categories on the front page (Finding and Editing Theme Functions)
- How to redirect to post if search results only returns one post
- How to override admin-bar style
- How to add classes to images based on their categories?
- current_cat_ancestor Alternatives
- wp_get_attachment_image returns different image size
- Passing variables to templates (alternatives to globalizing variables)
- Load post with a different template?
- Add body class of category parent
- How to customize search result page title?
- How to fix a theme with page.php Default Template that accidentally deleted?
- Changing a function in function.php to a shortcode – for listing categories of only a certain post type
- WordPress Change Post Templates,but not drop down, but Image selection
- Php string not working in WordPress Functions.php (trying to fetch 1st category for each blog that post appears in the sidebar)
- Add class to Categories Widget
- How to Acheive the custom woocommerce category template
- How to add a rel attribute to images that contains their categories?
- How to set child post categories to parent post categories when updating parent post?
- Using locate-template & shortcodes doesn’t appear to work
- Assign category using custom field?
- Can I use require() function in a template file?
- How to set global variables in template page?
- Why isn’t is_page_template() adding a body class?
- Dequeue script in template isn’t working
- How To Get WordPress Categories Link List?
- Query children and parent title
- Help to resolve Syntax error, unexpected ‘endwhile’ (T_ENDWHILE) [closed]
- Adjust which tempalte a page uses with a function?
- How to change menu icon which is overriden (i.e. by WooCommerce) [closed]
- Use template for posts with a particular category grandparent
- Changing post category from dropdown
- Manipulate Output of wp_list_something: select menu instead of li’s
- Make “sidebar template” the default template for new pages
- Make Categories a Dropdown Menu in Media Library
- Retrieve post modified date for specific post by post ID
- Programmatically Create Category and sub Category
- Twenty Eleven Child theme error when attempting to use a rewritten function
- Add class or ID to any WordPress function
- How to remove howdy dropdown menu content
- exclude a category from a search on a specific page
- How to include local menu based on page id?
- Get the category name outside of the loop in category.php
- How to create function from code?
- Is it possible to change any of the HTML/URL returned from the_category()
- Display Password Protected external RSS in wordpress template
- How to extract the variables out from “add_shortcode” function?
- Default Gallery Edit/Template Editable?
- Custom HTML in specific category single page and its descendant categories
- How to enable template page only for a post id page
- Possible to display shortcode based on the category?
- Selective Product Category for Carousel
- How to change login labels
- Unset Category if other Category is unset during post transition
- Modify a function without editing template
- Retrieve tags data in post body
- Select pages by category
- Fatal error: Cannot redeclare when switching themes
- Show Primary Category first when I display post categories
- How do I hide or remove ‘Category’ from wordpress breadcrumbs
- Ordering posts by publish date not working?
- Functions For Calling Specific Elements
- Full page template function
- Categories as main menu items and subcategories as nested lists
- Get category URL for current post
- Need help “sanitizing” a custom function that pulls category slug into body class
- allow only one post in specific category
- wordpress use single ajax in place of multiple ajax requests in a smarter way
- Add Element as a Filter to the_content
- How to obtain the recent posts without their content in an efficient way?
- Setting a default text for excerpts of a particular category
- Running script based on Category
- Remove a category from a post when saving a new post
- How to fix get_the_category function returning incorrect slug?
- Return category name with & Ampersand doesnt work
- I have problems with loading javascripts
- Pass variable from action back to template
- Need print logo without any ID & class
- Define PHP variable from a seperate API if statement
- Allowed memory size of 33554432 bytes exhausted (tried to allocate 9967617 bytes) in …\wp-includes\functions.php
- Best way to handle lack of titles in microblogging
- attachment page template? only show attachments for current post?
- Run a jquery script on on a certain template page
- Access category within rss2_head hook?
- issue with if/elseif in_array inside foreach loop display only one post
- Randomizing wp_tag_cloud() in child theme
- add_filter to specific WooCommerce Category
- How to rewrite wordpress search to work on specific category
- How to include any template using Shortcode fuction?
- Add a field into a shortcode of an extension
- Exclude Category ID in function
- Problem with calling custom function in a foreach loop
- Using functions.php to include code that’s processed inline
- “All posts” in the category widget
- How to make a new function that includes a template
- Get Attachment Category Name
- How to use wp_list_categories with plugin category?
- Show admin page, only if function is being used