WordPress.org

Support

Support » How-To and Troubleshooting » PHP Code help…simple if statement

PHP Code help…simple if statement

  • HOw can i get the following code to work:

    <?php if(is_home())
    {
    echo "<div id="home-layout1">  <div id="home-layout2"> <div id="home-layout3">"
    } else {
    echo "<div id="home-layout1"> <div id="home-layout2"> <div id="home-layout3">"
    }
    ?>

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • I figured it out pretty quick! I forgot about the ” ”

    <?php if(is_home())
    {
    echo " <div id=\"home-layout1\">  <div id=\"home-layout2\"> <div id=\"home-layout3\">";
    } else {
    echo " <div id=\"sub-layout1\"> <div id=\"sub-layout2\"> <div id=\"sub-layout3\"> ";
    }
    ?>
    esmi

    @esmi

    Forum Moderator

    <?php if( is_home() ) echo'<div id="home-layout1">  <div id="home-layout2"> <div id="home-layout3">';
    else echo '<div id="home-layout1"> <div id="home-layout2"> <div id="home-layout3">';?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP Code help…simple if statement’ is closed to new replies.