From 9a5b76dfbdfa49c8e9bc2e58a2a3f5dd25697f8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82?= <69369238+mrpauloen@users.noreply.github.com> Date: Tue, 23 Aug 2022 20:52:17 +0200 Subject: [PATCH 1/3] New branch --- inc/template-tags.php | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/inc/template-tags.php b/inc/template-tags.php index 53403e9..9b93d23 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -11,7 +11,7 @@ * * This function changes the way you see (in header section) * your site tile (or blog name), depends on different pages - * See line: 36 in header.php file + * See line: 61 in header.php file * * @since The Bootstrap Blog 0.1 */ @@ -22,6 +22,13 @@ function the_bootstrap_blog__site_title(){ if ( is_attachment() ) { $site_title = __( 'Attachment', 'the-bootstrap-blog'); } + // if feature is active, it display post title instead of site title, + // then site title from the article container is removed + // since v 0.1.5 + elseif ( is_single() and get_theme_mod( 'header_as_title' ) ){ + $site_title = the_bootstrap_blog__padlock() . single_post_title('', FALSE); + } + elseif ( is_404() ) { $site_title = __( '404', 'the-bootstrap-blog'); } @@ -53,9 +60,18 @@ function the_bootstrap_blog__site_title(){ * @since The Bootstrap Blog 0.1.4 */ function the_bootstrap_blog__site_description(){ - global $wp_query; + global $wp_query, $post; - if ( is_archive() ){ + // if there is attachment page display: Attachment + if ( is_attachment() ) { + echo get_queried_object()->post_title; + } + // if feature is active, it display post excerpt instead of site description, + elseif ( is_single() and get_theme_mod( 'header_as_title' ) ){ + remove_filter( 'get_the_excerpt', 'the_bootstrap_blog__filter__excerpt_more' ); + echo get_the_excerpt( $post ); + } + elseif ( is_archive() ){ the_archive_title(); } elseif ( is_404() ) { esc_html_e( 'Sorry, no posts matched your criteria.', 'the-bootstrap-blog' ); From 9dc0f93190d0c8a7fb82cc30e26bda5de77e53c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82?= <69369238+mrpauloen@users.noreply.github.com> Date: Thu, 25 Aug 2022 21:19:36 +0200 Subject: [PATCH 2/3] Header as title feature --- README.md | 13 +++++++--- header.php | 2 +- inc/customizer/customizer.php | 47 +++++++++++++++++++++++++++++++++++ inc/template-tags.php | 21 ++++++++-------- readme.txt | 22 +++++++++------- single.php | 7 ++++-- style.css | 6 ++--- 7 files changed, 89 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 6d84189..c28953c 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,9 @@ Summary: | The Bootstrap Blog -------------------|---------------- Contributors: | [mrpauloen](https://profiles.wordpress.org/mrpauloen/) -Version: | 0.1.4.4 +Version: | 0.1.5 Requires at least: | 5.5 -Tested up to: | 5.8 +Tested up to: | 6.0 Requires PHP: | 7.0 License: | GPLv2 or later License URI: | http://www.gnu.org/licenses/gpl-2.0.html @@ -148,13 +148,18 @@ https://wordpress.org/support/theme/the-bootstrap-blog ## Changelog +### 0.1.5 +*Released: August, 2022* + +* Added: Header as Title feature + ### 0.1.4.4 -*Released: November 14, 2021 +*Released: November 14, 2021* * Added: support JS - Remove the `no-js` class from body if JS is supported * Removed: unnecessary comment_reply_link filter hook - - fixed by new patch (51081) + - fixed by new WordPress patch (51081) ### 0.1.4.3 *Released: July 24, 2021* diff --git a/header.php b/header.php index 7efc02b..8169b2e 100644 --- a/header.php +++ b/header.php @@ -58,7 +58,7 @@ echo esc_attr( ' has-custom-header'); } ?>"> -