Add_rewrite_rule in HivePress (WordPress plugin/theme)

Question

I’m trying to change URL structure, to make it more SEO-friendly.
I use HivePress theme/plugin and there is a filter block? when you use it, the result gets URL for example like this

https://example.com/?_sort=&s=&post_type=hp_listing&_category=3&price%5B%5D=799&price%5B%5D=2599&old_price%5B%5D=999&old_price%5B%5D=3299

But I need it to change. I’ve tried to use add_rewrite_rule, but there is no any result.

For example,

add_rewrite_rule( '^_sort/([^/]+)/?', 'index.php?pagename=_sort$matches[1]', 'top' );

or

function wpd_filter_rewrite() {

add_rewrite_rule(
    '^_sort/([^/]+)/?',
    'index.php?pagename=sort=$matches[1]',
    'top'
);

}
add_action( ‘init’, ‘wpd_filter_rewrite’ );

Still have no idea…

0
Mayliv 2 months 2022-12-22T10:36:05-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse