'300px by 300px'
) );
}
/************* ACTIVE SIDEBARS ********************/
// Sidebars & Widgetizes Areas
function bohaute_register_sidebars() {
register_sidebar(array(
'id' => 'sidebar1',
'name' => __( 'Posts Sidebar', 'bohaute' ),
'description' => __( 'The Posts sidebar.', 'bohaute' ),
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '',
));
register_sidebar(array(
'id' => 'sidebar2',
'name' => __( 'Page Sidebar', 'bohaute' ),
'description' => __( 'The Page sidebar.', 'bohaute' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
));
} // don't remove this bracket!
/************* COMMENT LAYOUT *********************/
// Comment Layout
function bohaute_comments( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment; ?>
/mi','',$output); } function bohaute_oembed() { global $post; if ( $post && $post->post_content ) { global $shortcode_tags; // Make a copy of global shortcode tags - we'll temporarily overwrite it. $theme_shortcode_tags = $shortcode_tags; // The shortcodes we're interested in. $shortcode_tags = array( 'video' => $theme_shortcode_tags['video'], 'audio' => $theme_shortcode_tags['audio'], 'embed' => $theme_shortcode_tags['embed'] ); // Get the absurd shortcode regexp. $video_regex = '#' . get_shortcode_regex() . '#i'; // Restore global shortcode tags. $shortcode_tags = $theme_shortcode_tags; $pattern_array = array( $video_regex ); // Get the patterns from the embed object. if ( ! function_exists( '_wp_oembed_get_object' ) ) { include ABSPATH . WPINC . '/class-oembed.php'; } $oembed = _wp_oembed_get_object(); $pattern_array = array_merge( $pattern_array, array_keys( $oembed->providers ) ); // Or all the patterns together. $pattern = '#(' . array_reduce( $pattern_array, function ( $carry, $item ) { if ( strpos( $item, '#' ) === 0 ) { // Assuming '#...#i' regexps. $item = substr( $item, 1, -2 ); } else { // Assuming glob patterns. $item = str_replace( '*', '(.+)', $item ); } return $carry ? $carry . ')|(' . $item : $item; } ) . ')#is'; // Simplistic parse of content line by line. $lines = explode( "\n", $post->post_content ); foreach ( $lines as $line ) { $line = trim( $line ); if ( preg_match( $pattern, $line, $matches ) ) { if ( strpos( $matches[0], '[' ) === 0 ) { $ret = do_shortcode( $matches[0] ); $audio = split('"', $matches[0]); if( array_key_exists(1, $audio)){ return $audio[1]; } } else { $ret = wp_oembed_get( $matches[0] ); } return $ret; } } } } function bohaute_author_excerpt() { $text_limit = '50'; //Words to show in author bio excerpt $read_more = "Read more"; //Read more text $end_of_txt = "..."; $name_of_author = get_the_author(); $url_of_author = get_author_posts_url(get_the_author_meta('ID')); $short_desc_author = wp_trim_words(strip_tags( get_the_author_meta('description')), $text_limit, $end_of_txt.'
'.$read_more .''); return $short_desc_author; } function bohaute_catch_that_image() { global $post; $pattern = '|