WordPress: Check if Url contains specific keyword
If you want to run a script or what ever if the url that the user is contains specific keyword please add this to you functions.php add_action(‘wp_footer’,’myscriptcd’); function myscriptcd() { global $post; $pageUrl = get_permalink($post->ID); $key = ‘activities’; if (strpos($pageUrl, $key) == !false) { //echo $pageUrl; //echo $key; ?>