Giter Club home page Giter Club logo

bs-grid's Introduction

bs Grid

Packagist Prerelease Github All Releases

WordPress plugin to show posts, pages or custom-post-types in grid / list cards, heroes, accordion or tabs via shortcode in Bootscore theme.

bs-grid

Installation

  1. Download latest release bs-grid.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-* placeholder in shortcode examples.

[bs-grid]
  • bs-grid shows items in 4 (xxl), 3 (lg), 2 (md) and 1 (sm) column cards.
  • bs-list shows items in 1 column vertical cards (md) and flip into 1 column horizontal cards (lg).
  • bs-hero shows hero items with background-images.
  • bs-accordion shows items with full content in a Bootstrap accordion.
  • bs-tabs shows items with full content in Bootstrap tabs.

Posts

Shortcode to show posts by category

[bs-* 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
Additional options bs-grid, bs-list and bs-hero
  • excerpt="false" hide excerpt
  • tags="false" hide tags
  • categories="false" hide categories

Shortcode to show posts by tags

[bs-* 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
Additional options bs-grid, bs-list and bs-hero
  • excerpt="false" hide excerpt
  • tags="false" hide tags
  • categories="false" hide categories

Shortcode to show single posts by id

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

Options

  • id="" post id, multiple ids separated by comma
  • order="" ASC or DESC
  • orderby="" date, title, or rand
Additional options bs-grid, bs-list and bs-hero
  • excerpt="false" hide excerpt
  • tags="false" hide tags
  • categories="false" hide categories

Pages

Shortcode to show child-pages by parent-page id

[bs-* 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="" parent-page id
  • order="" ASC or DESC
  • orderby="" date, title, or rand
  • posts="" amount of pages
Additional options bs-grid, bs-list and bs-hero
  • excerpt="false" hide excerpt

Shortcode to show single pages by id

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

Options

  • id="" page id, multiple ids separated by comma
  • order="" ASC or DESC
  • orderby="" date, title, or rand
Additional options bs-grid, bs-list and bs-hero
  • excerpt="false" hide excerpt

Custom Post Types

Shortcode to show custom-post-types by terms

[bs-* 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
Additional options bs-grid, bs-list and bs-hero
  • excerpt="false" hide excerpt

Shortcode to show single custom-post-types by id

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

Options

  • id="" custom-post-type's id, multiple ids separated by comma
  • order="" ASC or DESC
  • orderby="" date, title, or rand
Additional options bs-grid, bs-list and bs-hero
  • excerpt="false" hide excerpt

Overriding templates via theme

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

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

The copied file will now override the bs Grid template file. Change cards, classes or HTML as you want.

Templates that can be overridden

  • sc-grid.php
  • sc-list.php
  • sc-hero.php
  • sc-accordion.php
  • sc-tabs.php

License & Credits

bs-grid's People

Contributors

crftwrk avatar dogbytemarketing avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

bs-grid's Issues

BS-Grid should not list private pages

Hello! am I right in decision that BS-Grid should exclude pages and posts marked 'private'?

As I read in WP documentation, private post is blocked from the public. Those with the right user access are able to see the private post if they log into the WordPress dashboard.

Related posts

Hello,
I'm sorry to post as an issue but there are not discussions tabs for this plugin.

Is it possible to exclude a specific ID from the shortcode ? I'm using this plugin as related posts on each post. But it displays also the current post. In my specific case, I find this not very useful.

My current shortcdode:
<?php echo do_shortcode('[bs-grid type="post" tax="post_tag" terms="'.tag_solo().'" order="desc" orderby="date" posts="4"]'); ?>

Thank you !

Post rating in the grid?

I am using another plugin (wpDiscuz) to collect ratings and comments of posts.
I am thinking of also showing the average rating in the bs-grid content.
Do you think it is achievable by adding extra code to the template?

Fix term field to use slug instead of name in all templates

According to the instructions on the plugin page, you're supposed to use the term slug... however in the query, the field is set to 'name' instead of 'slug' so unless the term name matches the slug nothing is returned.

$options['tax_query'] = array(array(
      'taxonomy' => $tax,
      'field'    => 'name',
      'terms'    => $terms,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.