Display Archive Results

IntroductionIntroduction

WP Grid Builder enables displaying results from archive/index pages using a single grid, eliminating the need to create multiple grids for each archive page. This functionality is achievable through blocks or shortcodes. Additionally, dedicated integrations for page builders also provide this capability for grids.

When utilizing the archive template feature, it’s essential to understand that all settings available under the Query panel of the grid settings will have no effect. In this specific scenario, the grid will instead utilize the generated query from the archive page, which constitutes the main query.

To modify the number of posts per page within archive or index templates in WordPress, You need to navigate to WordPress > Settings > Reading. For WooCommerce, this setting can be located within the customizer. However, it’s worth noting that themes or page builders might override these settings and incorporate them into their own general settings.

To modify the order or other query parameters of WordPress archive or index templates, you need to utilize the pre_get_posts PHP action.

BlockBlock

If your WordPress theme supports the Full Site Editing (FSE) feature, you can easily display archive results using blocks. Specifically, the Grid block offers a setting called Archive Template within the FSE editor, allowing you to showcase current archive results with ease.

image
FSE Grid Block

ShortcodeShortcode

If you’re using a page builder and have the ability to modify the content of archive or index pages, you can employ a shortcode to showcase results from these pages. To display archive results within a WP Grid Builder grid, you’ll need to include the attribute is_main_query set to true in the shortcode, as demonstrated below:

[wpgb_grid id="1234" is_main_query="true"]

Page BuildersPage Builders

If you are utilizing a compatible page builder (Elementor, Bricks, Oxygen, Beaver Builder) alongside WP Grid Builder, you can seamlessly incorporate a grid element using your page builder. By enabling the “Archive Template” option, you can effortlessly showcase archive results within your grid.