diff --git a/README.md b/README.md index 09d72ba..5ab4f42 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ A simple breadcrumb package for Sage 10. ## Requirements - [Sage](https://github.com/roots/sage) >= 10.0 -- [PHP](https://secure.php.net/manual/en/install.php) >= 7.3 +- [PHP](https://secure.php.net/manual/en/install.php) >= 7.4 - [Composer](https://getcomposer.org/download/) ## Installation diff --git a/src/Crumb.php b/src/Crumb.php index 9349722..c47bdfd 100644 --- a/src/Crumb.php +++ b/src/Crumb.php @@ -38,14 +38,15 @@ public function __construct(array $config) protected function add($key, $value = null, $id = null, $blog = false) { if ( - ($value === true && empty($blog) || $blog === true) && + $blog === true && get_option('show_on_front') === 'page' && ! empty($blog = get_option('page_for_posts')) && ! empty($this->config['blog']) ) { $this->add( $this->config['blog'], - get_permalink($blog) + get_permalink($blog), + $blog ); } @@ -131,6 +132,8 @@ public function build() if (is_month()) { return $this->add( get_the_date('F Y'), + null, + null, true ); } @@ -138,12 +141,16 @@ public function build() if (is_year()) { return $this->add( get_the_date('Y'), + null, + null, true ); } return $this->add( get_the_date(), + null, + null, true ); }