I want to get the value of url from php in wordpress. url: https://www.domain.com/category/cricket/
I want to get cricket value from url i tried by
<?php $value=$_GET['cat']; ?>
Above code worked fine when i set url to defult (https://www.domain.com/?cat=17
) in wordpress but didn't worked when it is set to "pretty permalinks" (https://www.domain.com/category/cricket/
).
How can i get the value of url in wordpress from php when it set to "pretty permalinks" (https://www.domain.com/category/cricket/
)
Thank you in advance. :)