Reputation: 7289
i have created a custom static html page by adding a php file in
wp-content/themes/myactivetheme/
containing essentially
<?php
/*
Template Name: test
*/
?>
<div><p>blablabla</p>
<div><img src="content/images/thumb/00500_Partition_Vivaldi_Printemps.jpg" /></div>
i have placed the corresponding image file in
wp-content/themes/myactivetheme/content/images/thumb
When creating a new page with the dashboard using this test template , the text is displayed but not the image, why?
Upvotes: 1
Views: 2959
Reputation: 712
Probably the source address for the image is wrong. Don't use relative links. For example:
Instead of:
<img src="content/images/thumb/00500_Partition_Vivaldi_Printemps.jpg" />
Use:
<img src="<?php bloginfo('template_url'); ?>/content/images/thumb/your-image.jpg" />
It will help Wordpress to find the exact path to display your image.
Upvotes: 3
Reputation: 635
Relative URIs will be relative to your WordPress index, so WordPress will look for the image in the wrong place. You could
<img src="<?php echo get_stylesheet_directory_uri(); ?>/content/images/thumb/00500_Partition_Vivaldi_Printemps.jpg" />
Upvotes: 2
Reputation: 7289
the image file had to be placed in
/wordpress/content/images/thumb
Upvotes: -1