Forums

Need help with cleaning up some PHP code (1 post)

  1. fahadtariq
    Member
    Posted 12 months ago #

    Hi. 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');
    }
    ?>

    There must be some way I can clean the above code so that only 1 is_single statement remains. I tried but couldn't get it to work. If somebody can fix this, it would be great. Thanks.

Reply

You must log in to post.

About this Topic