Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 02-05-2009, 11:21 PM   #1
Solotr
 
Join Date: Jan 2007
Location: , , USA.
Posts: 49
Thanks: 38
Thanked 2 Times in 2 Posts
Contact Info
Send a message via Skype™ to solotr
Lightbulb php blog image problem

Hello Warriors,
I'm not sure what to do with this coding:
<a href="#" rel="bookmark" title="Permanent Link to yoursite.com">
<img src="<?php bloginfo('template_directory'); ?>/images/ad1.gif" /></a>

I can put in the first tag, no problem it's straight html but how do I use the second
half?

I know how to use <img src="whatever"> in html, but am I supposed to split the code
like this:
<img src="humptydumpty"><?php bloginfo('template_directory'); ?>/images/egg.gif" />

Or is this part: <?php bloginfo('template_directory'); ?> in the wrong place?

If it was html, here's how I'd handle it:
<img src="humptydumpty.com"/images/egg.gif" />

Hope this makes sense. I've been playing with it all day and my blog isn't finished until I figure this out (with a little help from my friends

Thank you

Most of us aren't interested in getting rich --we just don't want to get poor.~Andy Rooney
solotr is offline   Reply With Quote
Old 02-06-2009, 09:22 AM   #2
HyperActive Warrior
 
Join Date: May 2008
Location: USA
Posts: 249
Blog Entries: 22
Thanks: 9
Thanked 29 Times in 27 Posts
Default Re: php blog image problem

Hello solotr,
Your first example looks correct to me, but remember that you cannot call PHP code from inside a post or page in WordPress. That is reserved for actual PHP files, such as editing your theme or creating your own PHP files on your web server. Take a look at this blog post for a WP plugin to allow execution of PHP inside a post or page.

Execute PHP in Wordpress post, page and Widget Sidebar | Wordpress

Let me know if that helps. Thank you.

awesometbn is offline   Reply With Quote
Old 02-07-2009, 05:10 PM   #3
Senior Warrior Member
War Room Member
 
mywebwork's Avatar
 
Join Date: Sep 2008
Location: Honolulu, Hawaii, USA & Montreal Canada
Posts: 2,218
Blog Entries: 1
Thanks: 759
Thanked 724 Times in 505 Posts
Default Re: php blog image problem

The PHP expression "<?php bloginfo('template_directory'); ?>" is a variable that represents the full path to your blogs theme folder. If you wanted to strip out the PHP and just use HTML you could replace this expression with something like "http://myblogurl.com/public_html/wp-...hemes/mytheme/" .
mywebwork is offline   Reply With Quote
Old 07-15-2009, 04:47 PM   #4
Solotr
 
Join Date: Jan 2007
Location: , , USA.
Posts: 49
Thanks: 38
Thanked 2 Times in 2 Posts
Contact Info
Send a message via Skype™ to solotr
Default Re: php blog image problem

Sorry it took me this long to reply, I moved Also changed hosts, removed that theme and learning php.

Most of us aren't interested in getting rich --we just don't want to get poor.~Andy Rooney
solotr is offline   Reply With Quote
Old 07-15-2009, 08:25 PM   #5
A rat after money...
War Room Member
 
HomeBizNizz's Avatar
 
Join Date: Jul 2009
Location: Inside a cheese...
Posts: 598
Thanks: 363
Thanked 54 Times in 47 Posts
Default Re: php blog image problem

I build my template the way I like it.
It has multiple files that in the end combines to the full layout.
Like multiple CSS and template files.
Attached Thumbnails
php blog image problem-wf-hbn.jpg  

HomeBizNizz is offline   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk

Tags
blog, image, php, php learning help, problem

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 05:38 PM.