Skip to content

Instantly share code, notes, and snippets.

@billerickson

billerickson/functions.php

Last active Aug 29, 2015
Embed
What would you like to do?
<?php
/**
* Enqueue Inline Styles
*
* @author Bill Erickson
* @link http://www.billerickson.net/code/enqueue-inline-styles/
*/
function be_enqueue_inline_styles() {
$css = '';
$logo = get_option( 'options_be_site_logo' );
if( $logo ) {
$logo = wp_get_attachment_image_src( $logo, 'full' );
$css .= '
.site-title { background-image: url(' . $logo[0] . ');}
';
}
if( !empty( $css ) )
wp_add_inline_style( 'child-theme', $css );
}
add_action( 'wp_enqueue_scripts', 'be_enqueue_inline_styles' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.