Support » Themes and Templates » how do i add an image in my php code?

  • In html you just say “<img src=”img1.jpg”> put in php its different no? I can’t find the code because I don’t know what I’m looking for. Sorry for all of my stupid questions, but I’ve only been using php for like a week!

    Thanks 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • It would help to know the situation. If, for example, you want to include a picture only on category pages you’d write something like <?php if($cat) ?><img src="the-image.gif"/><?php } ?>. So basically you write HTML between the php tags. Or, what sort of a case you have there? 🙂

    Yeah, you come out of PHP mode by using a PHP end tag ?> then type your HTML image tag, then re-open your php tags <?php

    And you can close then re-open your PHP tags in the middle of a conditional block (if statement etc.), as Minna says.

    yeah thats what i thought but i didn’t know for sure the exact way to write it 🙂 it’s basically just replacing text (xhtml being one of them) with little gif buttons, adding little image bullets… just customization really 🙂

    but thank you so much (again). everyone here is so helpful!


Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘how do i add an image in my php code?’ is closed to new replies.