-
-
Save About2git/5fd0c21808cd6e0f4feb to your computer and use it in GitHub Desktop.
How to use iCheck for customized check boxes and radio buttons in WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <ul class="list"> | |
| <li><label><input type="checkbox" name="step1" value="Step 1"><span>Step 1</span></label></li> | |
| <li><label><input type="checkbox" name="step2" value="Step 2"><span>Step 2</span></label></li> | |
| </ul> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //* Do NOT include the opening php tag | |
| //* Enqueue iCheck | |
| add_action( 'wp_enqueue_scripts', 'sk_enqueue_icheck' ); | |
| function sk_enqueue_icheck() { | |
| wp_enqueue_style( 'icheck-flat-green', get_stylesheet_directory_uri() . '/skins/flat/green.css' ); | |
| wp_enqueue_script( 'icheck', get_stylesheet_directory_uri() . '/js/icheck.min.js', array( 'jquery' ), '', true ); | |
| wp_enqueue_script( 'icheck-init', get_stylesheet_directory_uri() . '/js/icheck.init.js', array( 'icheck' ), '1.0.0', true ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery(function( $ ){ | |
| $('input').iCheck({ | |
| checkboxClass: 'icheckbox_flat-green', | |
| radioClass: 'iradio_flat-green' | |
| }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .entry-title { | |
| margin-bottom: 40px; | |
| } | |
| ul.list { | |
| margin-left: 0; | |
| } | |
| .entry-content ul.list > li { | |
| list-style: none; | |
| margin-bottom: 10px; | |
| } | |
| .list span { | |
| padding-left: 10px; | |
| vertical-align: middle; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment