Title: HTML Class
Last modified: August 21, 2016

---

# HTML Class

 *  Resolved [pakpenyo](https://wordpress.org/support/users/pakpenyo/)
 * (@pakpenyo)
 * [11 years, 12 months ago](https://wordpress.org/support/topic/html-class/)
 * Hi
 * Thanks a lot for plugin.
 * I know the plugin is add class to body. But i want to know if it’s possible to
   html class instead the body class? For example, use html5-boilerplate head tag
   when using desktop, and use mobile-boilerplate head tag when using mobile.
 * Thanks again and really sorry about my english.
 * [https://wordpress.org/plugins/mobble/](https://wordpress.org/plugins/mobble/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Aaron T. Grogg](https://wordpress.org/support/users/aarontgrogg/)
 * (@aarontgrogg)
 * [11 years, 12 months ago](https://wordpress.org/support/topic/html-class/#post-4967418)
 * Hello, pakpenyo.
 * This _would_ be possible, but is currently not set-up to work this way.
 * Perhaps in a future update I can try adding this option to a config page.
 * Thanks for the idea,
    Atg
 *  Plugin Author [Scott (@scottsweb)](https://wordpress.org/support/users/scottsweb/)
 * (@scottsweb)
 * [11 years, 12 months ago](https://wordpress.org/support/topic/html-class/#post-4967434)
 * This would actually be very easy to do. In your themes header.php you would need
   to add something like:
 * `<html class="<?php echo mobble_body_class(); ?>">`
 * Enjoy
 *  Thread Starter [pakpenyo](https://wordpress.org/support/users/pakpenyo/)
 * (@pakpenyo)
 * [11 years, 12 months ago](https://wordpress.org/support/topic/html-class/#post-4967458)
 * [@aaron](https://wordpress.org/support/users/aaron/),
    I use the plugin without
   config page. I’ve done implement this plugin to my theme function (using roots
   framework with custom css, not bootstrap).
 * [@scott](https://wordpress.org/support/users/scott/),
    I have not try it but 
   i think it will produce duplicate class between html and body.
 *  Plugin Author [Scott (@scottsweb)](https://wordpress.org/support/users/scottsweb/)
 * (@scottsweb)
 * [11 years, 12 months ago](https://wordpress.org/support/topic/html-class/#post-4967461)
 * It won’t duplicate the classes providing the setting in the theme options remains
   unchecked.
 *  Thread Starter [pakpenyo](https://wordpress.org/support/users/pakpenyo/)
 * (@pakpenyo)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/html-class/#post-4967500)
 * It’s not working scott.
 * only Array at html class. From wp_debug:
 *     ```
       Array to string conversion
       Missing argument 1 for mobble_body_class()
       ```
   
 * head.php
    `<html class="no-js <?php echo mobble_body_class(); ?>" <?php language_attributes();?
   >>`
 *  Plugin Author [Scott (@scottsweb)](https://wordpress.org/support/users/scottsweb/)
 * (@scottsweb)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/html-class/#post-4967503)
 * O yes. Apologies. Try this instead then:
 * Add the following to your theme functions.php file:
 *     ```
       if ( function_exists('mobble_body_class') ) { 
   
          function mobble_html_class() {
              $array = mobble_body_class();
              return implode( " ", $array);
          }
       }
       ```
   
 * Then on in your head.php:
 *     ```
       <html class="no-js <?php if ( function_exists('mobble_html_class') ) { echo mobble_html_class(); } ?>" <?php language_attributes(); ?>>
       ```
   
 * That extra function will convert the array to a string.
 *  Thread Starter [pakpenyo](https://wordpress.org/support/users/pakpenyo/)
 * (@pakpenyo)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/html-class/#post-4967514)
 * That’s great! It’s work fine.
    Thanks a lot scotts.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘HTML Class’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/mobble_f5f5f5.svg)
 * [mobble](https://wordpress.org/plugins/mobble/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mobble/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mobble/)
 * [Active Topics](https://wordpress.org/support/plugin/mobble/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mobble/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mobble/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [pakpenyo](https://wordpress.org/support/users/pakpenyo/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/html-class/#post-4967514)
 * Status: resolved