ORANGECOLLAR/MODULE-WORDPRESS-INTEGRATION · WIDGETS
Embed WordPress blog content anywhere on your storefront with CMS widgets
The module provides three CMS widgets for embedding WordPress content in any Magento CMS page, block, or layout position.
Available Widgets
Recent Posts Widget
Displays a configurable list of the most recent blog posts.
Widget type identifier: OrangeCollar\WordPressIntegration\Block\Widget\RecentPosts
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
title | text | Recent Posts | Widget heading |
count | integer | 5 | Number of posts to display |
show_ | select | Yes | Show featured image |
show_ | select | Yes | Show post date |
category_ | integer | (none) | Filter by category ID |
Featured Post Widget
Displays a single highlighted post - either by specific post ID or the latest post from a category.
Widget type identifier: OrangeCollar\WordPressIntegration\Block\Widget\FeaturedPost
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
title | text | (none) | Widget heading |
post_ | integer | (none) | Specific WordPress post ID |
category_ | integer | (none) | Use latest post from this category |
show_ | select | Yes | Show post excerpt |
If both post_id and category_id are set, post_id takes precedence.
Category Posts Widget
Displays posts from a specific WordPress category in a grid or list layout.
Widget type identifier: OrangeCollar\WordPressIntegration\Block\Widget\CategoryPosts
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
title | text | (none) | Widget heading |
category_ | integer | (required) | WordPress category ID |
count | integer | 4 | Number of posts |
layout | select | grid | grid or list |
show_ | select | Yes | Show featured image |
Adding a Widget in CMS Editor
- Edit a CMS page or block in Magento Admin
- Click Insert Widget in the page builder toolbar
- Select the widget type from the dropdown
- Configure the parameters
- Click Insert Widget to add the shortcode to the page content
Adding a Widget via Layout XML
<referenceContainer name="sidebar.main">
<block class="OrangeCollar\WordPressIntegration\Block\Widget\RecentPosts"
name="wordpress.recent.posts"
template="OrangeCollar_WordPressIntegration::widget/recent-posts.phtml">
<arguments>
<argument name="count" xsi:type="string">5</argument>
<argument name="show_thumbnail" xsi:type="string">1</argument>
<argument name="show_date" xsi:type="string">1</argument>
</arguments>
</block>
</referenceContainer>