Support » Plugins and Hacks » Conditional code and php code

  • I can’t see the dynamic content :

    if (is_home()) {

    echo “<div class=’sidebartop’>
    <h1><?php _e(‘Hot Friends’); ?></h1></div>
    <div class=’sidebar’>
    <div class=’sidebarpadding’>
    …..

    don’t work, i can’t see all the dynamic text…why ?

Viewing 3 replies - 1 through 3 (of 3 total)
  • PHP always needs to be embedded in “<?php” and “?>”.

    <?php echo ‘I am PHP’; ?>
    <h2>I am HTML</h2>
    <?php echo ‘I am PHP again’; ?>
    <h2>Some HTML <?php echo ‘– and now some PHP’; ?></h2>

    How can i add to the funcion

    if (is_home()) {

    the other path like category/date ?

    i would like do this:

    if (is_home() and is_date() etc etc

    what i do ?

    Try this:

    <?php if (is_home()) { ?>
    Do stuff
    <?php } elseif(is_search()) { ?>
    Do stuff
    <?php } elseif(is_single()) { ?>
    Do stuff
    <?php } else { ?>
    Everything else
    <?php } // endif ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Conditional code and php code’ is closed to new replies.