This seems ok but I need a better solution in case I plan to change themes later:
echo'<img src="http://'.$_SERVER['HTTP_HOST'].'/wp-content/themes/default/images/spiel.jpg" alt="Recent Posts"/>';
Question: is there a function built in in wordpress to output the path to the themes…
Yes, bloginfo is used for this:
http://codex.wordpress.org/Template_Tags/bloginfo
Also, if you are editing the default theme, you need to make a copy of it and then give the copy a new directory name and theme name in style.css so that a future auto update won’t overwrite it.
Thanks for the reply however:
<h1><?php bloginfo('name'); ?></h1>
Will display the blog name
<p>Character set: <?php bloginfo('charset'); ?> </p>
Will Display the Charset and
<p><?php bloginfo('description'); ?> </p>
Will display the description… uhmm which one will display the path? please help.
Also I see auto update will overwrite my edits OMG how can I disable auto updates?
Thanks
which one will display the path?
template_directory or template_url
Also I see auto update will overwrite my edits OMG how can I disable auto updates?
Just rename the default theme and it’s folder and it won’t be a problem.
Thanks iridiax I did it like this:
`echo’ <img src=”‘;
bloginfo(‘template_directory’);
echo ‘/images/spiel.jpg” />’;`
Though wishing the bloginfo() function will return the values and not echo it so I can just do it like this:
echo '<img src="'.bloginfo('template_directory').'/images/speil.jpg" />';
Maybe I can make another function from the bloginfo() function that will return the value and not echo it. Another Question: which file in wordpress is the bloginfo() function located?
I am currently using this:
function getThemeURL(){
$p = 'http://'.$_SERVER['HTTP_HOST'].'/wp-content/themes';
return $p;
}
Thanks. Please bear with me this is my first WP site still figuring out hooks and stuff…
I’ll check out those links many thanks
You look great !