Redirect to add-to-cart url Instead of showing a single product page, we can add the product to shopping cart, when someone clicks on the single product link or tries to browse the product page with a direct link. This only works for simple product type and simple subscription product type,… Read More »
Tag: template_redirect
Redirect WooCommerce Category and Tag archives to shop page
Not every WooCommerce store needs or wants a category or tag archive. is_product_category detects if current page is a WooCommerce category archive or not. Similarly, is_product_tag detects if it a product tag archive or not. So with below small snippet we can redirect category and tag archives to shop page…. Read More »
Modify default WordPress search URL
By default WordPress search result page URL is a query parameter – ?s=[search_term]. Not a very “pretty” URL! But we can make it a nice “pretty” url with a little code snippet. Above code will make your search page url from https://careless.dev/?s=[search_term] to https://careless.dev/search/[search_term]. But /search/ is the default slug… Read More »