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 add classes to images based on their categories?
- How to customize search result page title?
- Changing a function in function.php to a shortcode – for listing categories of only a certain post type
- 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?
- Assign category using custom field?
- Can I use require() function in a template file?
- How to set global variables in template page?
- Dequeue script in template isn’t working
- 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
- Make “sidebar template” the default template for new pages
- Retrieve post modified date for specific post by post ID
- 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?
- 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
- Modify a function without editing template
- Select pages by category
- 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
- I have problems with loading javascripts
- Need print logo without any ID & class
- Define PHP variable from a seperate API if statement
- Best way to handle lack of titles in microblogging
- attachment page template? only show attachments for current post?
- 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
- Add a field into a shortcode of an extension
- Exclude Category ID in function
- How to make a new function that includes a template
- How to use wp_list_categories with plugin category?
- Show admin page, only if function is being used
- Overwriting TwentyTwelve template file with child theme template, but lower in the hierarchy
- Get slug of current category in functions.php
- Render page with specific id from functions.php
- Display a list of random terms from custom taxonomy with shortcode
- the_date() and the_time() functions display actual date an time instead of published date and time
- Load templates, pass arguments, and render output from functions.php
- Changing the HTML of notices in WooCommerce [closed]
- Remove the ‘category’ url for one category type
- How do i tweak my wp Post title base on category of the post
- Warning and fatal error
- how to remove a tag in the_category function
- Menu and category highlighting for a single post
- More than one search results page template for two searches on site
- WordPress function with attribute pass to template
- Graphic before title – Specific Category
- Fatal error: Call to undefined function. Underscore me
- How to debug function file causing white screen
- Newest comments first not working
- Retrieve a custom form field modified by a filter
- us states dropdown function and echo in theme template files
- How to pass a variable from a template page to the child theme functions.php
- Function the_content
- How To Get WordPress Categories Last Update Date?
- Allow the access over wp-login.php
- update_usermeta don’t work
- Fatal error after changes to functions.php, even with original file
- How can i hide content if not friend in Buddypress? [closed]
- Which template file to edit to edit homepage in Mystile [closed]
- Make a PHP file with a function
- Creating mixture of shortcodes to use in the visual/text editor
- Removing all Category pages with one exception
- My website is generating weired url parameters of paginated pages
- Get category of post inside save_post hook
- How to store page-{id}.php templates in custom folder