get_sidebar How Can I Make It Dynamic for is_single and is_category??
-
I know this is asking a lot…. but is it possible to create an “if” (or whatever works..) statement that would allow me to use the Custom Field’s key data to point to the sidebar?
I have probably 100 categories and will have 10,000+ pages with 100 different sidebars and I sure don’t want to keep adding to what I’m doing now which is:
<?php if (is_single(7)) {include (‘sidebars/sidebar5.php’); }
else if (is_single(10)) {include (‘sidebars/sidebar3.php’); }
else {include (‘sidebars/sidebar.php’); }
?>and
<?php if (is_category(5)) {include (‘sidebars/sidebar5.php’); }
else if (is_category(3)) {include (‘sidebars/sidebar3.php’); }
else if (is_category(7)) {include (‘sidebars/sidebar3.php’); }
else {include (‘sidebars/sidebar.php’); }
?>
- The topic ‘get_sidebar How Can I Make It Dynamic for is_single and is_category??’ is closed to new replies.