Full Width Book Slider Shortcode
This shortcode generates a modern, full-width book slider. It is best suited for the Homepage Hero Section or a Featured Books area. It creates a split layout with the book content on one side and the cover image on the other.
Shortcode Name
[rswpbs_full_width_book_slider]
๐ How to Use
Basic Usage:
Displays the latest 10 books in a full-width slider format.
Code snippet
[rswpbs_full_width_book_slider]
Specific Books Usage:
Display only specific books by providing their IDs.
Code snippet
[rswpbs_full_width_book_slider book_ids="101,105,108"]
โ๏ธ Attributes (Parameters)
You can control the content and visibility of elements using these attributes:
| Attribute | Default | Accepted Values | Description |
book_ids | '' (Empty) | Comma separated IDs (e.g., 12,15,19) | Specify which books to display. If empty, it shows the latest 10 books. |
read_more_text | View Details | String | Custom text for the secondary button (e.g., “Learn More”). |
show_title | true | true, false | Show or hide the book title. |
show_author | true | true, false | Show or hide the author name. |
show_description | true | true, false | Show or hide the book excerpt (limited to 250 characters). |
show_image | true | true, false | Show or hide the book cover image. |
show_button_one | true | true, false | Show or hide the primary “Buy” button. |
show_button_two | true | true, false | Show or hide the secondary “View Details” button. |
slider_attr | '' | String (Key=Value pairs) | Advanced: Add custom HTML attributes to the slider wrapper. Format: data-speed=3000; data-autoplay=true. |
๐ก Usage Examples
1. Hero Section (Curated List)
Display 3 specific best-selling books with a “Get it Now” button text.
Code snippet
[rswpbs_full_width_book_slider book_ids="50,60,70" read_more_text="Get it Now" show_description="true"]
2. Minimalist Slider
A clean slider showing only the Title, Image, and Buy Button (hiding author and description).
Code snippet
[rswpbs_full_width_book_slider show_author="false" show_description="false" show_button_two="false"]
3. Advanced Slider Configuration
If your JS library needs specific data attributes (like autoplay speed), pass them via slider_attr. Note the syntax: separate attributes with a semicolon (;).
Code snippet
[rswpbs_full_width_book_slider slider_attr="data-autoplay=true; data-speed=5000; data-arrows=false"]
๐ Developer Notes
- Slider Attributes Parsing: The
slider_attrparameter uses a custom parser. Ensure you use the formatkey=value; key=value. The code explodes the string by;(semicolon + space) to generate HTML attributes. - Layout: The markup relies on Bootstrap-like classes (
rswpbs-col-lg-8,rswpbs-col-lg-4). Ensure the parent container supports full width for the best visual effect. - Query: If
book_idsis provided, the slider respects the order of IDs entered (orderby => post__in).
Was this article helpful?