Book Slider Shortcode

This shortcode allows you to display a responsive slider or grid of books anywhere on your website. It supports various layouts, filtering options (by category, author, publisher), and customization settings.

Shortcode Name

[rswpbs_book_slider]


πŸš€ How to Use

Basic Usage:

Simply paste this code into any page or post to display the default book slider.

Code snippet

[rswpbs_book_slider]

Advanced Usage (Example):

Here is an example showing specific books with a custom layout:

Code snippet

[rswpbs_book_slider books_per_page="10" slider_style="carousel" image_position="left" show_price="true" categories_include="5,8"]

βš™οΈ Attributes (Parameters)

You can customize the slider using the following attributes:

1. General Settings

AttributeDefaultAccepted ValuesDescription
slider_stylecarouselcarousel, featuredDefines the layout style of the slider.
books_per_page6Number, -1 (for all)How many books to display total. Use -1 or unlimited to show all books.
book_offset'' (Empty)NumberNumber of books to skip from the beginning (useful for pagination).
orderDESCDESC, ASCSort order (Descending or Ascending).
orderbydatedate, title, rand, priceSort books by Date, Title, Random, or Price.

2. Filtering (Query Control)

AttributeDefaultDescription
categories_include''Comma-separated Category IDs to show books from specific categories.
categories_exclude''Comma-separated Category IDs to hide books from specific categories.
authors_include''Comma-separated Author IDs (Taxonomy) to include.
authors_exclude''Comma-separated Author IDs to exclude.
publishers_include''Comma-separated Publisher Names to include.
publishers_exclude''Comma-separated Publisher Names to exclude.
include_books''Comma-separated Book Post IDs to show only specific books.
exclude_books''Comma-separated Book Post IDs to hide specific books.

3. Layout & Design

AttributeDefaultAccepted ValuesDescription
image_positiontoptop, left, rightTop: Standard Card view.
Left/Right: List view (Image on side, content on other).
content_aligncentercenter, left, rightAlignment of the text content inside the book card.
sts_l_screen4NumberNumber of items visible on Large Screens (Desktop).
sts_m_screen3NumberNumber of items visible on Medium Screens (Tablet).
sts_s_screen1NumberNumber of items visible on Small Screens (Mobile).

4. Content Visibility

AttributeDefaultAccepted ValuesDescription
show_titletruetrue, falseShow or hide the book title.
title_typebook_namebook_name, defaultbook_name uses the custom book name field; default uses the WP Post Title.
show_authortruetrue, falseShow or hide the author name.
show_imagetruetrue, falseShow or hide the book cover image.
image_typebook_coverbook_cover, mockup_imageSwitch between standard cover or 3D mockup (Pro feature).
show_excerpttruetrue, falseShow or hide the short description.
excerpt_typeexcerptexcerpt, fullcontentDisplay the short excerpt or the full content.
excerpt_limit60NumberWord limit for the excerpt.
show_read_more_buttonfalsetrue, falseShow a “Read More” button linking to the book page.

5. eCommerce & Buttons

AttributeDefaultAccepted ValuesDescription
show_pricetruetrue, falseDisplay the book price.
show_buy_buttontruetrue, falseDisplay the external/affiliate buy button.
show_add_to_cart_btntruetrue, falseDisplay WooCommerce “Add to Cart” button (Requires integration).
show_msltruetrue, falseShow “Multiple Sales Links” (Pro feature).
msl_title_aligncentercenter, left, rightAlignment of the Multiple Sales Links title.

πŸ“ Notes for Developers

  • Backward Compatibility: The shortcode automatically converts old attributes (e.g., book_cover_position β†’ image_position) so old shortcodes won’t break.
  • WooCommerce: If rswpthemes_cptwoointegration function exists, the “Add to Cart” functionality will work for direct sales.
  • Pro Features: Some features like mockup_image and show_msl require the Pro version (Rswpbs_Pro class) to be active.

πŸ’‘ Usage Examples

Here are some common ways to use the shortcode with different configurations:

1. Standard Book Carousel

Display the latest 6 books in a default carousel slider.

Code snippet

[rswpbs_book_slider books_per_page="6" slider_style="carousel"]

2. List View (Image on Left)

Great for displaying detailed book reviews. This moves the book cover to the left and text to the right.

Code snippet

[rswpbs_book_slider image_position="left" content_align="left" show_excerpt="true" excerpt_limit="40"]

3. Specific Genre/Category Slider

Display books only from specific categories (e.g., “Fiction” or “Adventure”). Replace 10,12 with your category IDs.

Code snippet

[rswpbs_book_slider categories_include="10,12" books_per_page="8" show_price="true"]

4. Best Selling / Price Sorted

Show books sorted by price (High to Low) and display the “Add to Cart” button for direct sales.

Code snippet

[rswpbs_book_slider orderby="price" order="DESC" show_add_to_cart_btn="true" show_price="true"]

5. Minimalist Grid (Covers Only)

A clean look that hides the author, excerpt, and priceβ€”showing only the cover and title. Perfect for a sidebar or footer.

Code snippet

[rswpbs_book_slider show_author="false" show_excerpt="false" show_price="false" show_buy_button="false" sts_l_screen="5"]

Was this article helpful?

© 2026 RS WP Book Showcase. Built with ❀️ for authors.