Ecommerce Shopify WordPress Discussion

WordPress Rewritten URL returns all posts, ignoring Elementor custom query

I have a portfolio page that displays customs posts "project" using the Elementor Pro Loop Grid widget and a custom query.I also added a rewrite rule. It all seems to work just fine, except: returns posts published on 2022. returns all posts. function custom_register_query_vars( $vars ) { $vars[] = 'date'; return $vars; } add_filter('query_vars', 'custom_register_query_vars' ); function aesc_rewrite_date () { add_rewrite_rule('^(portfolio)/(\d{4})/?' , 'index.php?fecha=$matches[1]', 'top'); } add_action('init', 'aesc_rewrite_date', 10, 0); Custom query is: add_action( 'elementor/query/custom_query', function( $query ) { $query->set('post_type' , 'project'); if ( isset( $_GET['fecha']) ) { //Check if year variable is set in query. Log if not. $query->set('year' , $_GET['date']); } }); I have reviewed both Wordpress add_rewrite_rule() and Elementor's Custom Queries documentation and cannot pinpoint the problem. Any help or guidance is greatly appreciated.
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.