* @copyright Copyright (c) 2018, Chris Baldelomar * @link https://webplantmedia.com/product/brimstone-wordpress-theme/ * @license http://www.gnu.org/licenses/gpl-2.0.html */ if ( ! function_exists( 'brimstone_posted_on' ) ) : /** * Prints HTML with meta information for the current post-date/time and author. * * @since Brimstone 1.01 * * @return void */ function brimstone_posted_on() { $time_string = ''; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = ''; } $time_string = sprintf( $time_string, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ) ); $posted_on = '' . $time_string . ''; echo '' . $posted_on . ''; // WPCS: XSS OK. } endif; if ( ! function_exists( 'brimstone_entry_header' ) ) : /** * Prints HTML with meta information for the categories, tags and comments. * * @since Brimstone 1.01 * * @param string $delimeter * @return void */ function brimstone_entry_header( $delimeter = '' ) { // Hide category and tag text for pages. if ( 'post' === get_post_type() ) { /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list( $delimeter, 'brimstone' ); if ( $categories_list ) { /* translators: 1: list of categories. */ printf( '%1$s', $categories_list ); // WPCS: XSS OK. } } } endif; if ( ! function_exists( 'brimstone_entry_footer' ) ) : /** * Prints HTML with meta information for the categories, tags and comments. * * @since Brimstone 1.01 * * @return void */ function brimstone_entry_footer() { // Hide category and tag text for pages. if ( 'post' === get_post_type() ) { $byline = sprintf( /* translators: %s: post author. */ esc_html_x( 'By %s', 'post author', 'brimstone' ), '' . esc_html( get_the_author() ) . '' ); echo ' ' . $byline . ''; // WPCS: XSS OK. /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list( esc_html__( ', ', 'brimstone' ) ); if ( $categories_list ) { /* translators: 1: list of categories. */ printf( '' . esc_html__( 'In %1$s', 'brimstone' ) . '', $categories_list ); // WPCS: XSS OK. } /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_tag_list( '', esc_html_x( ', ', 'list item separator', 'brimstone' ) ); if ( $tags_list ) { /* translators: 1: list of tags. */ printf( '' . esc_html__( 'Tagged %1$s', 'brimstone' ) . '', $tags_list ); // WPCS: XSS OK. } } if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) { echo ''; comments_popup_link( esc_html__( 'Leave a Comment', 'brimstone' ) ); echo ''; } edit_post_link( sprintf( '%1$s %2$s', esc_html__( 'Edit', 'brimstone' ), get_the_title() ), '', '' ); } endif; if ( ! function_exists( 'brimstone_the_term_description' ) ) : /** * Display term description * * @since Brimstone 1.01 * * @return void */ function brimstone_the_term_description() { $description = term_description(); ?>
wp_get_attachment_url() ); if ( ! empty( $meta['width'] ) && ! empty( $meta['height'] ) ) { $atts['width'] = (int) $meta['width']; $atts['height'] = (int) $meta['height']; } if ( has_post_thumbnail() ) { $atts['poster'] = wp_get_attachment_url( get_post_thumbnail_id() ); } $p = wp_video_shortcode( $atts ); } elseif ( wp_attachment_is( 'audio' ) ) { $p = wp_audio_shortcode( array( 'src' => wp_get_attachment_url() ) ); } else { // show the medium sized image representation of the attachment if available, and link to the raw file. $image_size = apply_filters( 'brimstone_attachment_size', 'large' ); $p = wp_get_attachment_link( 0, $image_size, false ); } return $p; } endif; if ( ! function_exists( 'brimstone_the_attachment' ) ) : /** * Display attachment image wrapper * * @since Brimstone 1.01 * * @return void */ function brimstone_the_attachment() { echo brimstone_get_the_attachment(); /* WPCS: XSS OK. HTML output. */ } endif; if ( ! function_exists( 'brimstone_featured_post_navigation' ) ) : /** * Display post navigation. * * @since Brimstone 1.01 * * @return void */ function brimstone_featured_post_navigation() { global $brimstone; if ( $brimstone['blog_single_hide_post_navigation'] ) { return; } // remove filter to keep featured images on post navigation. if ( function_exists( 'jetpack_featured_images_remove_post_thumbnail' ) ) { remove_filter( 'get_post_metadata', 'jetpack_featured_images_remove_post_thumbnail', true, 4 ); } $prev_text = ''; $next_text = ''; // Previous/next post navigation. $next_post = get_next_post(); if ( $next_post ) { $next_text .= get_the_post_thumbnail( $next_post->ID, 'thumbnail' ); } $previous_post = get_previous_post(); if ( $previous_post ) { $prev_text .= get_the_post_thumbnail( $previous_post->ID, 'thumbnail' ); } $next_text .= ' ' . '' . esc_html__( 'Next post:', 'brimstone' ) . ' ' . '%title'; $prev_text .= ' ' . '' . esc_html__( 'Previous post:', 'brimstone' ) . ' ' . '%title'; the_post_navigation( array( 'next_text' => $next_text, 'prev_text' => $prev_text, ) ); } endif; if ( ! function_exists( 'brimstone_parent_post_navigation' ) ) : /** * Display parent post navigation * * @since Brimstone 1.01 * * @return void */ function brimstone_parent_post_navigation() { global $brimstone; $post = get_post(); // remove filter to keep featured images on post navigation. if ( function_exists( 'jetpack_featured_images_remove_post_thumbnail' ) ) { remove_filter( 'get_post_metadata', 'jetpack_featured_images_remove_post_thumbnail', true, 4 ); } $prev_text = ''; // Previous/next post navigation. $parent_post_id = wp_get_post_parent_id( $post->ID ); if ( ! $parent_post_id ) { return; } $parent_post = get_post( $parent_post_id ); if ( $parent_post ) { $prev_text .= get_the_post_thumbnail( $parent_post->ID, 'thumbnail' ); } $prev_text .= ' ' . '' . esc_html__( 'Parent post:', 'brimstone' ) . ' ' . '%title'; the_post_navigation( array( 'prev_text' => $prev_text, ) ); } endif;