%s', get_permalink(), the_title_attribute( 'echo=0' ), sprintf( '%s/images/post-formats/%s.png', CHILD_URL, $post_format ), $post_format ); } # Else, look for the default post format image elseif ( file_exists( sprintf( '%s/images/post-formats/default.png', CHILD_DIR ) ) ) { printf( '%s', get_permalink(), the_title_attribute( 'echo=0' ), CHILD_URL, 'post' ); } } /** * Echo the opening structural markup for the entry header. * * @since 1.0.0 */ add_action( 'bizznis_entry_header', 'bizznis_entry_header_markup_open', 5 ); function bizznis_entry_header_markup_open() { printf( '
', bizznis_attr( 'entry-header' ) ); } /** * Echo the closing structural markup for the entry header. * * @since 1.0.0 */ add_action( 'bizznis_entry_header', 'bizznis_entry_header_markup_close', 15 ); function bizznis_entry_header_markup_close() { echo '
'; } /** * Echo the title of a post. * * @since 1.0.0 */ add_action( 'bizznis_entry_header', 'bizznis_do_post_title' ); function bizznis_do_post_title() { $title = apply_filters( 'bizznis_post_title_text', get_the_title() ); # Stop here if no title if ( 0 == strlen( $title ) ) { return; } # Link it, if necessary if ( ! is_singular() && apply_filters( 'bizznis_link_post_title', true ) ) { $title = sprintf( '%s', get_permalink(), the_title_attribute( 'echo=0' ), $title ); } # Wrap in H1 on singular pages $wrap = is_singular() ? 'h1' : 'h2'; # Also, if HTML5 with semantic headings, wrap in H1 $wrap = bizznis_get_seo_option( 'semantic_headings' ) ? 'h1' : $wrap; # Build the output $output = sprintf( "<{$wrap} %s>", bizznis_attr( 'entry-title' ) ); $output .= "{$title}"; $output .= ""; echo apply_filters( 'bizznis_post_title_output', "$output \n" ); } /** * Echo the post image on archive pages. * * @since 1.0.0 */ add_action( 'bizznis_entry_content', 'bizznis_do_post_image' ); function bizznis_do_post_image() { # If this an archive page and the option is set to show thumbnail, then it gets the image size as per the theme setting, wraps it in the post permalink and echoes it. if ( ! is_singular() && bizznis_get_option( 'content_archive_thumbnail' ) ) { $img = bizznis_get_image( array( 'format' => 'html', 'size' => bizznis_get_option( 'image_size' ), 'context' => 'archive', 'attr' => bizznis_parse_attr( 'entry-image' ), ) ); if ( ! empty( $img ) ) { printf( '%s', get_permalink(), the_title_attribute( 'echo=0' ), $img ); } } } /** * Echo the post content. * * @since 1.0.0 */ add_action( 'bizznis_entry_content', 'bizznis_do_post_content' ); function bizznis_do_post_content() { global $post; # On single posts or pages it echoes the full content if ( is_singular() ) { the_content(); # optionally echoes the trackback string if enabled if ( is_single() && 'open' == get_option( 'default_ping_status' ) && post_type_supports( $post->post_type, 'trackbacks' ) ) { echo '' . "\n"; } # On single pages, also adds the edit link after the content. if ( is_page() && apply_filters( 'bizznis_edit_post_link', true ) ) { edit_post_link( __( '(Edit)', 'bizznis' ), '', '' ); } } elseif ( 'excerpts' == bizznis_get_option( 'content_archive' ) ) { the_excerpt(); } else { if ( bizznis_get_option( 'content_archive_limit' ) ) { the_content_limit( (int) bizznis_get_option( 'content_archive_limit' ), __( '[Read more...]', 'bizznis' ) ); } else { the_content( __( '[Read more...]', 'bizznis' ) ); } } } /** * Show permalink if no title. * * @since 1.0.0 */ add_action( 'bizznis_entry_content', 'bizznis_do_post_permalink' ); function bizznis_do_post_permalink() { # Don't show on singular views, or if the entry has a title if ( is_singular() || get_the_title() ) { return; } $permalink = get_permalink(); echo apply_filters( 'bizznis_post_permalink', sprintf( '

%s

', esc_url( $permalink ), __( 'Permalink', 'bizznis' ), esc_html( $permalink ) ) ); } /** * Display page links for paginated posts (i.e. includes the Quicktag one or more times). * * @since 1.0.0 */ add_action( 'bizznis_entry_content', 'bizznis_do_post_content_nav' ); function bizznis_do_post_content_nav() { wp_link_pages( array( 'before' => sprintf( '', ) ); } /** * Echo filterable content when there are no posts to show. * * @since 1.0.0 */ add_action( 'bizznis_loop_else', 'bizznis_do_noposts' ); function bizznis_do_noposts() { printf( '

%s

', apply_filters( 'bizznis_noposts_text', __( 'Sorry, no content matched your criteria.', 'bizznis' ) ) ); } /** * Echo the post info (byline) under the post title. * * @since 1.0.0 */ add_filter( 'bizznis_post_info', 'do_shortcode', 20 ); add_action( 'bizznis_entry_header', 'bizznis_post_info' ); function bizznis_post_info() { global $post; # Doesn't do post info on pages. if ( 'page' == get_post_type( $post->ID ) ) { return; } $post_info = apply_filters( 'bizznis_post_info', '[post_date] ' . __( 'by', 'bizznis' ) . ' [post_author_posts_link] [post_comments] [post_edit]' ); printf( '

%s

', $post_info ); } /** * Echo the opening structural markup for the entry footer. * * @since 1.0.0 */ add_action( 'bizznis_entry_footer', 'bizznis_entry_footer_markup_open', 5 ); function bizznis_entry_footer_markup_open() { printf( ''; } /** * Echo the post meta after the post content. * * @since 1.0.0 */ add_filter( 'bizznis_post_meta', 'do_shortcode', 20 ); add_action( 'bizznis_entry_footer', 'bizznis_post_meta' ); function bizznis_post_meta() { global $post; # Doesn't do post meta on pages. if ( 'page' == get_post_type( $post->ID ) ) { return; } $post_meta = apply_filters( 'bizznis_post_meta', '[post_categories] [post_tags]' ); printf( '

%s

', $post_meta ); } /** * Conditionally add the author box after single posts or pages. * * @since 1.0.0 */ add_action( 'bizznis_after_entry', 'bizznis_do_author_box_single' ); function bizznis_do_author_box_single() { if ( ! is_single() ) { return; } if ( get_the_author_meta( 'bizznis_author_box_single', get_the_author_meta( 'ID' ) ) ) { bizznis_author_box( 'single' ); } } /** * Echo the the author box and its contents. * * @since 1.0.0 */ function bizznis_author_box( $context = '', $echo = true ) { global $authordata; $authordata = is_object( $authordata ) ? $authordata : get_userdata( get_query_var( 'author' ) ); $gravatar_size = apply_filters( 'bizznis_author_box_gravatar_size', 70, $context ); $gravatar = get_avatar( get_the_author_meta( 'email' ), $gravatar_size ); $description = wpautop( get_the_author_meta( 'description' ) ); # The author box markup, contextual $title = apply_filters( 'bizznis_author_box_title', sprintf( '%s %s', __( 'About', 'bizznis' ), get_the_author() ), $context ); $pattern = sprintf( '
', bizznis_attr( 'author-box' ) ); $pattern .= '%s'; $pattern .= '
'; $pattern .= '

%s

'; $pattern .= '
%s
'; $pattern .= '
'; $pattern .= '
'; $output = apply_filters( 'bizznis_author_box', sprintf( $pattern, $gravatar, $title, $description ), $context, $pattern, $gravatar, $title, $description ); if ( $echo ) { echo $output; } else { return $output; } } /** * Conditionally echo post navigation in a format dependent on chosen setting. * * @since 1.0.0 */ add_action( 'bizznis_after_endwhile', 'bizznis_posts_nav' ); function bizznis_posts_nav() { $nav = bizznis_get_option( 'posts_nav' ); if( 'numeric' == $nav ) { bizznis_numeric_posts_nav(); } else { bizznis_prev_next_posts_nav(); } } /** * Echo post navigation in Previous Posts / Next Posts format. * * @since 1.0.0 */ function bizznis_prev_next_posts_nav() { $prev_link = get_previous_posts_link( apply_filters( 'bizznis_prev_link_text', '« ' . __( 'Previous Page', 'bizznis' ) ) ); $next_link = get_next_posts_link( apply_filters( 'bizznis_next_link_text', __( 'Next Page', 'bizznis' ) . ' »' ) ); $prev = $prev_link ? '
' . $prev_link . '
' : ''; $next = $next_link ? '
' . $next_link . '
' : ''; $nav = sprintf( ''; if ( $prev || $next ) { echo $nav; } } /** * Echo post navigation in page numbers format. * * @since 1.0.0 */ function bizznis_numeric_posts_nav() { # Stop on singular posts if( is_singular() ) { return; } global $wp_query; # Stop execution if there's only 1 page if( $wp_query->max_num_pages <= 1 ) { return; } $paged = get_query_var( 'paged' ) ? absint( get_query_var( 'paged' ) ) : 1; $max = intval( $wp_query->max_num_pages ); # Add current page to the array if ( $paged >= 1 ) { $links[] = $paged; } # Add the pages around the current page to the array if ( $paged >= 3 ) { $links[] = $paged - 1; $links[] = $paged - 2; } if ( ( $paged + 2 ) <= $max ) { $links[] = $paged + 2; $links[] = $paged + 1; } printf( '' . "\n"; } /** * Display links to previous and next post, from a single post. * * Optionally call it inside a child theme * * @since 1.0.0 */ // add_action( 'bizznis_after_entry', 'bizznis_prev_next_post_nav' ); function bizznis_prev_next_post_nav() { if ( ! is_singular( 'post' ) ) { return; } printf( ''; }