This is more of a CSS question. However, if you create your icon as CSS sprite, you just shift between versions of it in your CSS. Something like:
#toplevel_page_my_item .wp-menu-image {
background: url('images/sprite.png') no-repeat 0 8px !important;
}
#toplevel_page_my_item:hover .wp-menu-image,
#toplevel_my_item.wp-has-current-submenu .wp-menu-image {
background-position: 0 -24px !important;
}
Related Posts:
- Display a query with multiple post types and same relationship on a single page
- WordPress Custom Post Types with a page as a parent?
- List page for custom post type?
- Limit Authors to their Own Posts on front-end excluding admins
- How to redirect all pages of a custom post type [duplicate]
- Show ACF field from custom taxonomy and display on the single template
- Conditional to modify query results
- WP_Query is printing out only one post when posts_per_page is set to multiple
- WP Query to displaying date and posts for that date?
- Return array of categories to php function for current post
- Create a random unique 6 digit number as custom field for custom post type
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- Get rewrite slug of custom post type in template
- Get Post Primary Category
- Can’t get order_by meta_value_num to work properly
- Create custom post type on successful woocommerce order [closed]
- Taxonomy Archive: Display only one post per term from separate custom taxonomy
- How to make sure content doesn’t display if selection is empty
- How to customize a permalink (URL) structure?
- How to make a field appear only if a post meta field has a defined value?
- WP_Query to select custom post type with Advanced Custom Fields (ACF) date
- I’d like to cycle through existing posts in a post type, showing one per day ordered by title, and starting over when the last is reached
- 404 error when navigating to a taxonomy page with Cyrillic, what’s wrong?
- Redirect 404 page with ID in slug to associated page with same ID in slug
- WordPress wrapped added a span tag to every single p tag
- How to Create Columns with WordPress and CPTUI display page ?
- How can I move (or create another) publish button?
- Meta-Boxes for CustomPostType cause PHP Errors and Notices in “Add New” view
- Cant get paginations on single.php to work with my custom post types
- Trying to Create a PHP Variable for post_type that can be referenced Site Wide
- WP_Query Custom Post Type if Category ID Equals
- Not sure why this template for custom post type posts isn’t displaying anything. What’s missing?
- Control content before and after custom post type loop
- How to use a variable as a function name?
- Assigning a category to a custom post type in WordPress
- Different options per post type in WP_Query
- Show message when query has no posts
- How do I create a new post upon registration with the users first and last name as title
- Query entries from custom post type in an ACF flexible content field
- Creating a non-hierarchical Taxonomy that behaves like categories
- Shortcode is displaying the content on top of the page [duplicate]
- get_terms() returns Trying to get property of non-object error for custom taxonomy
- Custom Ratings for Theme, Proper way to Refactor Code and Clean up Template File
- How to set the mainpage of a custom post type?
- custom post type by author – wp job manager
- Using Wp_Query, Json to add Highcharts series data
- Template code to split a post and print a custom field?
- Accessing a protected property of a post
- Displaying One Custom Post Type’s Content On Single Post of Another Custom Post Type
- Let users upload image(s) to the post from front end
- Foreach loop returning more than one item when querying taxonomy
- Compare Two Custom Post Types Using The Same Custom Taxonomy
- Using page title as a link to term archive
- How to display custom post type only on a certain page?
- Setup page template array in a custom post type
- Need help with simple “if statement” checks to output particlular CPT data depending on what client uploads/fills out
- How do I ensure that post_type and Taxonomy use the same slug?
- Custom post type page with parameter
- pagination for custom post type archive page
- Change Dropdown jQuery to show/hide but with default place holder that shows all
- Display All Courses in Course Archive Page
- What is the best way to set the post category (Custom Post Type) automatically based on the one of the tags assigned to the post?
- Custom fields array to display it monthly
- How to show the post which checkbox is not selected
- Archive page for WordPress Custom Post Type doesn’t show pagination from paginate_links()
- Is it possible to get the specific content on the search page?
- Get all post under custom post type grouped by custom filed value in custom taxonomy
- Check that a slug is present in the get_terms request
- open custom post type in popup window instead of page
- Get category name of custom post type
- pagination problem listing custom post types of taxonomy in wordpress
- Set a template on a custom post in the plugin
- Persist meta box choices throughout all posts of same post type
- Do not show child pages within a file page
- Search result based on URL
- Custom search for a custom post type in WordPress
- How to mix 2 kinds of post types
- CPT: execute code after load if parameter is set
- Create unordered list from custom field type entires separated by a comma
- Strange behavior on WP_query
- Show custom taxonomy not in submenu
- Loop carousel slider in wordpress
- How to Fix WordPress 500 Internal server error due to custom post type
- Custom Post save causes 500 error
- Custom post tag images not displaying with ACF
- Function not pulling image or text from custom post type
- Exclude Custom Post Type from shared Custom Taxonomy
- WordPress Custom Post Type and sort by Tags
- Trying to combine multiple WordPress queries
- Looping taxonomy in taxonomy?
- Permalink of Custom Post Type
- posting twice from an array?
- Stop header code from showing in category page?
- Pagination not working on homepage
- Custom Loop for custom post type. Compare by meta_value?
- Order custom post type is beign ignored
- How do I filter a custom post type loop by a field?
- How to manage wordpress knowledge base/wiki/posts collections
- Getting ACF relationship field information
- How to I add count of custom posts listed in a post as a prefix to its title