=== ID Post Grid ===
Contributors: insightdezign
Donate link: https://insightdezign.com
Tags: post grid, wpbakery, posts, filter, search
Requires at least: 5.0
Tested up to: 6.9
Stable tag: 1.0.1
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A flexible post grid for WPBakery with search, category filter, and load more functionality.

== Description ==

ID Post Grid is a powerful WPBakery Page Builder element that displays your posts in a beautiful, filterable grid layout.

**Features:**

* **Search** - Real-time search through post titles and content
* **Category Filter** - Filter posts by category with smooth AJAX loading
* **Load More** - Infinite scroll alternative that loads more posts on demand
* **4 Templates** - Card, Overlay, Minimal, and Horizontal layouts
* **Customizable Excerpt** - Control excerpt length in words
* **Responsive** - Mobile-friendly with smart column adjustments
* **Lightweight** - Clean code with minimal dependencies

**WPBakery Element Options:**

* Post type selection
* Posts per page
* Excerpt length
* Order by and order direction
* Template selection (4 options)
* Column count (1-4)
* Grid gap
* Toggle search, filter, and load more
* Customizable placeholder text
* Toggle display elements (image, title, excerpt, date, category, read more)
* Image size selection

== Installation ==

1. Upload the `id-post-grid` folder to the `/wp-content/plugins/` directory
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Ensure WPBakery Page Builder is installed and active
4. Add the "ID Post Grid" element to any page

== Customization ==

**CSS Variables**

Override these variables in your theme to customize colors:

```css
:root {
    --id-pg-primary: #0073aa;
    --id-pg-primary-hover: #005a87;
    --id-pg-text: #333;
    --id-pg-text-light: #666;
    --id-pg-border: #ddd;
    --id-pg-bg: #fff;
    --id-pg-bg-light: #f7f7f7;
    --id-pg-radius: 4px;
    --id-pg-transition: 0.3s ease;
}
```

**Custom Templates**

Create custom templates by adding files to:
`/wp-content/themes/your-theme/id-post-grid/templates/`

Copy any template from the plugin's templates folder and modify as needed.

**JavaScript Events**

Listen for the loaded event:

```javascript
$('.id-post-grid-wrapper').on('idPostGrid:loaded', function(e, data, reset) {
    console.log('Posts loaded:', data.found);
});
```

== Frequently Asked Questions ==

= Does this work without WPBakery? =

The WPBakery element requires WPBakery Page Builder. However, you can use the shortcode directly:

`[id_post_grid posts_per_page="9" template="card" show_search="yes" show_filter="yes"]`

= Can I use this with custom post types? =

Yes! Select any public post type from the dropdown in the element settings.

= How do I change the number of columns on mobile? =

The grid automatically adjusts to 2 columns on tablets and 1 column on mobile. Override with CSS if needed.

== Changelog ==

= 1.0.1 =
* Fixed WordPress Plugin Check compliance.
* Escaped $wrapper_style, $featured_html, and render_grid_item output.
* Added wp_unslash() to all $_POST data in AJAX handler.
* Removed deprecated load_plugin_textdomain() call.
* Reduced readme tags to 5.
* Updated Tested up to 6.9.

= 1.0.0 =
* Initial release

== Upgrade Notice ==

= 1.0.0 =
Initial release of ID Post Grid.
