Need Tip Adding A PHP Image

by 6 replies
7
Hey All,

How is everyone? Can someone point me to a tutorial that shows how to add an image to a php script hosted on wordpress? I wanna add a top banner, but Im nervous about screwing up my site. I know html, but php looks complicated.

any help appreciated.

Thanks aheap

Gene
#website design #adding #image #php #tip
  • Set your image then echo your image

    $image = "yourimage.png";

    Echo "<img src=".$image.">"
    • [1] reply

    • Thank you very much Mcflause. I am going to give this a shot. One question. Do I need to put the string between a header or will this work anywhere in the body.

      Gene
  • Hi Gene,

    with every question you add the confusion is growing

    So, I'd like to ask back for some clarification:

    1. What is "a php script hosted on wordpress"? - On wordpress.ORG nobody can host anything (except the owner); on wordpress.COM you can NOT install your own script... - so what are you talking about?

    2. Where is "between a header"?

    ------------
    As a general note: all the WordPress templates in a theme are, actually written in HTML - with a little bit of PHP added to it (the template tags that call for the WP functions).

    Adding any HTML (including an img code) is NO DIFFERENT than adding it to any html file. Don't get confused by the extension of those files!
    • [1] reply
    • Let me try and answer your question without any attitude like a previous poster typically does...

      You don't need to insert your image using PHP code. You can simply use an img tag.

      You don't want to insert it above the wp_head() tag if that's what you're referring to. Anywhere below the body tag is fine. You'll have to do some experimenting if you're not familiar with WordPress' code on how to get the image to display properly.
      • [1] reply
  • You can directly link the .php file and it should work.

Next Topics on Trending Feed

  • 7

    Hey All, How is everyone? Can someone point me to a tutorial that shows how to add an image to a php script hosted on wordpress? I wanna add a top banner, but Im nervous about screwing up my site. I know html, but php looks complicated.