Skip to content

Instantly share code, notes, and snippets.

@ingozoell
ingozoell / modernizr-svg-fallback.js
Created March 31, 2014 14:19
Modernizr SVG Fallback
if(!Modernizr.svg) {
$('img[src*="svg"]').attr('src', function() {
return $(this).attr('src').replace('.svg', '.png');
});
}
/*
* Allow Editors to chance theme options and Redux Framework
* https://codex.wordpress.org/Roles_and_Capabilities
*
*
*/
// get the the role object
$editor = get_role('editor');
/* http://css-tricks.com/snippets/css/retina-display-media-query/ */
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and ( min--moz-device-pixel-ratio: 2),
only screen and ( -o-min-device-pixel-ratio: 2/1),
only screen and ( min-device-pixel-ratio: 2),
only screen and ( min-resolution: 192dpi),
only screen and ( min-resolution: 2dppx) {
/* Retina-specific stuff here */
function autogen_featured_img() {
global $post;
if (!has_post_thumbnail($post->ID)) {
$attached_image =
get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1" );
if ($attached_image) {
foreach ($attached_image as $attachment_id => $attachment) {
set_post_thumbnail($post->ID, $attachment_id);
}
/* Include ReduxFramework
*
* http://docs.reduxframework.com/redux-framework/advanced/embedding-redux-into-your-theme-or-plugin/
*
*/
if ( !class_exists( 'ReduxFramework' ) && file_exists( dirname( __FILE__ ) . '/admin/ReduxFramework/ReduxCore/framework.php' ) ) {
// Translate
// https://github.com/ReduxFramework/redux-framework/issues/520
load_textdomain( 'redux-framework-demo', dirname( __FILE__ ) . '/languages/' . $locale . '.mo' );
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
/**
* Additional Styles
* @since 1.0.0
*/
function child_styles() {
if ( !is_admin() ) {
// register styles
wp_register_style('googlefont-oswald', 'http://fonts.googleapis.com/css?family=Oswald:400,300,700', array(), false, 'all');
@ingozoell
ingozoell / SassMeister-input-HTML.html
Created April 18, 2014 17:47
Generated by SassMeister.com.
<div class="outer">
<article>article
<div class="nest-1">nest-1</div>
<div class="nest-2">nest-2</div>
</article>
<aside>aside</aside>
</div>
@ingozoell
ingozoell / SassMeister-input-HTML.html
Created April 18, 2014 17:51
Generated by SassMeister.com.
<div class="outer">
<article>
<div class="nest-1">nest-1</div>
<div class="nest-2">nest-2</div>
</article>
<aside>aside</aside>
</div>