How Do I Get The Category ID???
-
Hey Folks,
I am in the process of writing some custom headers that will be used to refer users to our new site. I am doing this using the code below. However, I need a way to get the current category ID that is shown. I am not looking for conditional tags. Rather, I am in need of something that can pull the category ID from a global position. In other words I need something that can work in place of $get_cat as seen below:
<?php switch ($$get_cat) { case 1: header( 'Location: https://www.newsite.com/category1' ) ; break; case 2: header( 'Location: https://www.newsite.com/category2' ) ; break; default: header( 'Location: https://www.newsite.com' ) ; } ?>
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘How Do I Get The Category ID???’ is closed to new replies.