Skip to content

Commit

Permalink
Merge pull request #34 from bootscore/v5.3.0
Browse files Browse the repository at this point in the history
5.3.0
  • Loading branch information
crftwrk authored Aug 11, 2023
2 parents 5b3e48c + d8e7456 commit 5a52162
Show file tree
Hide file tree
Showing 10 changed files with 131 additions and 96 deletions.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# bS Swiper

WordPress plugin to show posts, pages, custom-post-types or WooCommerce products in a swiper.js carousel in bootScore theme.
WordPress plugin to show posts, pages, custom post types or WooCommerce products in a swiper.js carousel in bootScore theme.

- Demo and documentation: https://bootscore.me/documentation/bs-swiper/

Expand Down Expand Up @@ -97,6 +97,23 @@ Showing child-pages in parent-page is very useful to avoid empty parent-pages.
- orderby: date, title, or rand
- posts: amount of products to show

## Related posts (v5.3.0)
bootScore v5.3.1 added a hook to all `single-*.php`'s:

```php
<?php if (function_exists('bootscore_related_posts')) bootscore_related_posts(); ?>
```

bS Swiper hooks related posts there showing the latest 12 posts from the same category. This means that the category should have at least 4 posts to show the related posts correctly.

Related posts can simply be hidden by removing the hook in your child's `single-*.php` or by using a single line of CSS:

```css
.related-posts {
display: none;
}
```

## Overriding templates via theme
Template files can be found within the **/bs-swiper-main/templates/** plugin directory.

Expand All @@ -105,6 +122,7 @@ Edit files in an upgrade-safe way using overrides. Copy the template into a dire
The copied file will now override the bS Swiper template file. Change cards, classes or HTML as you want.

### Templates that can be overridden
- related-posts.php
- sc-swiper-card.php
- sc-swiper-card-autoplay.php
- sc-swiper-card-product.php
Expand Down
7 changes: 5 additions & 2 deletions main.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?php
/*Plugin Name: bS Swiper
Plugin URI: https://bootscore.me/plugins/bs-swiper/
Description: Plugin to show posts, pages, custom post types or WooCommerce products in a swiper.js carousel for bootScore theme. <a href="https://bootscore.me/documentation/bs-swiper/">Documentation</a> | <a href="https://bootscore.me/shop/products/free/bs5-swiper/">Changelog</a>
Version: 5.2.1
Description: Plugin to show posts, pages, custom post types or WooCommerce products in a swiper.js carousel for bootScore theme. <a href="https://bootscore.me/documentation/bs-swiper/">Documentation</a> | <a href="https://bootscore.me/documentation/bs-swiper/#Changelog">Changelog</a>
Version: 5.3.0
Tested up to: 6.3
Requires at least: 5.0
Requires PHP: 5.6
Author: bootScore
Author URI: https://bootscore.me
License: MIT License
Expand Down
15 changes: 10 additions & 5 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

Contributors: Bastian Kreiter, torricelli, Sean Emerson

Requires at least: 4.5
Tested up to: 6.2
Stable tag: 5.3.0
Tested up to: 6.3
Requires at least: 5.0
Requires PHP: 5.6
Stable tag: 5.2.1
License: MIT License
License URI: https://github.com/bootscore/bs-swiper/blob/main/LICENSE

Expand Down Expand Up @@ -117,7 +117,13 @@ Plugin to show posts, pages, custom post types or WooCommerce products in a swip

== Changelog ==

= 5.2.0 - April 26 2023 =
= 5.3.0 - August 11 2023 =

* [FEATURE] Related posts template #31
* [IMPROVEMENT] Change --bs-primary to --bs-link-color (Dark Mode) 5b3e48c
* [BUGFIX] Undefined variable in sc-product.php #33

= 5.2.1 - April 26 2023 =

* [IMPROVEMENT] Replace PHP echo's with shorthand
* [IMPROVEMENT] Change bullet CSS variable to body color
Expand Down Expand Up @@ -189,4 +195,3 @@ Plugin to show posts, pages, custom post types or WooCommerce products in a swip

* Initial release


8 changes: 5 additions & 3 deletions templates/related-posts.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<?php

/*
* Adds related posts to single_*.php. Needs at least bootScore 5.3.1
*
* This template can be overriden by copying this file to your-theme/bs-swiper-main/related-posts.php
*
* @author bootScore
* @package bS Swiper
* @version 5.3.0
* @author bootScore
* @package bS Swiper
* @version 5.3.0
*
*/

function bootscore_related_posts() {
Expand Down
39 changes: 20 additions & 19 deletions templates/sc-swiper-card-autoplay.php
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
<?php
/*

/*
*
* Post/Page/CPT Card Autoplay slider template.
*
* This template can be overriden by copying this file to your-theme/bs-swiper-main/sc-swiper-card.php
*
* @author bootScore
* @package bS Swiper
* @version 5.2.1
Posts:
[bs-swiper-card-autoplay type="post" category="cars, boats" order="ASC" orderby="date" posts="6"]
Child-pages:
[bs-swiper-card-autoplay type="page" post_parent="21" order="ASC" orderby="title" posts="6"]
Custom post types:
[bs-swiper-card-autoplay type="isotope" tax="isotope_category" terms="dogs, cats" order="DESC" orderby="date" posts="5"]
Single items:
[bs-swiper-card-autoplay type="post" id="1, 15"]
[bs-swiper-card-autoplay type="page" id="2, 25"]
[bs-swiper-card-autoplay type="isotope" id="33, 31"]
* @author bootScore
* @package bS Swiper
* @version 5.3.0
*
* Posts:
* [bs-swiper-card-autoplay type="post" category="cars, boats" order="ASC" orderby="date" posts="6"]
*
* Child-pages:
* [bs-swiper-card-autoplay type="page" post_parent="21" order="ASC" orderby="title" posts="6"]
*
* Custom post types:
* [bs-swiper-card-autoplay type="isotope" tax="isotope_category" terms="dogs, cats" order="DESC" orderby="date" posts="5"]
*
* Single items:
* [bs-swiper-card-autoplay type="post" id="1, 15"]
* [bs-swiper-card-autoplay type="page" id="2, 25"]
* [bs-swiper-card-autoplay type="isotope" id="33, 31"]
*
*/


Expand Down
17 changes: 9 additions & 8 deletions templates/sc-swiper-card-product.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<?php
/*

/*
*
* Product slider template.
*
* This template can be overriden by copying this file to your-theme/bs-swiper-main/sc-swiper-card-product.php
*
* @author bootScore
* @package bS Swiper
* @version 5.3.0
Product Slider Shortcode
[bs-swiper-card-product order="DESC" orderby="date" posts="12" category="theme, child-themes, free, plugins"]
* @author bootScore
* @package bS Swiper
* @version 5.3.0
*
* Product Slider Shortcode
* [bs-swiper-card-product order="DESC" orderby="date" posts="12" category="theme, child-themes, free, plugins"]
*
*/


Expand Down
39 changes: 20 additions & 19 deletions templates/sc-swiper-card.php
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
<?php
/*

/*
*
* Post/Page/CPT Card slider template.
*
* This template can be overriden by copying this file to your-theme/bs-swiper-main/sc-swiper-card.php
*
* @author bootScore
* @package bS Swiper
* @version 5.2.1
Posts:
[bs-swiper-card type="post" category="cars, boats" order="ASC" orderby="date" posts="6"]
Child-pages:
[bs-swiper-card type="page" post_parent="21" order="ASC" orderby="title" posts="6"]
Custom post types:
[bs-swiper-card type="isotope" tax="isotope_category" terms="dogs, cats" order="DESC" orderby="date" posts="5"]
Single items:
[bs-swiper-card type="post" id="1, 15"]
[bs-swiper-card type="page" id="2, 25"]
[bs-swiper-card type="isotope" id="33, 31"]
* @author bootScore
* @package bS Swiper
* @version 5.3.0
*
* Posts:
* [bs-swiper-card type="post" category="cars, boats" order="ASC" orderby="date" posts="6"]
*
* Child-pages:
* [bs-swiper-card type="page" post_parent="21" order="ASC" orderby="title" posts="6"]
*
* Custom post types:
* [bs-swiper-card type="isotope" tax="isotope_category" terms="dogs, cats" order="DESC" orderby="date" posts="5"]
*
* Single items:
* [bs-swiper-card type="post" id="1, 15"]
* [bs-swiper-card type="page" id="2, 25"]
* [bs-swiper-card type="isotope" id="33, 31"]
*
*/


Expand Down
38 changes: 20 additions & 18 deletions templates/sc-swiper-hero-fade.php
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
<?php
/*

/*
*
* Post/Page/CPT Hero fade slider template.
*
* This template can be overriden by copying this file to your-theme/bs-swiper-main/sc-swiper-hero.php
*
* @author bootScore
* @package bS Swiper
* @version 5.2.0
Posts:
[bs-swiper-hero-fade type="post" category="cars, boats" order="ASC" orderby="date" posts="6"]
Child-pages:
[bs-swiper-hero-fade type="page" post_parent="21" order="ASC" orderby="title" posts="6"]
Custom post types:
[bs-swiper-hero-fade type="isotope" tax="isotope_category" terms="dogs, cats" order="DESC" orderby="date" posts="5"]
Single items:
[bs-swiper-hero-fade type="post" id="1, 15"]
[bs-swiper-hero-fade type="page" id="2, 25"]
[bs-swiper-hero-fade type="isotope" id="33, 31"]
* @author bootScore
* @package bS Swiper
* @version 5.3.0
*
* Posts:
* [bs-swiper-hero-fade type="post" category="cars, boats" order="ASC" orderby="date" posts="6"]
*
* Child-pages:
* [bs-swiper-hero-fade type="page" post_parent="21" order="ASC" orderby="title" posts="6"]
*
* Custom post types:
* [bs-swiper-hero-fade type="isotope" tax="isotope_category" terms="dogs, cats" order="DESC" orderby="date" posts="5"]
*
* Single items:
* [bs-swiper-hero-fade type="post" id="1, 15"]
* [bs-swiper-hero-fade type="page" id="2, 25"]
* [bs-swiper-hero-fade type="isotope" id="33, 31"]
*
*/


Expand Down
38 changes: 20 additions & 18 deletions templates/sc-swiper-hero.php
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
<?php
/*

/*
*
* Post/Page/CPT Hero slider template.
*
* This template can be overriden by copying this file to your-theme/bs-swiper-main/sc-swiper-hero.php
*
* @author bootScore
* @package bS Swiper
* @version 5.2.0
Posts:
[bs-swiper-hero type="post" category="cars, boats" order="ASC" orderby="date" posts="6"]
Child-pages:
[bs-swiper-hero type="page" post_parent="21" order="ASC" orderby="title" posts="6"]
Custom post types:
[bs-swiper-hero type="isotope" tax="isotope_category" terms="dogs, cats" order="DESC" orderby="date" posts="5"]
Single items:
[bs-swiper-hero type="post" id="1, 15"]
[bs-swiper-hero type="page" id="2, 25"]
[bs-swiper-hero type="isotope" id="33, 31"]
* @author bootScore
* @package bS Swiper
* @version 5.3.0
*
* Posts:
* [bs-swiper-hero type="post" category="cars, boats" order="ASC" orderby="date" posts="6"]
*
* Child-pages:
* [bs-swiper-hero type="page" post_parent="21" order="ASC" orderby="title" posts="6"]
*
* Custom post types:
* [bs-swiper-hero type="isotope" tax="isotope_category" terms="dogs, cats" order="DESC" orderby="date" posts="5"]
*
* Single items:
* [bs-swiper-hero type="post" id="1, 15"]
* [bs-swiper-hero type="page" id="2, 25"]
* [bs-swiper-hero type="isotope" id="33, 31"]
*
*/


Expand Down
6 changes: 3 additions & 3 deletions update/plugin.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name" : "bS Swiper",
"version" : "5.2.1",
"download_url" : "https://github.com/bootscore/bs-swiper/releases/download/v5.2.1/bs-swiper-main.zip",
"version" : "5.3.0",
"download_url" : "https://github.com/bootscore/bs-swiper/releases/download/v5.3.0/bs-swiper-main.zip",
"sections" : {
"description" : "Replace PHP echo's with shorthand"
"description" : "New related posts template. Needs at least bootScore 5.3.1 to show them."
}
}

0 comments on commit 5a52162

Please sign in to comment.