How to remove TwentyTwelve style while creating child theme?

By | May 2, 2014

It is general process to remove style of parent theme while creating child theme for any WordPress themes.  In the same way, recently I tried to dequeue style of TwentyTwelve WordPress theme.  But it did not work.

After Googling and with lots of trials and errors, I found that the style needs to be deregistered too.

The following code helped me better in creating child theme for TwentyTwelve WordPress theme.

This code has to be written in the functions.php of child theme.  The code works in the following way,

  1. First it dequeues the twentytwelve style.
  2. Then it deregisters the same.
  3. Now We are invoking the same twentytwelve theme style in another id called “twentytwelve-style-2”.
  4. After that, we call our own stylesheet of child theme.

The value “20” in add_action gives priority.  I hope it is useful to some developers.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.