%s', get_permalink(), 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(), CHILD_URL, 'post' ); } } endif; add_action( 'bizznis_entry_header', 'bizznis_entry_header_markup_open', 5 ); /** * Echo the opening structural markup for the entry header. * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_entry_header_markup_open' ) ) : function bizznis_entry_header_markup_open() { printf( '
', bizznis_attr( 'entry-header' ) ); } endif; add_action( 'bizznis_entry_header', 'bizznis_entry_header_markup_close', 15 ); /** * Echo the closing structural markup for the entry header. * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_entry_header_markup_close' ) ) : function bizznis_entry_header_markup_close() { echo '
'; } endif; add_action( 'bizznis_entry_header', 'bizznis_do_post_title' ); /** * Echo the title of a post. * * @since 1.0.0 */ if ( ! function_exists( '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(), $title ); } # Wrap in H1 on singular pages $wrap = is_singular() ? 'h1' : 'h2'; # Also, if HTML5 with semantic headings, wrap in H1 $wrap = apply_filters( 'bizznis_entry_header_wrap', $wrap ); # Build the output $output = sprintf( "<{$wrap} %s>", bizznis_attr( 'entry-title' ) ); $output .= "{$title}"; $output .= ""; echo apply_filters( 'bizznis_post_title_output', "$output \n" ); } endif; add_action( 'bizznis_entry_content', 'bizznis_do_post_image' ); /** * Echo the post image on archive pages. * * @since 1.0.0 */ if ( ! function_exists( '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', array ( 'alt' => get_the_title() ) ), ) ); if ( ! empty( $img ) ) { printf( '', get_permalink(), $img ); } } } endif; add_action( 'bizznis_entry_content', 'bizznis_do_post_content' ); /** * Echo the post content. * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_do_post_content' ) ) : function bizznis_do_post_content() { # 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( get_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( bizznis_a11y_more_link(__( '[Read more...]', 'bizznis' ) ) ); } } } endif; add_action( 'bizznis_entry_content', 'bizznis_do_post_permalink' ); /** * Show permalink if no title. * * @since 1.0.0 */ if ( ! function_exists( '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 ), esc_html( $permalink ) ) ); } endif; add_action( 'bizznis_entry_content', 'bizznis_do_post_content_nav' ); /** * Display page links for paginated posts (i.e. includes the Quicktag one or more times). * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_do_post_content_nav' ) ) : function bizznis_do_post_content_nav() { wp_link_pages( array( 'before' => sprintf( '', ) ); } endif; add_action( 'bizznis_loop_else', 'bizznis_do_noposts' ); /** * Echo filterable content when there are no posts to show. * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_do_noposts' ) ) : function bizznis_do_noposts() { printf( '

%s

', apply_filters( 'bizznis_noposts_text', __( 'Sorry, no content matched your criteria.', 'bizznis' ) ) ); } endif; add_filter( 'bizznis_post_info', 'do_shortcode', 20 ); add_action( 'bizznis_entry_header', 'bizznis_post_info' ); /** * Echo the post info (byline) under the post title. * * By default, only does post info on posts. * * The post info makes use of several shortcodes by default, and the whole output is filtered via `bizznis_post_info` * before echoing. * * @since 1.0.0 * @uses bizznis_markup() Contextual markup. * @return null Return early if post type lacks support. */ if ( ! function_exists( 'bizznis_post_info' ) ) : function bizznis_post_info() { # Filter for each post type. if ( ! post_type_supports( get_post_type(), 'bizznis-entry-meta-before-content' ) ) { return; } $filtered = apply_filters( 'bizznis_post_info', '[post_date] ' . __( 'by', 'bizznis' ) . ' [post_author_posts_link] [post_comments] [post_edit]' ); if ( empty( $filtered ) ) { return; } printf( '

' . $filtered . '

', bizznis_attr( 'entry-meta' ) ); } endif; add_action( 'bizznis_entry_footer', 'bizznis_entry_footer_markup_open', 5 ); /** * Echo the opening structural markup for the entry footer. * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_entry_footer_markup_open' ) ) : function bizznis_entry_footer_markup_open() { if ( post_type_supports( get_post_type(), 'bizznis-entry-meta-after-content' ) ) { printf( ''; } } endif; add_filter( 'bizznis_post_meta', 'do_shortcode', 20 ); add_action( 'bizznis_entry_footer', 'bizznis_post_meta' ); /** * Echo the post meta after the post content. * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_post_meta' ) ) : function bizznis_post_meta() { # Filter for each post type. if ( ! post_type_supports( get_post_type(), 'bizznis-entry-meta-after-content' ) ) { return; } $filtered = apply_filters( 'bizznis_post_meta', '[post_categories] [post_tags]' ); if ( empty( $filtered ) ) { return; } printf( '

' . $filtered . '

', bizznis_attr( 'entry-meta' ) ); } endif; add_action( 'bizznis_after_entry', 'bizznis_do_author_box_single' ); /** * Conditionally add the author box after single posts or pages. * * @since 1.0.0 */ if ( ! function_exists( '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' ); } } endif; /** * Echo the the author box and its contents. * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_author_box' ) ) : 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 = __( 'About', 'bizznis' ) . ' ' . get_the_author() . ''; /** * Author box title filter. * * Allows you to filter the title of the author box. $context passed as second parameter to allow for contextual filtering. * * @since unknown * * @param string $title Assembled Title. * @param string $context Context. */ $title = apply_filters( 'bizznis_author_box_title', $title, $context ); if ( 'single' === $context ) { $heading_element = 'h4'; } elseif ( bizznis_a11y( 'headings' ) || get_the_author_meta( 'headline', (int) get_query_var( 'author' ) ) ) { $heading_element = 'h4'; } else { $heading_element = 'h1'; } $pattern = sprintf( '
', bizznis_attr( 'author-box' ) ); $pattern .= '%s<' . $heading_element . ' class="author-box-title">%s'; $pattern .= '
%s
'; $pattern .= '
'; $output = apply_filters( 'bizznis_author_box', sprintf( $pattern, $gravatar, $title, $description ), $context, $pattern, $gravatar, $title, $description ); if ( $echo ) { echo $output; } else { return $output; } } endif; add_action( 'bizznis_after_entry', 'bizznis_after_entry_widget_area' ); /** * Display after-entry widget area on the bizznis_after_entry action hook. * * @since 1.1.0 * * @uses bizznis_widget_area() Output widget area. */ if ( ! function_exists( 'bizznis_after_entry_widget_area' ) ) : function bizznis_after_entry_widget_area() { if ( ! is_singular( 'post' ) ) { return; } bizznis_widget_area( 'after-entry', array( 'before' => '
', 'after' => '
', ) ); } endif; add_action( 'bizznis_after_endwhile', 'bizznis_posts_nav' ); /** * Conditionally echo post navigation in a format dependent on chosen setting. * * @since 1.0.0 */ if ( ! function_exists( '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(); } } endif; /** * Echo post navigation in Previous Posts / Next Posts format. * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_prev_next_posts_nav' ) ) : 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; } } endif; /** * Echo post navigation in page numbers format. * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_numeric_posts_nav' ) ) : 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"; } endif; // add_action( 'bizznis_after_entry', 'bizznis_prev_next_post_nav' ); /** * Display links to previous and next post, from a single post. * * Optionally call it inside a child theme * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_prev_next_post_nav' ) ) : function bizznis_prev_next_post_nav() { if ( ! is_singular( 'post' ) ) { return; } printf( ''; } endif; add_action( 'wp_head', 'bizznis_custom_post_header' ); /** * Apple custom header settings for indiviudal post * * @since 1.1.7 */ if ( ! function_exists( 'bizznis_custom_post_header' ) ) : function bizznis_custom_post_header() { if ( ! is_singular() ) { return; } $hide_header = bizznis_get_custom_field( '_bizznis_hide_header' ); if ( $hide_header ) { remove_action( 'bizznis_entry_header', 'bizznis_do_post_format_image', 5 ); remove_action( 'bizznis_entry_header', 'bizznis_entry_header_markup_open', 5 ); remove_action( 'bizznis_entry_header', 'bizznis_entry_header_markup_close', 15 ); remove_action( 'bizznis_entry_header', 'bizznis_post_info' ); remove_action( 'bizznis_entry_header', 'bizznis_do_post_title' ); } } endif;