Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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*
Expand Down
2 changes: 1 addition & 1 deletion header.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
echo esc_attr( ' has-custom-header');
}
?>">
<h1 class="site-title"><?php the_bootstrap_blog__site_title(); ?></h1><br/>
<h1 id="site-title" class="site-title"><?php the_bootstrap_blog__site_title(); ?></h1><br/>
<p class="lead site-description<?php
if ( ! $has_header_image ){
echo esc_attr( ' text-muted' );
Expand Down
47 changes: 47 additions & 0 deletions inc/customizer/customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,53 @@ public function render_content() {
)
);


/**
*
* Option three - Header as title
* Display post title in header section in place of sites title & tagline
*
* @since The Bootstrap Blog 0.1.5
*/

$wp_customize->add_section(
'header_as_title_section',
array(
'title' => __( 'Header as title', 'the-bootstrap-blog' ),
'description' => __( 'Display post title in header section in place of sites title and tagline', 'the-bootstrap-blog' ),
'description_hidden' => true,

) );

/**
* Display header as title
*
* @return boolean True on success, false on failure.
*/

$wp_customize->add_setting(
// $id
'header_as_title',
// $args
array(
'default' => false,
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'the_bootstrap_blog__sanitize_checkbox'
)
);

$wp_customize->add_control(
// $id
'header_as_title_control',
// $args
array(
'label' => __( 'Header as title', 'the-bootstrap-blog' ),
'settings' => 'header_as_title',
'section' => 'header_as_title_section',
'type' => 'checkbox'
)
);
}
add_action( 'customize_register', 'the_bootstrap_blog__theme_customize', 11 );

Expand Down
33 changes: 25 additions & 8 deletions inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -22,19 +22,27 @@ 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');
$site_title = __( '404', 'the-bootstrap-blog' );
}
elseif ( is_search() ) {
/* translators: %s: search query variable */
$site_title = sprintf ( __( 'Search for: <i>%s</i>', 'the-bootstrap-blog' ), get_search_query() );
}
elseif ( is_author() ) {
$site_title = __( 'Author', 'the-bootstrap-blog');
elseif ( is_author() ) {
$site_title = __( 'Author', 'the-bootstrap-blog' );
}
// if there is archive display: Archive
elseif ( is_archive() ) {
$site_title = __( 'Archive', 'the-bootstrap-blog');
elseif ( is_archive() ) {
$site_title = __( 'Archive', 'the-bootstrap-blog' );
}
// in other any cases display hyperlinked blog name
else {
Expand All @@ -53,9 +61,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' );
Expand Down
20 changes: 12 additions & 8 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
== The Bootstrap Blog ==
Requires at least: 5.5
Tested up to: 5.8
Tested up to: 6.0
Version: 0.1.4.4
License: GPL-2.0-or-later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand All @@ -12,7 +12,6 @@ A simple two-column blog template built with Bootstrap with custom navigation, h

Based on the popular Bootstrap 4 library, this theme shows how mobile friendly CSS framework can be used to create sleek, simple, fast and functional websites, with ease and intuitive way in modern front-end web developmen days.


== Installation ==

Manual installation:
Expand All @@ -38,7 +37,7 @@ Activiation and Use

== Copyright & License Notes ==

The Bootstrap Blog WordPress Theme, Copyright 2016-2021 Paweł Nowak
The Bootstrap Blog WordPress Theme, Copyright 2016-2022 Paweł Nowak
The Bootstrap Blog is distributed under the terms of the GNU GPL


Expand Down Expand Up @@ -139,27 +138,32 @@ 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 WordPres patch (51081)


=== 0.1.4.3 ===
*Released: July 24, 2021*
''Released: July 24, 2021''

* Fixed small issue with Akismet hidden textarea field

=== 0.1.4.1-2 ===
*Released: December 27, 2020*
''Released: December 27, 2020''

* Fixed small bugs in translations strings

=== 0.1.4 ===
*Released: December 26, 2020*
''Released: December 26, 2020''

* New features added:
** Custom footer text (with predefined tags)
Expand Down
7 changes: 5 additions & 2 deletions single.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@

<article id="post-<?php the_ID(); ?>" <?php post_class( 'blog-post' ); ?>>

<h2 class="blog-post-title"><?php the_bootstrap_blog__padlock(); the_title(); ?> <?php the_bootstrap_blog__sticky_pin(); ?></h2>
<?php if ( ! get_theme_mod( 'header_as_title' ) ) { ?>
<h2 class="blog-post-title"><?php the_bootstrap_blog__padlock(); the_title(); ?> <?php the_bootstrap_blog__sticky_pin(); ?></h2>

<?php // Get condition once so there is no repetitions
<?php }

// Get condition once so there is no repetitions
$password_required = post_password_required();

if ( ! $password_required ){ ?>
Expand Down
8 changes: 4 additions & 4 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
Theme Name: The Bootstrap Blog
Author: mrpauloen
Author URI: https://profiles.wordpress.org/mrpauloen/
Description: Based on the popular Bootstrap 4 library, this theme shows how mobile friendly CSS framework can be used to create sleek, simple, fast and functional websites, with ease and intuitive way in modern front-end web developmen days.
Version: 0.1.4.4
Description: A simple two-column WordPress theme, built on Bootstrap 4 with custom navigation, header, and type. Based on the popular Bootstrap 4 library, this theme shows how mobile friendly CSS framework can be used to create sleek, simple, fast and functional websites, with ease and intuitive way in modern front-end web developmen days.
Version: 0.1.5
Requires at least: 5.5
Tested up to: 5.8
Tested up to: 6.0
Requires PHP: 7.0
Tags: two-columns, custom-menu, custom-background, right-sidebar, custom-header, featured-images, sticky-post, theme-options, threaded-comments, translation-ready, blog
License: GPLv2 or later
Expand All @@ -15,7 +15,7 @@ Domain Path: /languages

== Copyright & License Notes ==

The Bootstrap Blog WordPress Theme, Copyright 2016-2021 Paweł Nowak
The Bootstrap Blog WordPress Theme, Copyright 2016-2022 Paweł Nowak
The Bootstrap Blog is distributed under the terms of the GNU GPL


Expand Down