Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/giodc/giodc-woo-load-shortcodes-categories/archive/refs/heads/main.zipAutomatically injects pre-order and new product swiper carousels at the top of WooCommerce category pages when matching products exist for that category. If no matching products are found, nothing is rendered — zero impact on the frontend.
Features
- Detects the current product category and checks conditions before rendering anything
- Pre-order carousel — show products tagged (or meta-flagged) as pre-order in that category
- New arrivals carousel — show products published within a configurable number of days in that category
- Fully compatible with giodc-woo-swiper — shares its HTML structure, CSS classes, and Swiper JS initialisation
- Falls back to its own Swiper initialiser when giodc-woo-swiper is not active
- Both carousels also available as standalone shortcodes for manual placement
- Settings page under WooCommerce → Shortcode Injector
Requirements
- WordPress 5.8+
- WooCommerce 3.0+
- giodc-woo-swiper (recommended, not required)
Installation
- Upload the
giodc-woo-load-shortcodes-categoriesfolder to/wp-content/plugins/ - Activate the plugin via Plugins in the WordPress admin
- Go to WooCommerce → Shortcode Injector to configure
Pre-order Detection
Two methods are supported (configurable in settings):
| Method | How it works |
|---|---|
| Product Tag (default) | Add a WooCommerce product tag (e.g. pre-order) to any product you want treated as pre-order |
| Meta Field | Uses _is_pre_order = yes + _pre_order_date > now meta — compatible with the pre_order="yes" attribute from giodc-woo-swiper |
New Products Detection
Products published within the last N days (default: 30) in the current category are shown. Configurable under Days Threshold in settings.
Settings
Navigate to WooCommerce → Shortcode Injector:
| Setting | Default | Description |
|---|---|---|
| Pre-order Carousel | Enabled | Toggle the pre-order injection |
| New Products Carousel | Enabled | Toggle the new products injection |
| Detection Method | Tag | tag or meta |
| Pre-order Tag(s) | pre-order |
Comma-separated tag slugs |
| Days Threshold | 30 |
Days to look back for "new" products |
| Products Limit | 12 |
Max products per carousel |
| Desktop Columns | 5 |
Slides visible on desktop |
| Tablet Columns | 4 |
Slides visible on tablet |
| Mobile Columns | 2 |
Slides visible on mobile |
| Hide Pagination Dots | No | Hide swiper pagination |
| Pre-order Title | Pre-Order Products |
Heading above the carousel (leave empty to hide) |
| New Products Title | New Arrivals |
Heading above the carousel (leave empty to hide) |
Shortcodes
Both carousels are also available as standalone shortcodes:
Pre-order products in a category
[giodc_wlsc_preorder_by_category category="clothing" limit="12" desktop_columns="5" tablet_columns="4" mobile_columns="2" hide_dots="no" preorder_method="tag" preorder_tag="pre-order"]
New products in a category
[giodc_wlsc_new_by_category category="clothing" days="30" limit="12" desktop_columns="5" tablet_columns="4" mobile_columns="2" hide_dots="no"]
Both shortcodes accept comma-separated category slugs: category="clothing,accessories".
CSS Classes
The rendered HTML uses the same classes as giodc-woo-swiper:
.giodc-woo-swiper-container— outer wrapper.swiper— Swiper JS container.swiper-wrapper/.swiper-slide— standard Swiper markup.giodc-woo-swiper-product— product card
Wrapper elements added by this plugin:
.giodc-wlsc-section— wraps each carousel section.giodc-wlsc-preorder-section/.giodc-wlsc-new-products-section— section modifiers.giodc-wlsc-section-title— the<h2>heading
Changelog
1.0.0
- Initial release