Skip to content

CMS Widgets

The module provides three CMS widgets for embedding WordPress content in any Magento CMS page, block, or layout position.

Displays a configurable list of the most recent blog posts.

Widget type identifier: OrangeCollar\WordPressIntegration\Block\Widget\RecentPosts

Parameters:

ParameterTypeDefaultDescription
titletextRecent PostsWidget heading
countinteger5Number of posts to display
show_thumbnailselectYesShow featured image
show_dateselectYesShow post date
category_idinteger(none)Filter by category ID

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:

ParameterTypeDefaultDescription
titletext(none)Widget heading
post_idinteger(none)Specific WordPress post ID
category_idinteger(none)Use latest post from this category
show_excerptselectYesShow post excerpt

If both post_id and category_id are set, post_id takes precedence.

Displays posts from a specific WordPress category in a grid or list layout.

Widget type identifier: OrangeCollar\WordPressIntegration\Block\Widget\CategoryPosts

Parameters:

ParameterTypeDefaultDescription
titletext(none)Widget heading
category_idinteger(required)WordPress category ID
countinteger4Number of posts
layoutselectgridgrid or list
show_thumbnailselectYesShow featured image
  1. Edit a CMS page or block in Magento Admin
  2. Click Insert Widget in the page builder toolbar
  3. Select the widget type from the dropdown
  4. Configure the parameters
  5. Click Insert Widget to add the shortcode to the page content
<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>