I’m trying to use a conditional statement to check if either of two words (blog & news) appear in the slug. If one shows up I will display one menu, if the other then its corresponding menu shows.
Leave a Reply
You must be logged in to post a comment.
Using PHP:
http://www.php.net/manual/en/function.strpos.php
Here is a javascript version.
You can learn more about indexOf here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf