Authors List Shortcode
This shortcode generates a responsive grid list of book authors. It comes with built-in AJAX Search and Load More functionality, allowing users to find authors easily without reloading the page.
Shortcode Name
[rswpbs_author_shortcode]
๐ How to Use
Basic Usage:
Simply paste this code into any page to display the author list with default settings (4 columns, 4 authors per load).
Code snippet
[rswpbs_author_shortcode]
Advanced Usage:
You can customize the number of columns and how many authors load at a time:
Code snippet
[rswpbs_author_shortcode authors_per_row="3" authors_per_page="9" show_description="false"]
โ๏ธ Attributes (Parameters)
Use the following attributes to customize the author list layout and content:
1. Layout & Grid Settings
| Attribute | Default | Accepted Values | Description |
authors_per_row | 4 | 1, 2, 3, 4, 6 | Defines how many authors to show in a single row. The layout automatically adjusts for mobile and tablet screens. |
authors_per_page | 4 | Number (e.g., 8, 12) | Sets how many authors are loaded initially and how many load when “Load More” is clicked. |
layout | standard_layout | standard_layout | Sets the visual style of the author card (reserved for future layouts). |
2. Content Visibility
| Attribute | Default | Accepted Values | Description |
show_description | true | true, false | Show or hide the author’s biography/description. |
show_book_count | true | true, false | Display the total number of books written by the author. |
๐ก Usage Examples
Here are some real-world examples of how to use this shortcode:
1. Standard 4-Column Grid
Best for desktops. Displays 4 authors per row and loads 8 authors per click.
Code snippet
[rswpbs_author_shortcode authors_per_row="4" authors_per_page="8"]
2. Large 3-Column Grid
Good for featuring authors with more details. Gives more space to each card.
Code snippet
[rswpbs_author_shortcode authors_per_row="3" authors_per_page="6"]
3. Minimalist List (Names Only)
Hides the description and book count for a clean, simple list of names.
Code snippet
[rswpbs_author_shortcode show_description="false" show_book_count="false" authors_per_row="6"]
4. Single Column List
Displays authors in a list view (1 per row), great for sidebars or mobile-focused pages.
Code snippet
[rswpbs_author_shortcode authors_per_row="1" authors_per_page="5"]
๐ Notes for Developers
- AJAX Capabilities: The search bar and “Load More” button use WordPress AJAX (
admin-ajax.php), ensuring a fast user experience without page refreshes. - Pro Features: If the
Rswpbs_Proclass allows, this shortcode will automatically fetch and display:- Author Profile Picture: (
rswpbs_book_author_picture) - Social Media Links: (
rswpbs_pro_book_author_social_links)
- Author Profile Picture: (
- Responsiveness: The grid columns adapt automatically based on
authors_per_row. For example, if you set it to4, it will show 1 column on mobile, 2 on tablets, and 4 on desktops.
Was this article helpful?