Skip to content
  • Home
  • PluginsExpand
    • WP Recipe Maker
    • WP Ultimate Post Grid
    • Easy Affiliate Links
    • Easy Image Collage
    • All-Access Pass
  • FAQ & Support
  • About Us
  • Blog
  • Your Account
Bootstrapped Ventures Knowledge Base
  • Get the Plugin
  • DocumentationExpand
    • WP Recipe Maker
    • WP Ultimate Post Grid
    • Easy Affiliate Links
    • Visual Link Preview
    • Custom Related Posts
  • Open a Support Ticket
Bootstrapped Ventures Knowledge Base

Getting Started

6
  • Installing WP Ultimate Post Grid
  • Activating your license key
  • Updating WP Ultimate Post Grid
  • Creating a Grid
  • Adding a Grid to your Website
  • Grid Template Editor

Creating a Grid

1
  • Creating a Grid
  • Grid Edit Screen
    • General
    • Data Source
    • Limit Items
    • Filters
    • Layout
    • Item
    • Pagination
    • Other
  • Grid Filters
    • Isotope Filter
    • Dropdown Filter
    • Checkboxes Filter
    • Text Search Filter
    • Clear All Filter Selections Button
    • Custom HTML
    • Dynamic Order
    • Responsive Filter Display
  • Grid Pagination
    • Divide posts in Pages
    • Use a “Load More” button
    • Infinite Scroll Load
    • Load more posts on filter

Template Editor

4
  • Grid Template Editor
  • Classes you can use in the grid template editor
  • Using conditions in the grid template
  • Using ACF or other Custom Fields

Advanced Features

8
  • Cloning a Grid
  • Limit Items Dynamically
  • Custom filter term order
  • Default Filter Selections
  • Custom Field Filters
  • Using WP Extended Search to alter the Text Search filter
  • Set Custom Links and Images
  • How to Center the Grid

WPUPG for Developers

3
  • Accessing or manipulating a grid in the front-end
  • Custom filter term order
  • Use a grid for the search or archive page

Announcements

3
  • WP Ultimate Post Grid Changelog
  • WP Ultimate Post Grid 3.0.0
  • WP Ultimate Post Grid Legacy

Account & Licensing

1
  • Account & Licensing
  • Pre-Sale Questions
    • 30 day money-back guarantee
    • Is this a one-time sale or a subscription?
    • Do you offer lifetime licenses?
    • Can I get a trial or demo version?
  • Your License
    • Logging in to your Bootstrapped Ventures account
    • Where can I download a copy of the plugin?
    • The difference between my subscription and my license key
    • Licensing for development or staging sites
    • I need a refund for my purchase
    • Doing an early plugin renewal

Debugging Plugin Issues

3
  • Debugging plugin problems
  • The downloaded plugin is not a zip archive
  • Creating a Temporary Login
View Categories
  • Home
  • Documentation
  • WP Ultimate Post Grid
  • WPUPG for Developers

Accessing or manipulating a grid in the front-end

In the front-end you’ll have the WPUPG_Grids window variable available that can be accessed using JavaScript and is an object containing all the initialized grids on a web page. Use the grid HTML ID to access the grid object and its methods. For example:

WPUPG_Grids['wpupg-grid-post-grid'].layout();

This will execute the layout function for that grid.

Forcing a grid to relayout itself

The example code above is very simple but can be useful when you need to force a grid to relayout itself, basically making sure all of the grid items are aligned correctly in regards to the available space.

You might need to do this when using the grid in combination with a tab layout, where the grid is initially hidden en then suddenly comes into few. For a tab layout you could use JavaScript to hook into the click on a new tab link and then do that relayout after a few milliseconds, for example.

Waiting for the grid to be initialized

If you want to access any of the grid functions (like the .layout() example above, or the .on() function to hook into grid events), you’ll need to make sure the grid has already been initialized, so those functions actually exist. Whenever a grid is done initializing it will trigger the wpupgInitReady window event, so you can listen for that:

window.addEventListener( 'wpupgInitReady', function (e) {
	const grid = e.detail;
	// Do something with the grid.
} );

Hooking into grid events

We use a custom event system that can be hooked into look this:

WPUPG_Grids['wpupg-grid-post-grid'].on('itemsLoaded', function( data ) {
	console.log('Grid was filtered, do something!');
});

The code in that function will run whenever that event gets triggered. These are all the available events you can use:

Event NameEvent TriggerEvent Data
initReadyWill fire once, when the grid has been fully initialized/
restoredDeeplinkWill fire once, when an optional deeplink has been restoredtrue/false wether there was a deeplink
itemsLoadedFires when new data is loaded through the APIdata object return by API
visibleItemsChangedFires when the visible items in the grid change/
filterFires when the grid gets filtered/

Accessing the grid filter state

Each grid filter is its own object with their own functions. An array of the different grid filters can be accessed like this:

WPUPG_Grids['wpupg-grid-post-grid'].filters;

This will execute the layout function for that grid. When you have filter you can access its state like this:

filter.getSelectors();

A similar function is available for the optional grid pagination:

if ( false !== WPUPG_Grids['wpupg-grid-post-grid'].pagination ) {
	WPUPG_Grids['wpupg-grid-post-grid'].pagination.getSelector();
}

Alternatively, you can easily get the filter string used to filter the grid like this:

WPUPG_Grids['wpupg-grid-post-grid'].getFilterString();

All available variables and functions

We tried to list the most useful ones above. To find out all available functions and attributes you can use the following code in the JS console:

console.log( WPUPG_Grids['wpupg-grid-your-grid-id'] );

You can also dig into our code in the /wp-ultimate-post-grid/assets/js/public/ folder.

Updated on December 2, 2024
Custom filter term order
Table of Contents
  • Forcing a grid to relayout itself
  • Waiting for the grid to be initialized
  • Hooking into grid events
  • Accessing the grid filter state
  • All available variables and functions

© 2026 Bootstrapped Ventures · BE0634.767.406
Privacy Policy

  • Bootstrapped Ventures
  • Plugins
    • WP Recipe Maker
      • Demo
      • Documentation
      • Get the Plugin
    • WP Ultimate Post Grid
    • Easy Affiliate Links
    • Easy Image Collage
    • All-Access Pass
  • FAQ & Support
    • Knowledge Base
    • Documentation
  • About Us
  • Blog
  • Your Account