This file contains 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
remove_action('genesis_header', 'genesis_do_header'); | |
add_action('genesis_header', 'kr_do_header'); | |
function kr_do_header() | |
{ | |
global $wp_registered_sidebars; | |
if ((isset($wp_registered_sidebars['header-right']) && is_active_sidebar('header-right')) || has_action('genesis_header_right')) { | |
genesis_markup(array( | |
'html5' => '<aside %s>', | |
'xhtml' => '<div class="widget-area header-widget-area">', |
This file contains 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
/** | |
* HTML5 DOCTYPE | |
* removes the default Genesis doctype, adds new html5 doctype with IE8 detection | |
*/ | |
function mb_html5_doctype() { | |
?> | |
<!DOCTYPE html> | |
<!--[if IE 8]> <html class="lt-ie9" <?php language_attributes( 'html' ); ?>> <![endif]--> | |
<!--[if gt IE 8]><!--> <html <?php language_attributes( 'html' ); ?>> <!--<![endif]--> |
This file contains 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
/** | |
* Get image attachment (title, alt, caption, url, width, height) | |
* | |
*/ | |
// get attachment ID if featured image | |
$attachment_id = get_post_thumbnail_id( $post->ID ); | |
// best function ever - http://codex.wordpress.org/Function_Reference/wp_prepare_attachment_for_js |
This file contains 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
/** | |
* Retreive all post meta for a given $key by $post_type | |
* | |
* This function is useful if you need to do any frontend sorting of posts by meta key/values and need to populate a select | |
* | |
* @param string | |
* @param string | |
* @param string | |
* @param bool | |
* @return array |
This file contains 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
/** | |
* Generates a safe email HTML anchor | |
* | |
* | |
* @access public | |
* @param string | |
* @return string | |
*/ | |
function safe_email($email = '' ){ | |
This file contains 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
add_filter( 'widget_display_callback', 'kr_widget_display_callback', 10, 3 ); | |
function kr_widget_display_callback($instance, $widget, $args) { | |
if ( strpos( $args['widget_id'], 'dpe_fp_widget' ) === FALSE && !isset($instance['template'])) { | |
return $instance; | |
} | |
$widget_classname = $widget->widget_options['classname']; | |
$my_classnames = basename( $instance['template'], '.php' ); |
This file contains 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
// Creating the widget | |
class KR_WIDGET extends WP_Widget { | |
const WIDGET_DOMAIN = 'fusemail'; | |
const WIDGET_ID = 'kr_widget'; | |
const WIDGET_NAME = 'KR Widget'; | |
const WIDGET_DESCRIPTION = 'KR Widget Description.'; | |
const WIDGET_TITLE = ''; | |
function __construct() { |
This file contains 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
// @mixin create column widths | |
@function col_width( $n, $total_columns, $total_width: 1140px, $gutter_width: 48px ) | |
{ | |
$col_width: ($total_width - ($gutter_width * ($total_columns - 1))) / $total_columns; | |
$total_width: $total_width; | |
$columns_width: ($n * $col_width) + (($n - 1) * $gutter_width); | |
@return percentage($columns_width/$total_width); | |
} | |
// |
This file contains 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
$('iframe[src*="youtube.com"]').each(function() { | |
var url = $(this).attr("src"); | |
var char = "?"; | |
if(url.indexOf("?") != -1) | |
char = "&"; | |
$(this).attr("src",url+char+"modestbranding=1&wmode=transparent&showinfo=0&rel=0&autohide=1"); | |
}); |
OlderNewer