'. $oembed .'
';
}
// Display using apply_filters if it's self-hosted
else {
$audio = apply_filters( 'the_content', $audio );
// Add responsive audio wrap for youtube/vimeo embeds
if ( strpos( $audio, 'youtube' ) || strpos( $audio, 'vimeo' ) ) {
return ''. $audio .'
';
}
// Else return without responsive wrap
else {
return $audio;
}
}
}
}
if ( ! function_exists( 'kirhero_get_post_video_html' ) )
{
function kirhero_get_post_video_html( $video = '' )
{
// Get video
$video = $video ? $video : kirhero_get_post_media();
// Return if video is empty
if ( empty( $video ) ) {
return;
}
// Check post format for standard post type
if ( 'post' == get_post_type() && 'video' != get_post_format() ) {
return;
}
// Get oembed code and return
if ( ! is_wp_error( $oembed = wp_oembed_get( $video ) ) && $oembed ) {
return ''. $oembed .'
';
}
// Display using apply_filters if it's self-hosted
else {
$video = apply_filters( 'the_content', $video );
// Add responsive video wrap for youtube/vimeo embeds
if ( strpos( $video, 'youtube' ) || strpos( $video, 'vimeo' ) ) {
return ''. $video .'
';
}
// Else return without responsive wrap
else {
return $video;
}
}
}
}
if ( ! function_exists( 'kirhero_get_post_media' ) )
{
function kirhero_get_post_media( $post_id = '' )
{
// Define video variable
$video = '';
// Get correct ID
$post_id = $post_id ? $post_id : get_the_ID();
// Embed
if ( $meta = get_post_meta( $post_id, 'kirhero_post_video_embed', true ) ) {
$video = $meta;
}
// Check for self-hosted first
elseif ( $meta = get_post_meta( $post_id, 'kithero_post_self_hosted_media', true ) ) {
$video = $meta;
}
// Check for post oembed
elseif ( $meta = get_post_meta( $post_id, 'kirhero_post_oembed', true ) ) {
$video = $meta;
}
// Apply filters for child theming
$video = apply_filters( 'kirhero_get_post_video', $video );
// Return data
return $video;
}
}
if ( ! function_exists( 'kirhero_blog_article_style' ) )
{
function kirhero_blog_article_style()
{
// Get default style from Customizer
$style = get_theme_mod( 'kirhero_admin_blog_style', kirhero_get_default_theme_settings( 'blog-style' ) );
// Sanitize
$style = $style ? $style : 'large-entry';
// Apply filters for child theming
$style = apply_filters( 'kirhero_blog_entry_style', $style );
// Return style
return $style;
}
}
if ( ! function_exists( 'kirhero_blog_article_images_size' ) )
{
function kirhero_blog_article_images_size()
{
// Get default size from Customizer
$size = get_theme_mod( 'kirhero_blog_image_size', kirhero_get_default_theme_settings( 'blog-article-image-size' ) );
// Sanitize
$size = $size ? $size : 'full';
// Apply filters for child theming
$size = apply_filters( 'kirhero_blog_article_images_size', $size );
// Return size
return $size;
}
}
if ( ! function_exists( 'kirhero_blog_pagination' ) )
{
function kirhero_blog_pagination()
{
kirhero_pagination();
}
}
// Pagination Number
if ( ! function_exists( 'kirhero_pagination') )
{
function kirhero_pagination( $query = '', $echo = true )
{
// Arrows with RTL support
$prev_arrow = is_rtl() ? 'fa fa-angle-right' : 'fa fa-angle-left';
$next_arrow = is_rtl() ? 'fa fa-angle-left' : 'fa fa-angle-right';
// Get global $query
if ( ! $query ) {
global $wp_query;
$query = $wp_query;
}
// Set vars
$total = $query->max_num_pages;
$big = 999999999;
// Display pagination if total var is greater then 1 ( current query is paginated )
if ( $total > 1 ) {
// Get current page
if ( $current_page = get_query_var( 'paged' ) ) {
$current_page = $current_page;
} elseif ( $current_page = get_query_var( 'page' ) ) {
$current_page = $current_page;
} else {
$current_page = 1;
}
// Get permalink structure
if ( get_option( 'permalink_structure' ) ) {
if ( is_page() ) {
$format = 'page/%#%/';
} else {
$format = '/%#%/';
}
} else {
$format = '&paged=%#%';
}
$args = apply_filters( 'kirhero_pagination_args', array(
'base' => str_replace( $big, '%#%', html_entity_decode( get_pagenum_link( $big ) ) ),
'format' => $format,
'current' => max( 1, $current_page ),
'total' => $total,
'mid_size' => 3,
'type' => 'list',
'prev_text' => '";
foreach ( $footer_sidebars_array as $footer_sidebar )
{
$css_first = '';
$counter++;
if ( $counter == 1 && $widgets_count > 1)
{
$css_first = ' first';
}
if ( is_active_sidebar( $footer_sidebar ) )
{
echo '
';
dynamic_sidebar( $footer_sidebar );
echo '
';
}
}
echo "
";
echo "
";
}
add_action( 'kirhero_footer_widgets', 'kirhero_footer_widgets');
}
///////////////
////////////////////////////////////////////////////////////////