php – Change Query from current url to a specific URL?

Question

I’m trying to customize a plugin to search in our archive url only.

The current query is the following:

    global $wp;
    $current_url = home_url(add_query_arg(array(), $wp->request));

How do I change the query to be only on a specific url, for example:

siteurl + alle

which would result in

https://www.siteurl.com/alle/herecomesthequery

For reference we have a product page but also an overview category page that just displays images but has a sidebar filter. The Filter should therefore search in our archive page siteurl/alle instead of the current_url

0
Nicolas Körner 2 weeks 2021-04-23T16:06:58-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse