Hi,
I have two kind of URLs:
1. /?s=search_term
2. /?s=search_term&product_type=product
And then I have this code:
What I need to do is: "if the URL is "/?s=search_term", where search_term can be any alphanumeric character, then do the stuff. But if there is anything after the term (like &product_cat=) don't do anything.
Any ideas using regex?
Thanks
I have two kind of URLs:
1. /?s=search_term
2. /?s=search_term&product_type=product
And then I have this code:
PHP:
$uri = $_SERVER['REQUEST_URI'];
if (preg_match("/^\?s=[a-zA-Z0-9_\-]$/", $uri)) {
wp_register_style( 'wip_blog', get_template_directory_uri() . '/css/blog.css', '', '');
}
What I need to do is: "if the URL is "/?s=search_term", where search_term can be any alphanumeric character, then do the stuff. But if there is anything after the term (like &product_cat=) don't do anything.
Any ideas using regex?
Thanks