With CSS: If your theme uses post_class()
on a containing element, you can target that element with the class .category-songs
to control styling.
With a template filter: add a filter to single_template
and check the assigned categories for your songs
category, and use the template songs-single.php
if that category is found:
function wpse_check_single_categories( $template="" ){
$categories = get_the_category();
foreach( $categories as $cat ):
if( $cat->name == 'songs' ):
$template = locate_template( array( "songs-single.php", $template ), false );
endif;
endforeach;
return $template;
}
add_filter( 'single_template', 'wpse_check_single_categories' );
Related Posts:
- How to add shortcode tags in single.php [closed]
- Hide Certain Tags on Single Post Page
- WordPress More tag doesn’t work on Single post
- How to detect single.php (but not single-portfolio.php)?
- Using single.php from plugin folder instead of default template folder
- Related Posts by Multiple Tags?
- Verify if tag is used on posts
- HTML code in Custom field
- How to have different content in the loop and single
- Single.php Active Category Class
- How to display post tags
- get_terms parent for current product only
- Does an action fire when adding a tag via the “Tags” meta box?
- Disable single post page
- how to know if the post has pagination () or not
- Remove arrows from previous and next link
- Filter Posts By Tag
- “next_posts_link” and “previous_posts_link” display me NOTHING
- WordPress post tag & custom field
- WP Query related posts by current page Tag ID
- How to disable single post view in wp
- Custom Post Templates
- Add Post Tags to Body Class
- How to prevent WordPress from updating the modified time?
- WP Query – duplicated posts once including tags in search results
- wp_tag_cloud() and the_taxonomies() work but not the_tag()
- Can’t get the_content of the parent page from its single post?
- Show all posts in sidebar in single.php
- Prepend or add an Image to the content of a Post
- How to show single post page as home page
- Display posts with tag that matches current post title
- Display all posts that were published before full post on single.php
- Using permalinks, category slugs, and tag slugs
- Print all the tags from a custom post type Please
- Add multiple tags to multiple posts
- Add Read More Tag to a post content (Single.php)
- WP_Query: Mixing category__in and tag__in together
- If in_category not working for multiple single.php pages
- How to add tags (custom taxonomy) to post class css?
- How can I hide tags on a child-category page, if that tag has not been used?
- Single.php – Get Current Parent Category
- How to get a post’s content? [closed]
- How Do I Get My Post Tags to Alphabetize?
- WordPress query_posts by tag doesn’t work anymore(?)
- Thumbnail Image to go in the post aswell
- Displaying posts that belong to a specific author
- Multiple comment forms on a single page
- Display related post by tag name of current post
- How to remove specific tag from multiple posts?
- Single Post in Tab/Slider
- Extracting relevant tags associated with that particular single post only
- See if a post has a specified tag
- How to get post with associated categories and tags names instead of ids with rest api?
- Does WP automatically tag posts into the archive?
- Changing Post Tag Color Based On Post Count
- How to compare post tags?
- Would a “hub” page work better as a page or a post?
- Add post tags to previously created custom post type
- Changing wp_link_pages() to “Next Page” and “Previous Page” buttons?
- Attachment image single page
- Short link to read complete post
- Delete all Tag Links from Posts
- Nest Next and Previous in a href with class that has a background image
- Making a wordpress page print friendly
- WordPress single.php different layouts projects / posts
- How do I keep raw HTML in my RSS feed and not lose my paragraph breaks?
- How to Rearrange WordPress Tags list on frontend using Shortcode with specific order?
- Can I show category name in url for only one of my categories?
- how to add tags to post in the Loop?
- Is there a way to categorize a list posts all at once?
- How to get tags when using publish_post
- Css and function issue on author archive page
- WP posts using index.php instead of single.php
- Top tags with minimum number of posts
- Single post shows post three times
- How to count posts in tags within time limit
- Sync All Post Type Tag
- getting custom post by tag
- Replace Tag Keyword With Link Within Post Content
- Excluding tag Link from html tags in Post content
- How do I check if a post is password protected?
- Can I Paginate Post after every 25 tag?
- Show all posts from the tags without having to set all of them
- Pagination for single post
- Get the category of post
- List posts of assigned categories in list of all categories on single.php
- Is possible to do this from function.php
- Custom Single Post Type not referring to single-post-type.php File
- Thumbnail With Next/Prev Links Not Showing Next Post?
- Add tags to post before it’s created
- Single post page from static home not working
- Get current post’s child page?
- Output posts with same name as tags?
- How can I count articles retrieved by tags
- Should new posts already have tags?
- 1 post, 2 templates
- retrieve post slug by post_tags taxonomy
- Insert Shortcode exactly at the end of the content
- how show post date for specific post?
- Show Next/Previous without Link