承接 bootscore/bs-swiper 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bootscore/bs-swiper

Composer 安装命令:

composer require bootscore/bs-swiper

包简介

Swiper slider for Bootscore

README 文档

README

Packagist Prerelease Github All Releases

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

bs-swiper

Installation

  1. Download latest release bs-swiper.zip.
  2. In your admin panel, go to Plugins > and click the Add New button.
  3. Click Upload Plugin and Choose File, then select the Plugin's .zip file. Click Install Now.
  4. Click Activate to use your new Plugin right away.

Usage

Select template you want to use by replacing bs-swiper-* placeholder in shortcode examples.

  • bs-swiper-card shows items in 4 (xxl), 3 (lg), 2 (md) and 1 (sm) column cards.
  • bs-swiper-card-autoplay shows items in 4 (xxl), 3 (lg), 2 (md) and 1 (sm) column cards with autoplay.
  • bs-swiper-hero shows items in a hero slider with auto-slide effect. Items must have a featured-image.
  • bs-swiper-hero-fade shows items in a hero slider with auto-fade effect. Items must have a featured-image.
  • bs-swiper-card-product shows only WooCommerce products in 4 (xxl), 3 (lg), 2 (md) and 1 (sm) column cards.

Posts

Shortcode to show posts by category

[bs-swiper-* type="post" category="cars, boats" order="ASC" orderby="date" posts="6"]

Options

  • category="" - category-slug, multiple categories separated by comma
  • order="" - ASC or DESC
  • orderby="" - date, title, or rand
  • posts="" - amount of posts to show
  • excerpt="false" - hide excerpt
  • tags="false" - hide tags
  • categories="false" - hide categories

Shortcode to show posts by tags

[bs-swiper-* type="post" tax="post_tag" terms="bikes, motorbikes" order="DESC" orderby="date" posts="5"]

Options

  • tax="" - taxonomy (post_tag)
  • terms="" - tags-slug, multiple terms separated by comma
  • order="" - ASC or DESC
  • orderby="" - date, title, or rand
  • posts="" - amount of posts to show
  • excerpt="false" - hide excerpt
  • tags="false" - hide tags
  • categories="false" - hide categories

Shortcode to show single posts by id

[bs-swiper-* type="post" id="1, 15"]

Options

  • id="" - id of post, multiple ids separated by comma
  • excerpt="false" - hide excerpt
  • tags="false" - hide tags
  • categories="false" - hide categories

Pages

Shortcode to show child-pages by parent-page id

[bs-swiper-* type="page" post_parent="21" order="ASC" orderby="title" posts="6"]

Showing child-pages in parent-page is very useful to avoid empty parent-pages.

Options

  • post_parent="" - id of parent page
  • order="" - ASC or DESC
  • orderby="" - date, title, or rand
  • posts="" - amount of pages to show
  • excerpt="false" - hide excerpt

Shortcode to show single pages by id

[bs-* type="page" id="2, 25"]

Options

  • id="" - id of page, multiple ids separated by comma
  • excerpt="false" - hide excerpt

Custom Post Types

Shortcode to show custom-post-types by terms

[bs-swiper-* type="isotope" tax="isotope_category" terms="dogs, cats" order="DESC" orderby="date" posts="5"]

Options:

  • type="" - type of custom-post-type
  • tax="" - taxonomy
  • terms="" - terms-slug, multiple terms separated by comma
  • order="" - ASC or DESC
  • orderby="" - date, title, or rand
  • posts="" - amount of custom post types to show
  • excerpt="false" - hide excerpt

Shortcode to show single custom-post-types by id

[bs-* type="isotope" id="33, 31"]

Options

  • id="" - id of custom-post-type, multiple ids separated by comma
  • excerpt="false" - hide excerpt

WooCommerce Products

Shortcode to show products

[bs-swiper-card-product]

Options:

  • category="cars, boats" - Category slug, multiple categories separated by comma. Will pull products matching these categories (Default: '')
  • id="1, 2, 3" - id of product(s), multiple ids separated by comma. Will show products matching these ids (Default: '')
  • brand="brand1, brand2" - Will pull products matching these brands (Default: '')
  • posts="12" - Specify how many products will be shown (Default: -1)
  • orderby="date" - date, title or rand. Specify how products will be ordered by (Default: date)
  • order="DESC" - Specify if products will be ordered ASC or DESC (Default: DESC)
  • featured="true" - Will pull featured products (Default: false)
  • outofstock="false" - Will hide out of stock products (Default: true)
  • onsale="true" - Will show only onsale products (Default: '')
  • showhidden="true" Shows products hidden from catalog (Default: false)

Related posts

Bootscore v5.3.1 added a hook to all single-*.php's:

<?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 be removed by adding a filter to child's functions.php:

// Remove related posts
add_filter('bootscore_disable_related_posts', '__return_true');

Or by a single line of CSS:

.related-posts {
  display: none;
}

Overriding templates via theme

Template files can be found within the /bs-swiper/templates/ plugin directory.

Edit files in an upgrade-safe way using overrides. Copy the template into a directory within your theme named /bs-swiper/ keeping the same file structure but removing the /templates/ subdirectory. Path must be /your-theme/bs-swiper/[file].php.

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
  • sc-swiper-hero.php
  • sc-swiper-hero-fade.php

License & Credits

bootscore/bs-swiper 适用场景与选型建议

bootscore/bs-swiper 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 259 次下载、GitHub Stars 达 19, 最近一次更新时间为 2022 年 10 月 06 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「plugin」 「bootstrap」 「wordpress」 「slider」 「carousel」 「slideshow」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 bootscore/bs-swiper 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 bootscore/bs-swiper 我们能提供哪些服务?
定制开发 / 二次开发

基于 bootscore/bs-swiper 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 259
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 19
  • 点击次数: 22
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 19
  • Watchers: 1
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-10-06