1 && get_option( 'page_comments' ) ) : ?> option_activate == 'masonry' && !is_single()) ? 'col-lg-12' : 'col-lg-2'; $style = ($post_layout->option_activate == 'masonry' && !is_single()) ? 'style="padding: 3%;"' : ''; printf( '%1$s%3$s', sprintf( '%s ',_x( 'Format', 'Used before post format.', 'broad' ) ), esc_url( get_post_format_link( $format ) ), get_post_format_string( $format ), $class, $style ); } ?>
%3$s', sprintf( '%s ', _x( 'Edit', 'Used before edit post link.', 'broad' ) ), get_edit_post_link(get_the_ID()), 'Edit', $edit_class ); } return; } if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) { broad_entry_date(); } if ( 'post' == get_post_type() ) { $post_layout = broad_get_option_data( 'post_layout' ); $class = ($post_layout->option_activate == 'masonry' && !is_single()) ? 'col-lg-4' : 'col-lg-2'; printf( '%1$s %3$s', _x( 'Author', 'Used before post author name.', 'broad' ), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), get_the_author(), $class ); $categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'broad' ) ); if ( current_user_can( 'edit_posts' ) ) { $cat_class = 'col-lg-3'; } else { $cat_class = 'col-lg-4'; } if ($post_layout->option_activate == 'masonry' && !is_single()) { $cat_class = 'col-lg-12'; } if ( $categories_list && broad_categorized_blog() ) { printf( '%1$s %3$s', _x( 'Categories', 'Used before category names.', 'broad' ), $cat_class, $categories_list ); } } if ( ! post_password_required() && comments_open() ) { $class = ($post_layout->option_activate == 'masonry' && !is_single()) ? 'col-lg-8' : 'col-lg-2'; if ( $post_layout->option_activate == 'masonry' && !is_single() && !current_user_can('edit_post') ) { $class = 'col-lg-12'; } comments_popup_link( __( 'Leave a comment', 'broad' ), __( '1 Comment', 'broad' ), __( '% Comments', 'broad' ), $class, __( 'Commenting is off', 'broad' ) ); } if ( current_user_can('edit_posts') ) { if ($post_layout->option_activate == 'masonry' && !is_single()) { $class = 'col-lg-4'; } else { if ( !comments_open() ) { $class = 'col-lg-12'; } else { $class = 'col-lg-1'; } } printf( '%1$s%3$s', sprintf( '%s ', _x( 'Edit', 'Used before edit post link.', 'broad' ) ), get_edit_post_link(get_the_ID()), __( 'Edit', 'broad' ), $class ); } ?>
%2$s'; $time_string = sprintf( $time_string, esc_attr( get_the_date( 'c' ) ), get_the_date() ); $post_layout = broad_get_option_data('post_layout'); $class = ($post_layout->option_activate == 'masonry' && !is_single()) ? 'col-lg-8' : 'col-lg-3'; printf( '%1$s %3$s', _x( 'Posted on', 'Used before publish date.', 'broad' ), esc_url( get_permalink() ), $time_string, $class ); } endif; /** * Determine whether blog/site has more than one category. * * @since Broad 1.0 * * @return bool True of there is more than one category, false otherwise. */ function broad_categorized_blog() { if ( false === ( $all_the_cool_cats = get_transient( 'broad_categories' ) ) ) { // Create an array of all the categories that are attached to posts. $all_the_cool_cats = get_categories( array( 'fields' => 'ids', 'hide_empty' => 1, // We only need to know if there is more than one category. 'number' => 2, ) ); // Count the number of categories that are attached to the posts. $all_the_cool_cats = count( $all_the_cool_cats ); set_transient( 'broad_categories', $all_the_cool_cats ); } if ( $all_the_cool_cats > 1 ) { // This blog has more than 1 category so broad_categorized_blog should return true. return true; } else { // This blog has only 1 category so broad_categorized_blog should return false. return false; } } /** * Flush out the transients used in {@see broad_categorized_blog()}. * * @since Broad 1.0 */ function broad_category_transient_flusher() { // Like, beat it. Dig? delete_transient( 'broad_categories' ); } add_action( 'edit_category', 'broad_category_transient_flusher' ); add_action( 'save_post', 'broad_category_transient_flusher' ); if ( ! function_exists( 'broad_post_thumbnail' ) ) : /** * Displays an optional post thumbnail. * * Wraps the post thumbnail in an anchor element on index views, or a div * element when on single views. * * Create your own broad_post_thumbnail() function to override in a child theme. * * @since Broad 1.0 */ function broad_post_thumbnail() { if ( post_password_required() || is_attachment() ) { return; } ?> option_activate == 'masonry') : ?>
option_activate == 'masonry') : ?>

', esc_url( get_permalink() ) ), '

' ); ?>

', esc_url( get_permalink() ) ), '

' ); ?>
option_activate == 'masonry') { add_filter('excerpt_length', 'broad_post_excerptlength_masonry'); } else { add_filter('excerpt_length', 'broad_post_excerptlength_index'); } add_filter('excerpt_more', 'broad_post_excerptmore'); $content = get_the_excerpt(); $content = apply_filters('wptexturize', $content); $content = apply_filters('convert_chars', $content); echo $content; } ?>