0

How to remove ID's from wp_enqueue_styles ? Check below picture

Noted in Green color

4
  • Why do you want to remove them?
    – Cedon
    May 24 '17 at 16:44
  • No reason technically but i want to make code less simple wp theme and it feel not good as well
    – Raha MK
    May 24 '17 at 16:47
  • You're going to have to write a filter in your functions.php file for it that will run with each page load.
    – Cedon
    May 24 '17 at 16:48
  • Can't get you or can't understand
    – Raha MK
    May 24 '17 at 16:53
2

Use the style_loader_tag filter:

add_filter( 'style_loader_tag', function ( $tag, $handle ) {
    return str_replace( " id='$handle-css'", '', $tag );
}, 10, 2 );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.