Need Tip Adding A PHP Image

6 replies
  • WEB DESIGN
  • |
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
#adding #image #php #tip
  • Profile picture of the author Andrew H
    Set your image then echo your image

    $image = "yourimage.png";

    Echo "<img src=".$image.">"
    Signature
    "You shouldn't come here and set yourself up as the resident wizard of oz."
    {{ DiscussionBoard.errors[5953814].message }}
    • Profile picture of the author generay
      Originally Posted by mcflause View Post

      Set your image then echo your image

      = "yourimage.png";

      Echo "<img src="..">"

      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
      {{ DiscussionBoard.errors[5956822].message }}
  • Profile picture of the author Istvan Horvath
    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!
    Signature

    {{ DiscussionBoard.errors[5956954].message }}
    • Profile picture of the author BlueLayerHost
      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.
      Signature
      BlueLayerHost - Shared + Managed VPS Hosting
      BlueLayerMedia - Web Development
      WPMalware - Resource for WordPress Seurity + Exploits
      {{ DiscussionBoard.errors[5958329].message }}
      • Profile picture of the author generay
        Originally Posted by BlueLayerHost View Post

        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.

        Hey BlueLayer Host.

        Thank, You very much. You've help me come to a better understanding of what to do now.
        I have very little knowledge of php. I will experiment with the wordpress code and the image tags.

        Thanks again.

        Gene
        {{ DiscussionBoard.errors[5960935].message }}
  • Profile picture of the author Craftisy
    You can directly link the .php file and it should work.
    {{ DiscussionBoard.errors[5961584].message }}

Trending Topics