You can use conditionals:
<?php
add_action( 'wp_enqueue_scripts', 'wpse_enqueues' );
function wpse_enqueues() {
// Only enqueue on specified single CPTs
if( is_singular( array( 'anime', 'manga' ) ) ) {
wp_enqueue_style( 'wp-manga-plugin-css', WP_MANGA_URI . 'assets/css/style.css' );
}
}
?>
If you need the CSS on archives as well, that’s another condition:
if( is_singular( array( 'anime', 'manga' ) ) || is_post_type_archive( array( 'anime, 'manga' ) ) ) {
wp_enqueue_style( 'wp-manga-plugin-css', WP_MANGA_URI . 'assets/css/style.css'
}
Related Posts:
- How to laod wp_enqueue_style to another header i created my self
- Tips for using WordPress as a CMS? [closed]
- Adding a Taxonomy Filter to Admin List for a Custom Post Type?
- Custom Post Type Templates from Plugin Folder?
- Implementing a CrunchBase.com Clone using WordPress?
- Custom media upload content for inserting custom post shortcode
- Redesigning Custom Post Type “Add New” page
- How to Remove Certain Screen Options and Meta Boxes from add/edit post type?
- How to share category taxonomy with custom post type (The Event Calendar plugin)
- Is it possible to define a template for a custom post type within a plugin independent of the active theme?
- How to get a variable number of posts per post type on the main loop?
- How do I force wp_enqueue_scripts to load at the END of ?
- WP_query parameters for date range
- Use a plugin to handle custom post types?
- how to include other plugins css files in a shortcode?
- How Do I Use The WordPress Plugin Posts 2 Posts by Scribu?
- Creating a default Custom Post Template that a Theme can override
- How can I dequeue a Plugin Stylesheet?
- How to load different css file for different pages
- Jetpack plugin (ShareDaddy): Prevent share buttons showing on custom post types?
- Getting Custom Post Type content from main-site of a Multisite
- Get info (url) from already enqueued styles
- Custom database or Custom Post Types?
- How to make a list of companies’ information and display them to user, using custom post types and a custom taxonomy?
- Custom comment type maybe?
- Register Custom Post Type from Plugin
- Prevent page slug from interfering with custom post type archive permalink?
- Add .html extension to custom post type taxonomies
- Calling an custom field from theme option at the frontend
- Array to string conversion error when trying to POST multidimensional array
- Hide some portion on single.php base on author
- Creating themes using the one Plugin (Toolkit)
- Displaying image from a repeatable group
- How to add jquery to my custom post type wp plugin
- WordPress list child pages of custom post type
- WordPress custom posttype meta values doesnot save
- Assigning a custom post type to a custom page
- How to add php stylesheet to admin section instead of admin_head hook
- CPT-onomies CPT_TAXONOMY->get_terms extremely slow with 6K posts
- get recent 12 days post then random in wordpress
- making a glossary with wordpress
- WordPress include scripts and style in plugin page
- Create custom fields on a post
- Custom Post type plugin breaking the front page shows dashboard?
- What method should I use for a sidebar widget that reads latest posts?
- Synch Custom Post Types (and Custom Fields, Cats, etc.) Between WordPress Sites
- Insert data in custom table during new post creation
- get_option include in my adsense
- WordPress Custom post type won’t save properly
- Top Contributors Plugin with Custom Post Type
- How can i do custom author list?
- plugin’s script and style enqueing not working on Thesis
- Making a Custom Post Type Publish Loop
- featured image problem with custom post type
- How can I default a new post to being saved?
- WordPress User Frontend Editing Custom Fields
- How to list the categories by custom taxonomy created?
- Is a custom post type considred a plugin?
- Remove base from the custom post type URL [duplicate]
- Is an Office a custom post type [closed]
- Make a magic tag work with Custom Post Types
- Change the behaviour of archive cpt category and single cpt by plugin, not by theme
- A plugin for software reviews site like this one?
- Snippet displaying LearnDash parent course title with lesson title [closed]
- Display Custom Post Type and Custom Taxonomy Data on Front End Using Only a Plugin
- Looking for a plugins for organization portal (Staff, Units, Departments)? [closed]
- WordPress show different custom post type
- Filter custom post type returned from REST api
- Links not opening as they should. Custom WP plugin
- Wrong block appender button showing
- Select posts from list and add them in a new list
- jet engine listing for every single taxonomy in post type [closed]
- How to export post tags from wordpress
- Failed to update a post when I add a taxonomy to it
- How to access the page without registering in wordpress
- CPT template is not being automatically used single post pages
- How to make content as required in custom post type?
- Set the title of a custom post automatically by using info from custom fields?
- public custom posts not showing in my wordpress plugin
- plugin translation *.mo file not getting loaded for custom post
- How to provide page_template path in custom plugin using WordPress
- Create CPT on Ajax Call
- Frontend Enqueued Files in the Backend
- How to add CPT in Elementor pro search template
- how to compare date meta value in jet smart filter Date query?
- My site has only one page, and users access my uploaded mp3 files from there – can I analyze access by song title?
- Tickera missing attendees – No attendees found
- Include theme header and footer in custom plugin
- How to fetch WordPress Gallery Images to a Custom Post Type?
- Disable All In One SEO plugin for custom post type
- How to disallow users to edit other’s posts for a new custom post type?
- Remove H1 title in admin post edit screen
- How to include Font Awesome icons into ‘menu_icon’ from register_post_type() function – wp admin?
- PHP Fatal error: Cannot redeclare distance() when making a new block
- How to check if the post exists in any of the categories?
- How do I know if an archive correspond to a custom post type taxonomy?
- Keep the expansible tree (list of posts) open in the sidebar
- How to Display News in a Timeline with Headline, Category, and Time?
- Load a custom post type template.html from a plugin
- Query Custom Post Types on Available Dates