Hi guys, a blonde needs help with editing php code in a Wordpress theme. I've got the following code <img class="featureimg" src="<?php echo get_post_meta($post->ID, "Side Photo", true); ?>" alt="" /> When I put img url after src= nothing happens. Do I have to insert something after alt= ? How do I do it work. Thanks and sorry for a silly question.
Can you show an example of what your putting in as the source src=" ? On a side note, it would be something like this: src="http://domain.com/images/someImage.gif" alt="" /> Code (markup): or src="images/someImage.gif" alt="" /> Code (markup): or src="../images/someImage.gif" alt="" /> Code (markup): It really depends on where the image is, ie: an external site or hosted on your own site in a specific directory, if your unsure go with the first example
Yep. src=http://mywebsitename.com/wp-content/uploads/2010/08/image.gif But I tried it all other ways - from just omitting http to shortening it to image.gif .Neither worked.
That does'nt look right I would imagine the image is in the uploads folder ? so it should be /wp-content/uploads/image.gif check your uploads to see if the image actually exist. If you could show us the image on a live website, we can tell you exactly what the source should be, feel free to PM a url if you dont want to post to here.
The image is in the uploads folder and after I save editing it says "successful" but I don't see the image on the home page. Well, I see it but it's like a 'broken image' (don't know how it's called exactly). But I saw this broken image previously before I started editing and right after installed the theme... The image is 426x310 so it should be ok.
Well then the source is <img class="featureimg" src="wp-content/uploads/image.gif" alt="" /> Code (markup): or to be sure <img class="featureimg" src="http://domain.com/wp-content/uploads/image.gif" alt="" /> Code (markup): Note: Internet Explorer shows a red x if an image doesn't exist at the url its supposed to, there are other reasons for this, but I don't think that's the case here, if we had a url we could give you a definitive answer.
Yes, that's what IE shows. I uploaded the images at WP media page. maybe should try to upload it through FTP. btw plused your rep already
Well, Are You Trying to Simply Insert a Picture somewhere on to your blog? Or Are You trying something like, making an image come into featured area and changes per post or something so?
These are the only images in the folder http://translatique.com/wp-content/uploads/2010/08/ Pipes.5-150x150.gif Pipes.5-300x218.gif Pipes.5.gif Code (markup): and you are trying find rotate4.jpg . I think the best thing to do is use your hosts file-transfer program or some kind of ftp program and physically put the image into that folder. wp-content/uploads/2010/08/ then you know for sure its there, that will solve that problem. However for future reference, there must be something wrong with the uploads function on your system, maybe you need to chmod some directories to 777, sorry I'm not that familiar with wordpress. Your html will then read: <img class="featureimg" src="http://translatique.com/wp-content/uploads/2010/08/rotate4.jpg" alt="" /> Code (markup):
I presume so, but I thought you said you uploaded it, just so there's no confusion when I looked at your link, I saw red x where that image was supposed to be, maybe you where just testing or something, its not important about the name as long as you know what image you want displayed in that area is called, then you edit your src appropriately.
got rid of the image at all by editing Main Index Template MyVodaFone, extremephp, thank you for help!