'
. '
'
. $logo_image
. ' '
.'';
}
}
endif;
/**
* Display the primary menu area
*
* @since 1.0
* @access public
* @return void
*/
if ( !function_exists( 'hoot_header_aside' ) ):
function hoot_header_aside() {
$area = hoot_get_mod( 'primary_menuarea' );
if ( $area == 'none' )
return;
?>' .
sprintf( __( 'You are using an outdated browser (IE 8 or before). For a better user experience, we recommend %1supgrading your browser today%2s or %3sinstalling Google Chrome Frame%4s', 'brigsby' ), '', ' ', '', ' ' ) .
'
';
echo apply_filters( 'hoot_update_browser_notice', $notice );
}
endif;
/**
* Temporarily remove read more links from excerpts
*
* @since 1.0
* @access public
*/
if ( !function_exists( 'hoot_remove_readmore_link' ) ):
function hoot_remove_readmore_link() {
add_filter( 'hoot_readmore', 'hoot_readmore_empty_string' );
}
endif;
if ( !function_exists( 'hoot_readmore_empty_string' ) ):
function hoot_readmore_empty_string() {
return '';
}
endif;
/**
* Reinstate read more links to excerpts
*
* @since 1.0
* @access public
*/
if ( !function_exists( 'hoot_reinstate_readmore_link' ) ):
function hoot_reinstate_readmore_link() {
remove_filter( 'hoot_readmore', 'hoot_readmore_empty_string' );
}
endif;
/**
* Display title area content
*
* @since 1.0
* @access public
* @return void
*/
if ( !function_exists( 'hoot_display_loop_title_content' ) ):
function hoot_display_loop_title_content( $location = 'pre', $context = '' ) {
$pre_title_content_post = apply_filters( 'loop_meta_pre_title_content_post', '', $location, $context );
if ( ( $location == 'pre' && !$pre_title_content_post ) ||
( $location == 'post' && $pre_title_content_post ) ) :
$pre_title_content = apply_filters( 'loop_meta_pre_title_content', '', $location, $context );
if ( !empty( $pre_title_content ) ) :
$pre_title_content_stretch = apply_filters( 'loop_meta_pre_title_content_stretch', '', $location, $context ); ?>
' . ob_get_clean() . '';
endif;
if ( !empty( $display['date'] ) ) :
$blocks['date']['label'] = __( 'On:', 'brigsby' );
$blocks['date']['content'] = '
' . get_the_date() . ' ';
endif;
if ( !empty( $display['cats'] ) ) :
$category_list = get_the_category_list(', ');
if ( !empty( $category_list ) ) :
$blocks['cats']['label'] = __( 'In:', 'brigsby' );
$blocks['cats']['content'] = $category_list;
endif;
endif;
if ( !empty( $display['tags'] ) && get_the_tags() ) :
$blocks['tags']['label'] = __( 'Tagged:', 'brigsby' );
$blocks['tags']['content'] = ( ! get_the_tags() ) ? __( 'No Tags', 'brigsby' ) : get_the_tag_list( '', ', ', '' );
endif;
if ( !empty( $display['comments'] ) && comments_open() ) :
$blocks['comments']['label'] = __( 'With:', 'brigsby' );
ob_start();
comments_popup_link(__( '0 Comments', 'brigsby' ),
__( '1 Comment', 'brigsby' ),
__( '% Comments', 'brigsby' ), 'comments-link', '' );
$blocks['comments']['content'] = ob_get_clean();
endif;
if ( $edit_link = get_edit_post_link() ) :
$blocks['editlink']['label'] = '';
$blocks['editlink']['content'] = '
' . __( 'Edit This', 'brigsby' ) . ' ';
endif;
$blocks = apply_filters( 'hoot_meta_info_blocks', $blocks, $context );
foreach ( $blocks as $key => $block ) {
if ( !empty( $block['content'] ) ) {
echo '
';
if ( !empty( $block['label'] ) )
echo ' ' . $block['label'] . ' ';
echo $block['content'];
echo '
';
}
}
if ( !empty( $display['publisher'] ) ) {
static $microdatapublisher;
if ( empty( $microdatapublisher ) ) {
$pname = get_bloginfo();
if ( function_exists( 'get_custom_logo' ) ) {
$iid = get_theme_mod( 'custom_logo' );
if ( !empty( $iid ) ) {
$isrc = wp_get_attachment_image_src( $iid, 'full' );
if( empty( $isrc ) ) $isrc = wp_get_attachment_image_src( $iid, 'full', true );
if ( !empty( $isrc[0] ) ) {
$ilogo = $isrc[0];
$iwidth = ( empty( $isrc[1] ) ) ? '' : $isrc[1];
$iheight = ( empty( $isrc[2] ) ) ? '' : $isrc[2];
}
}
}
if ( empty( $ilogo ) )
$ilogo = $iwidth = $iheight = '';
$microdatapublisher =
'
' .
' ' .
'' .
' ' .
' ' .
' ' .
' ' .
' ';
}
echo apply_filters( 'entry-byline-block-publisher', $microdatapublisher );
}
?>
' .
'';
the_post_thumbnail( $thumbnail_size, array( 'class' => "attachment-$thumbnail_size $custom_class", 'itemscope' => '' ) );
echo '
';
}
endif;
/**
* Get the thumbnail size
*
* @since 1.0
* @access public
* @param string $size span or column size or actual image size name. Default is content width span.
* @param bool $crop true|false|null Using null will return closest matched image irrespective of its crop setting
* @return void
*/
if ( !function_exists( 'hoot_thumbnail_size' ) ):
function hoot_thumbnail_size( $size = '', $crop = NULL ) {
/* Calculate the size to display */
if ( !empty( $size ) ) {
if ( 0 === strpos( $size, 'span-' ) || 0 === strpos( $size, 'column-' ) )
$thumbnail_size = hybridextend_get_image_size_name( $size, $crop );
else
$thumbnail_size = $size;
} else {
$size = 'span-' . hoot_main_layout( 'content' );
$thumbnail_size = hybridextend_get_image_size_name( $size, $crop );
}
/* Let child themes filter the size name */
$thumbnail_size = apply_filters( 'hoot_post_thumbnail' , $thumbnail_size, $size, $crop );
return $thumbnail_size;
}
endif;
/**
* Utility function to extract border class for widget based on user option.
*
* @since 1.0
* @access public
* @param string $val string value separated by spaces
* @param int $index index for value to extract from $val
* @prefix string $prefix prefixer for css class to return
* @return void
*/
if ( !function_exists( 'hoot_widget_border_class' ) ):
function hoot_widget_border_class( $val, $index=0, $prefix='' ) {
$val = explode( " ", trim( $val ) );
if ( isset( $val[ $index ] ) )
return $prefix . trim( $val[ $index ] );
else
return '';
}
endif;
/**
* Utility function to map footer sidebars structure to CSS span architecture.
*
* @since 1.0
* @access public
* @return void
*/
if ( !function_exists( 'hoot_footer_structure' ) ):
function hoot_footer_structure() {
$footers = hoot_get_mod( 'footer' );
$structure = array(
'1-1' => array( 12, 12, 12, 12 ),
'2-1' => array( 6, 6, 12, 12 ),
'2-2' => array( 4, 8, 12, 12 ),
'2-3' => array( 8, 4, 12, 12 ),
'3-1' => array( 4, 4, 4, 12 ),
'3-2' => array( 6, 3, 3, 12 ),
'3-3' => array( 3, 6, 3, 12 ),
'3-4' => array( 3, 3, 6, 12 ),
'4-1' => array( 3, 3, 3, 3 ),
);
if ( isset( $structure[ $footers ] ) )
return $structure[ $footers ];
else
return array( 12, 12, 12, 12 );
}
endif;
/**
* Get footer column option.
*
* @since 1.0
* @access public
* @return int
*/
function hoot_get_footer_columns() {
$footers = hoot_get_mod( 'footer' );
$columns = ( $footers ) ? intval( substr( $footers, 0, 1 ) ) : false;
$columns = ( is_numeric( $columns ) && 0 < $columns ) ? $columns : false;
return $columns;
}
/**
* Utility function to map 2 column widths to CSS span architecture.
*
* @since 1.0
* @access public
* @return void
*/
if ( !function_exists( 'hoot_col_width_to_span' ) ):
function hoot_col_width_to_span( $col_width ) {
$return = array();
switch( $col_width ):
case '100':
$return[0] = 'grid-span-12';
break;
case '50-50': default:
$return[0] = 'grid-span-6';
$return[1] = 'grid-span-6';
break;
case '33-66':
$return[0] = 'grid-span-4';
$return[1] = 'grid-span-8';
break;
case '66-33':
$return[0] = 'grid-span-8';
$return[1] = 'grid-span-4';
break;
case '25-75':
$return[0] = 'grid-span-3';
$return[1] = 'grid-span-9';
break;
case '75-25':
$return[0] = 'grid-span-9';
$return[1] = 'grid-span-3';
break;
case '33-33-33':
$return[0] = 'grid-span-4';
$return[1] = 'grid-span-4';
$return[2] = 'grid-span-4';
break;
case '25-25-50':
$return[0] = 'grid-span-3';
$return[1] = 'grid-span-3';
$return[2] = 'grid-span-6';
break;
case '25-50-25':
$return[0] = 'grid-span-3';
$return[1] = 'grid-span-6';
$return[2] = 'grid-span-3';
break;
case '50-25-25':
$return[0] = 'grid-span-6';
$return[1] = 'grid-span-3';
$return[2] = 'grid-span-3';
break;
case '25-25-25-25':
$return[0] = 'grid-span-3';
$return[1] = 'grid-span-3';
$return[2] = 'grid-span-3';
$return[3] = 'grid-span-3';
break;
endswitch;
return $return;
}
endif;
/**
* Wrapper function for hoot_main_layout() to get the class names for current context.
* Can only be used after 'posts_selection' action hook i.e. in 'wp' hook or later.
*
* @since 1.0
* @access public
* @param string $context content|primary-sidebar|sidebar|sidebar-primary
* @return string
*/
if ( !function_exists( 'hoot_main_layout_class' ) ):
function hoot_main_layout_class( $context ) {
return hoot_main_layout( $context, 'class' );
}
endif;
/**
* Utility function to return layout size or classes for the context.
* Can only be used after 'posts_selection' action hook i.e. in 'wp' hook or later.
*
* @since 1.0
* @access public
* @param string $context content|primary-sidebar|sidebar|sidebar-primary
* @param string $return class|size return class name or just the span size integer
* @return string
*/
if ( !function_exists( 'hoot_main_layout' ) ):
function hoot_main_layout( $context, $return = 'size' ) {
// Set layout
global $hoot_theme;
if ( !isset( $hoot_theme->currentlayout ) )
hoot_set_main_layout();
$span_sidebar = $hoot_theme->currentlayout['sidebar'];
$span_content = $hoot_theme->currentlayout['content'];
$layout_class = ' layout-' . $hoot_theme->currentlayout['layout'];
// Return Class or Span Size for the Content/Sidebar
if ( $context == 'content' ) {
if ( $return == 'class' ) {
$extra_class = ( empty( $span_sidebar ) ) ? ' no-sidebar' : ' has-sidebar';
return ' grid-span-' . $span_content . $extra_class . $layout_class . ' ';
} elseif ( $return == 'size' ) {
return intval( $span_content );
}
} elseif ( $context == 'sidebar' || $context == 'sidebar-primary' || $context == 'primary-sidebar' || $context == 'secondary-sidebar' || $context == 'sidebar-secondary' ) {
if ( $return == 'class' ) {
if ( !empty( $span_sidebar ) )
return ' grid-span-' . $span_sidebar . $layout_class . ' ';
else
return '';
} elseif ( $return == 'size' ) {
return intval( $span_sidebar );
}
}
return '';
}
endif;
/**
* Utility function to calculate and set main (content+aside) layout according to the sidebar layout
* set by user for the current view.
* Can only be used after 'posts_selection' action hook i.e. in 'wp' hook or later.
*
* @since 1.0
* @access public
*/
if ( !function_exists( 'hoot_set_main_layout' ) ):
function hoot_set_main_layout() {
// Apply full width for front page
if ( is_front_page() && !is_home() ) {
$sidebar = 'full-width';
}
// Apply Sidebar Layout for Posts
elseif ( is_singular( 'post' ) ) {
$sidebar = hoot_get_mod( 'sidebar_posts' );
}
// Check for attachment before page (to handle images attached to a page - true for is_page and is_attachment)
// Apply 'Full Width'
elseif ( is_attachment() ) {
$sidebar = 'none';
}
elseif ( is_page() ) {
if ( hybridextend_is_404() )
// Apply 'Full Width' if this page is being displayed as a custom 404 page
$sidebar = 'none';
else
// Apply Sidebar Layout for Pages
$sidebar = hoot_get_mod( 'sidebar_pages' );
}
// Apply Sidebar Layout for Site
else {
$sidebar = hoot_get_mod( 'sidebar' );
}
// Allow for custom manipulation of the layout by child themes
$sidebar = apply_filters( 'hoot_main_layout', $sidebar );
// Save the layout for current view
hoot_set_current_layout( $sidebar );
}
endif;
/**
* Utility function to calculate and set main (content+aside) layout according to the sidebar layout
* set by user for the current view.
* Can only be used after 'posts_selection' action hook i.e. in 'wp' hook or later.
*
* @since 1.0
* @access public
*/
if ( !function_exists( 'hoot_set_current_layout' ) ):
function hoot_set_current_layout( $sidebar ) {
$spans = apply_filters( 'hoot_main_layout_spans', array(
'none' => array(
'content' => 9,
'sidebar' => 0,
),
'full' => array(
'content' => 12,
'sidebar' => 0,
),
'full-width' => array(
'content' => 12,
'sidebar' => 0,
),
'narrow-right' => array(
'content' => 9,
'sidebar' => 3,
),
'wide-right' => array(
'content' => 8,
'sidebar' => 4,
),
'narrow-left' => array(
'content' => 9,
'sidebar' => 3,
),
'wide-left' => array(
'content' => 8,
'sidebar' => 4,
),
'narrow-left-left' => array(
'content' => 6,
'sidebar' => 3,
),
'narrow-left-right' => array(
'content' => 6,
'sidebar' => 3,
),
'narrow-right-left' => array(
'content' => 6,
'sidebar' => 3,
),
'narrow-right-right' => array(
'content' => 6,
'sidebar' => 3,
),
'default' => array(
'content' => 8,
'sidebar' => 4,
),
) );
/* Set the layout for current view */
global $hoot_theme;
$hoot_theme->currentlayout['layout'] = $sidebar;
if ( isset( $spans[ $sidebar ] ) ) {
$hoot_theme->currentlayout['content'] = $spans[ $sidebar ]['content'];
$hoot_theme->currentlayout['sidebar'] = $spans[ $sidebar ]['sidebar'];
} else {
$hoot_theme->currentlayout['content'] = $spans['default']['content'];
$hoot_theme->currentlayout['sidebar'] = $spans['default']['sidebar'];
}
}
endif;
/**
* Utility function to determine the location of page header
*
* @since 1.0
* @access public
*/
if ( !function_exists( 'hoot_page_header_attop' ) ):
function hoot_page_header_attop() {
$full = array_map( 'trim', explode( ',', hoot_get_mod( 'page_header_full' ) ) );
/* Override For Full Width Pages (including 404 page) */
if ( in_array( 'no-sidebar', $full ) ) {
$sidebar_size = hoot_main_layout( 'primary-sidebar' );
if ( empty( $sidebar_size ) || hybridextend_is_404() )
return apply_filters( 'hoot_page_header_attop', true, 'no-sidebar', $full );
}
/* For Posts */
if ( is_singular( 'post' ) ) {
if ( in_array( 'posts', $full ) )
return apply_filters( 'hoot_page_header_attop', true, 'posts', $full );
else
return apply_filters( 'hoot_page_header_attop', false, 'posts', $full );
}
/* For Pages */
if ( is_page() ) {
if ( in_array( 'pages', $full ) )
return apply_filters( 'hoot_page_header_attop', true, 'pages', $full );
else
return apply_filters( 'hoot_page_header_attop', false, 'pages', $full );
}
/* Default */
if ( in_array( 'default', $full ) )
return apply_filters( 'hoot_page_header_attop', true, 'default', $full );
else
return apply_filters( 'hoot_page_header_attop', false, 'default', $full );
}
endif;
/**
* Utility function to create slider slides array for lite version
*
* @since 1.0
* @access public
*/
if ( !function_exists( 'hoot_get_lite_slider' ) ):
function hoot_get_lite_slider( $type ) {
$slides = $data = array();
switch ( $type ) {
case 'html':
for ( $i = 1; $i <= 4; $i++ ) {
$id = intval( hoot_get_mod( "wt_html_slide_{$i}-content" ) );
if ( !empty( $id ) ) {
$postobj = get_post( $id );
$size = hybridextend_get_image_size_name('span-6');
$data[$i]['title'] = ( !empty( $postobj->post_title ) ) ? $postobj->post_title : '';
$data[$i]['content'] = ( !empty( $postobj->post_content ) ) ? apply_filters( 'the_content', $postobj->post_content ) : '';
if ( has_post_thumbnail ( $id ) ) {
$isrc = wp_get_attachment_image_src( get_post_thumbnail_id($id), $size );
if( empty( $isrc ) ) $isrc = wp_get_attachment_image_src( get_post_thumbnail_id($id), $size, true );
$data[$i]['image'] = $isrc[0];
} else $data[$i]['image'] = '';
}
}
for ( $i = 1; $i <= 4; $i++ ) {
if ( !empty( $data[$i] ) ) {
$slides[ $i ]['image'] = esc_url( $data[$i]['image'] );
$slides[ $i ]['content'] = '