• Is it posible to add If fonction to a picture ?
    Like IF pageid=something it shows one picture and If pageid=somethingelse it shows another picture ?

Viewing 4 replies - 1 through 4 (of 4 total)
  • You can write that kind of thing into your theme but I’m not sure what you mean by adding the function “to a picture”.

    Thread Starter aslamp

    (@aslamp)

    I want a different picture to show in every page. 1 picture in home. 1 picture in contact, one picture in about etc.
    http://vetech.no/wp/?page_id=148

    The image above the page content is now the same on every page. I would like it to show one picture if page_id=148 and another picture if ?page_id=18.

    Thread Starter aslamp

    (@aslamp)

    at the moment this div defines the picture under the menu.
    <div class=”bilde2″></div>
    I tryed this code, but that just crashed the site. It might give you and idea about what im after 🙂

    <?php
    if ($page_id="18")
      echo "<div class="bilde2"></div>";
    elseif ($page_id="147")
      echo "<div class="bilde3"></div>";
    else
      echo "<div class="bilde4"></div>!";
    ?>

    Thread Starter aslamp

    (@aslamp)

    After alot of php reading i made this code and it worked 🙂
    So if anyone else have the same proble just use this :
    <?php
    if(is_page(‘148’))
    echo ‘<div class=”bilde2″></div>’;
    elseif(is_page(’18’)):
    echo ‘<div class=”bilde3″></div>’;
    else:
    echo ‘<div class=”bilde4″></div>’;
    endif;

    ?>

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Image and IF function’ is closed to new replies.