Hi. I am using wordpress 2.6. I have a couple of conditions in stating which content is displayed depending on what article the user is. I have no PHP knowledge. Below is the code: <?php if ( is_single('179') ) { } elseif (is_single('254')) { } elseif (is_single('130')) { } elseif (is_single('95')) { } elseif (is_single('35')) { } elseif (is_single('27')) { } elseif (is_single('419')) { } elseif (is_single('226')) { } elseif (is_single('381')) { } elseif (is_single('349')) { } elseif (is_front_page()) { } elseif (is_single('254')) { } else { include(TEMPLATEPATH . '/file1.php'); } ?> Code (markup): There must be some way I can clean the above code so that only one is_single statement remains. I tried but couldn't get it to work. If somebody can fix this, it would be great. Thanks.
if (is_front_page()) { } elseif (is_single(array(254,179,130,95,35,27,419,226,381,381,349))) { } else { include(TEMPLATEPATH . '/file1.php'); } Code (markup): Or you could do the is_single based on the _GET of the id of the post and then do a test on the ID if valid.
Yup. That worked! Thanks a lot! But, as I stated earlier, I dont know php so I am not sure what you said about the get and such...