diff --git a/composer.lock b/composer.lock index 2310048..c7a179b 100644 --- a/composer.lock +++ b/composer.lock @@ -8,21 +8,21 @@ "packages": [ { "name": "codeinwp/themeisle-sdk", - "version": "3.3.48", + "version": "3.3.52", "source": { "type": "git", "url": "https://github.com/Codeinwp/themeisle-sdk.git", - "reference": "0727d2cf2fc9bfb81b42968aeaf2bf4e340f021e" + "reference": "d1ae68cbd4f84934b4d982e9eeff317b9f4c814a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/0727d2cf2fc9bfb81b42968aeaf2bf4e340f021e", - "reference": "0727d2cf2fc9bfb81b42968aeaf2bf4e340f021e", + "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/d1ae68cbd4f84934b4d982e9eeff317b9f4c814a", + "reference": "d1ae68cbd4f84934b4d982e9eeff317b9f4c814a", "shasum": "" }, "require-dev": { "codeinwp/phpcs-ruleset": "dev-main", - "yoast/phpunit-polyfills": "^2.0" + "yoast/phpunit-polyfills": "^4.0" }, "type": "library", "notification-url": "https://packagist.org/downloads/", @@ -36,16 +36,16 @@ "homepage": "https://themeisle.com" } ], - "description": "ThemeIsle SDK", + "description": "Themeisle SDK.", "homepage": "https://github.com/Codeinwp/themeisle-sdk", "keywords": [ "wordpress" ], "support": { "issues": "https://github.com/Codeinwp/themeisle-sdk/issues", - "source": "https://github.com/Codeinwp/themeisle-sdk/tree/v3.3.48" + "source": "https://github.com/Codeinwp/themeisle-sdk/tree/v3.3.52" }, - "time": "2025-08-11T16:47:24+00:00" + "time": "2026-05-14T19:43:56+00:00" } ], "packages-dev": [ @@ -2418,5 +2418,5 @@ "platform-overrides": { "php": "7.0" }, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.9.0" } diff --git a/inc/Core.php b/inc/Core.php index bfae19b..5fe35e4 100644 --- a/inc/Core.php +++ b/inc/Core.php @@ -55,6 +55,7 @@ private function run_hooks() { add_action( 'after_setup_theme', array( $this, 'setup' ) ); add_action( 'wp_enqueue_scripts', array( $this, 'enqueue' ) ); add_action( 'enqueue_block_editor_assets', array( $this, 'add_editor_styles' ) ); + add_action( 'pre_get_posts', array( $this, 'pre_get_posts' ) ); } /** @@ -107,4 +108,20 @@ public function enqueue() { public function add_editor_styles() { Assets_Manager::enqueue_style( Assets_Manager::ASSETS_SLUGS['editor-css'], 'editor' ); } + + /** + * Modify the main query before it is executed. + * + * @param \WP_Query $query The WP_Query instance. + */ + public function pre_get_posts( \WP_Query $query ) { + // Only modify frontend main query. + if ( is_admin() || ! $query->is_main_query() || $query->is_feed() ) { + return; + } + + if ( $query->is_archive() ) { + $query->set( 'posts_per_page', 4 ); + } + } } diff --git a/templates/archive.html b/templates/archive.html index 0dcda42..91e47dd 100644 --- a/templates/archive.html +++ b/templates/archive.html @@ -23,7 +23,7 @@
- +