Magento WordPress Related Products Code ExamplesRelated Products

« Back to Magento WordPress Related Products

Change the Post Limit in Product Tab

By default, only 5 related posts will display on the product page. You can increase this using the following XML in your custom theme.

<?xml version="1.0"?>
<!--
/**
 * Create this file at:
 * app/design/frontend/YourVendor/YourTheme/FishPig_WordPress_RelatedProducts/layout/catalog_product_view.xml
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
  <body>      
    <referenceBlock name="related_posts.tab">
      <arguments>
        <argument name="post_limit" xsi:type="number">20</argument>
      </arguments>
    </referenceBlock>
  </body>
</page>

Magento WordPress
Related Products
Documentation