Wordpress Loops.

Discussion in 'WordPress' started by me4you, Aug 26, 2011.

  1. #1
    <?php
    global $post;

    if (is_page('2')) {
    echo'this is a test11';
    }
    elseif (is_page('6'))
    {
    echo'this is a test22';
    }
    else {
    echo'this is a test33';
    }
    ?>


    This code is not working in a word press plugins, do i need to put something or corrects the code, i want to put condtions based on the page id.


    I need to put this code in to a plugins not in a page.

    Please let me know.
     
    me4you, Aug 26, 2011 IP