> @@ -22,22 +54,55 @@ // Get posts format. $format = get_post_format(); - // Get elements. - $elements = responsive_page_single_elements_positioning(); - // Loop through elements. - foreach ( $elements as $element ) { + if ( get_theme_mod( 'responsive_page_title_layout', 'post_title_layout1' ) === 'post_title_layout1' ) { + // Get elements. + $elements = responsive_page_single_elements_positioning(); + ?> + + > + + + + + + ' . esc_html( $separator_text ) . ''; + $meta_items = array(); + + // Loop through meta sections. + foreach ( $sections as $section ) { + + if ( 'author' === $section ) { + ob_start(); + ?> + > + + + %3$s + + ', + esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), + esc_attr( sprintf( __( 'View all posts by %s', 'responsive' ), get_the_author() ) ), + esc_attr( wp_kses_post( get_the_author() ) ) + ); + ?> + + + + %2$s', + 'meta-prep meta-prep-author posted', + sprintf( + '%4$s', + esc_url( get_permalink() ), + esc_attr( get_the_title() ), + esc_html( get_the_date( 'c' ) ), + esc_html( get_the_date( 'M j, Y' ) ) + ) + ); + ?> + + + + ' . esc_html_e( 'Last updated on ', 'responsive' ) . '%2$s', + 'meta-prep meta-prep-author posted', + sprintf( + '%4$s', + esc_url( get_permalink() ), + esc_attr( get_the_title() ), + esc_html( get_the_modified_date( 'c' ) ), + esc_html( get_the_modified_date( 'M j, Y' ) ) + ) + ); + ?> + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/partials/page/tags.php b/partials/page/tags.php new file mode 100644 index 000000000..e7113daed --- /dev/null +++ b/partials/page/tags.php @@ -0,0 +1,26 @@ + + + + + + + + + diff --git a/partials/page/thumbnail.php b/partials/page/thumbnail.php index 1e8864ae8..882f6c19d 100644 --- a/partials/page/thumbnail.php +++ b/partials/page/thumbnail.php @@ -5,11 +5,42 @@ * @package responsive */ -?> - - +// Exit if accessed directly. +if ( ! defined( 'ABSPATH' ) ) { + exit; +} + +$page_featured_image_size = get_theme_mod( 'responsive_page_featured_image_size', 'full' ); +$page_featured_image_alignment = get_theme_mod( 'responsive_page_featured_image_alignment', 'left' ); +$page_featured_image_ratio = get_theme_mod( 'responsive_page_featured_image_ratio', 'original' ); + +$ratio_css = ''; +if ( 'predefined' === $page_featured_image_ratio ) { + $predefined_ratio = get_theme_mod( 'responsive_page_featured_image_predefined_ratio', '1:1' ); + $ratio_value = str_replace( ':', '/', $predefined_ratio ); + $ratio_css = 'aspect-ratio: ' . esc_attr( $ratio_value ) . ';'; +} elseif ( 'custom' === $page_featured_image_ratio ) { + $custom_width = get_theme_mod( 'responsive_page_featured_image_custom_width', '' ); + $custom_height = get_theme_mod( 'responsive_page_featured_image_custom_height', '' ); + if ( $custom_width && $custom_height ) { + $ratio_css = 'aspect-ratio: ' . esc_attr( $custom_width ) . '/' . esc_attr( $custom_height ) . ';'; + } +} + +// Image args. +$img_args = array(); +if ( responsive_get_schema_markup( 'image' ) ) { + $img_args['itemprop'] = 'thumbnailUrl'; +} + +if ( $ratio_css ) { + $img_args['style'] = $ratio_css . ' object-fit: cover;'; +} + +if ( has_post_thumbnail() ) : ?> + > - + - - + + diff --git a/partials/single/categories.php b/partials/single/categories.php new file mode 100644 index 000000000..0ff3fba5b --- /dev/null +++ b/partials/single/categories.php @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/partials/single/excerpt.php b/partials/single/excerpt.php new file mode 100644 index 000000000..3c1ee9b8f --- /dev/null +++ b/partials/single/excerpt.php @@ -0,0 +1,25 @@ + + + + + + + \ No newline at end of file diff --git a/partials/single/layout.php b/partials/single/layout.php index d9cf6b46f..368a4409d 100644 --- a/partials/single/layout.php +++ b/partials/single/layout.php @@ -10,8 +10,39 @@ exit; } Responsive\responsive_entry_before(); -?> +$single_featured_image_position = get_theme_mod( 'responsive_single_blog_featured_image_position', 'none' ); +$single_title_layout = get_theme_mod( 'responsive_single_blog_post_title_layout', 'post_title_layout1' ); +$single_featured_image_ratio = get_theme_mod( 'responsive_single_blog_featured_image_ratio', 'original' ); +$single_featured_image_alignment = get_theme_mod( 'responsive_single_blog_featured_image_alignment', 'left' ); + +$ratio_css = ''; +if ( 'predefined' === $single_featured_image_ratio ) { + $predefined_ratio = get_theme_mod( 'responsive_single_blog_featured_image_predefined_ratio', '1:1' ); + $ratio_value = str_replace( ':', '/', $predefined_ratio ); + $ratio_css = 'aspect-ratio: ' . esc_attr( $ratio_value ) . ';'; +} elseif ( 'custom' === $single_featured_image_ratio ) { + $custom_width = get_theme_mod( 'responsive_single_blog_featured_image_custom_width', '' ); + $custom_height = get_theme_mod( 'responsive_single_blog_featured_image_custom_height', '' ); + if ( $custom_width && $custom_height ) { + $ratio_css = 'aspect-ratio: ' . esc_attr( $custom_width ) . '/' . esc_attr( $custom_height ) . ';'; + } +} + +if ( in_array( $single_title_layout, array( 'post_title_layout1', 'post_title_layout2' ) ) && 'outside' === $single_featured_image_position && has_post_thumbnail() && ! post_password_required() ) { + ?> + + .responsive-single-post-featured-section.post-thumb img { ' . $ratio_css . ' object-fit: cover; width: 100%; height: 100%; }'; + } + $single_featured_image_size = get_theme_mod( 'responsive_single_blog_featured_image_size', 'full' ); + the_post_thumbnail( $single_featured_image_size ); + ?> + + > @@ -22,23 +53,52 @@ // Get posts format. $format = get_post_format(); - // Get elements. - $elements = responsive_blog_single_elements_positioning(); - // Loop through elements. - foreach ( $elements as $element ) { - - // Featured Image. - if ( 'featured_image' === $element - && ! post_password_required() ) { - - $format = $format ? $format : 'thumbnail'; - - get_template_part( 'partials/single/media/blog-single', $format ); - - } else { - get_template_part( 'partials/single/' . $element ); + if ( get_theme_mod( 'responsive_single_blog_post_title_layout', 'post_title_layout1' ) === 'post_title_layout1' ) { + // Get elements. + $elements = responsive_blog_single_elements_positioning(); + ?> + + > + + + @@ -74,12 +134,14 @@ '' . esc_html__( 'Previous Post is ', 'responsive' ) . ' ‹ %title', - 'next_text' => '' . esc_html__( 'Next Post is', 'responsive' ) . ' %title ›', - 'excluded_terms' => get_theme_mod( 'exclude_post_cat' ), - ) -); +if ( 1 === (int) get_theme_mod( 'responsive_single_blog_navigation', 0 ) ) { + the_post_navigation( + array( + 'prev_text' => '' . esc_html__( 'Previous Post is ', 'responsive' ) . ' ‹ %title', + 'next_text' => '' . esc_html__( 'Next Post is', 'responsive' ) . ' %title ›', + 'excluded_terms' => get_theme_mod( 'exclude_post_cat' ), + ) + ); +} Responsive\responsive_single_blog_related_posts_entry(); ?> diff --git a/partials/single/media/blog-single.php b/partials/single/media/blog-single.php index b94b16855..fb0aa235d 100644 --- a/partials/single/media/blog-single.php +++ b/partials/single/media/blog-single.php @@ -15,6 +15,24 @@ return; } +// Fetch Customizer Settings +$single_featured_image_size = get_theme_mod( 'responsive_single_blog_featured_image_size', 'full' ); +$single_featured_image_alignment = get_theme_mod( 'responsive_single_blog_featured_image_alignment', 'left' ); +$single_featured_image_ratio = get_theme_mod( 'responsive_single_blog_featured_image_ratio', 'original' ); + +$ratio_css = ''; +if ( 'predefined' === $single_featured_image_ratio ) { + $predefined_ratio = get_theme_mod( 'responsive_single_blog_featured_image_predefined_ratio', '1:1' ); + $ratio_value = str_replace( ':', '/', $predefined_ratio ); + $ratio_css = 'aspect-ratio: ' . esc_attr( $ratio_value ) . ';'; +} elseif ( 'custom' === $single_featured_image_ratio ) { + $custom_width = get_theme_mod( 'responsive_single_blog_featured_image_custom_width', '' ); + $custom_height = get_theme_mod( 'responsive_single_blog_featured_image_custom_height', '' ); + if ( $custom_width && $custom_height ) { + $ratio_css = 'aspect-ratio: ' . esc_attr( $custom_width ) . '/' . esc_attr( $custom_height ) . ';'; + } +} + // Image args. $img_args = array( 'alt' => get_the_title(), @@ -23,14 +41,18 @@ $img_args['itemprop'] = 'thumbnailUrl'; } +if ( $ratio_css ) { + $img_args['style'] = $ratio_css . ' object-fit: cover;'; +} + // Caption. $caption = get_the_post_thumbnail_caption(); ?> - + - %3$s ', @@ -60,14 +59,14 @@ ' . esc_html_e( 'Posted on ', 'responsive' ) . '%2$s', + '%2$s', 'meta-prep meta-prep-author posted', sprintf( '%4$s', esc_url( get_permalink() ), esc_attr( get_the_title() ), esc_html( get_the_date( 'c' ) ), - esc_html( get_the_date() ) + esc_html( get_the_date( 'M j, Y' ) ) ) ); ?> @@ -88,7 +87,7 @@ esc_url( get_permalink() ), esc_attr( get_the_title() ), esc_html( get_the_modified_date( 'c' ) ), - esc_html( get_the_modified_date() ) + esc_html( get_the_modified_date( 'M j, Y' ) ) ) ); ?> @@ -108,21 +107,10 @@ - - - - - - - - - diff --git a/readme.txt b/readme.txt index 0d006887f..7e7797aac 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: cyberchimps Requires at least: 5.0 Tested up to: 7.0 Requires PHP: 5.6 -Stable tag: 6.4.0 +Stable tag: 6.4.2 License: GPLv3 or later License URI: https://www.gnu.org/licenses/gpl-3.0.html diff --git a/sidebar.php b/sidebar.php index 2fd2202ee..88a4712e6 100644 --- a/sidebar.php +++ b/sidebar.php @@ -18,6 +18,9 @@ exit; } +if ( Responsive\Core\responsive_is_narrow_container_layout() ) { + return; +} Responsive\responsive_widgets_before(); // above widgets container hook. if ( class_exists( 'WooCommerce' ) && ( is_woocommerce() || is_cart() || is_checkout() ) ) { diff --git a/style.css b/style.css index 91883db3c..b19bb19e4 100644 --- a/style.css +++ b/style.css @@ -1,6 +1,6 @@ /** * Theme name: Responsive - * Version: 6.4.0 + * Version: 6.4.2 * Theme URI: https://cyberchimps.com/responsive/ * Author: CyberChimps * Author URI: https://cyberchimps.com
> @@ -22,23 +53,52 @@ // Get posts format. $format = get_post_format(); - // Get elements. - $elements = responsive_blog_single_elements_positioning(); - // Loop through elements. - foreach ( $elements as $element ) { - - // Featured Image. - if ( 'featured_image' === $element - && ! post_password_required() ) { - - $format = $format ? $format : 'thumbnail'; - - get_template_part( 'partials/single/media/blog-single', $format ); - - } else { - get_template_part( 'partials/single/' . $element ); + if ( get_theme_mod( 'responsive_single_blog_post_title_layout', 'post_title_layout1' ) === 'post_title_layout1' ) { + // Get elements. + $elements = responsive_blog_single_elements_positioning(); + ?> + + > + + + @@ -74,12 +134,14 @@