Skip to content

Instantly share code, notes, and snippets.

@m-e-h
Created February 23, 2015 21:55
Show Gist options
  • Save m-e-h/c822da5f2a6ea786492d to your computer and use it in GitHub Desktop.
Save m-e-h/c822da5f2a6ea786492d to your computer and use it in GitHub Desktop.
<?php
add_action( 'customize_controls_init', 'abraham_customize_css' );
add_action( 'admin_print_styles', 'abraham_admin_styles' );
/**
* Adds visual selectors for the layout option in the Theme Customizer.
*/
function abraham_customize_css() { ?>
<style type="text/css">
#customize-control-theme-layout-control input[value="1c"]:before {
content: "\f134";
}
#customize-control-theme-layout-control input[value="2c-l"]:before {
content: "\f135";
}
#customize-control-theme-layout-control input[value="2c-r"]:before {
content: "\f136";
}
#customize-control-theme-layout-control input[type=radio] {
font-family: dashicons;
font-size: 32px;
margin-right: 20px;
color: #ddd;
border: 0;
line-height: 0;
height: 0;
width: 0;
}
#customize-control-theme-layout-control input[type=radio]:checked:before {
color: #888;
text-indent: 0;
-webkit-border-radius: 0;
border-radius: 0;
font-size: 32px;
width: 0;
height: 0;
margin: 0;
line-height: 0;
background: none;
}
</style>
<?php }
/**
* Adds visual selectors for the layout option in the Post Admin.
*/
function abraham_admin_styles() {
?>
<style type="text/css">
#theme-layouts-post-meta-box input[value=default]:before {
content: "\f159";
}
#theme-layouts-post-meta-box input[value="1c"]:before {
content: "\f134";
}
#theme-layouts-post-meta-box input[value="2c-l"]:before {
content: "\f135";
}
#theme-layouts-post-meta-box input[value="2c-r"]:before {
content: "\f136";
}
#theme-layouts-post-meta-box input[type=radio] {
font-family: dashicons;
font-size: 32px;
margin-right: 20px;
color: #ddd;
border: 0;
line-height: 0;
height: 0;
width: 0;
}
#theme-layouts-post-meta-box input[type=radio]:checked:before {
color: #888;
text-indent: 0;
-webkit-border-radius: 0;
border-radius: 0;
font-size: 32px;
width: 0;
height: 0;
margin: 0;
line-height: 0;
background: none;
}
#theme-layouts-post-meta-box li {
margin-bottom: 15px;
}
</style>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment