what the best way to include images from the template’s images folder? is it by using get_bloginfo('template_url')? I understood that its better to hard code the path to the images folder since this way you save function calls in PHP..

any thoughts?

5 s
5

The easiest and simplest way to do it is define a unique variable in your theme’s functions.php file.

Such as:

<?php
$theme_name_images = get_bloginfo('stylesheet_directory') . '/images/';
?>

No need for classes as a previous answer suggested.

EDIT: It should be get_bloginfo, instead of bloginfo(), as Viper007Bond kindly pointed out.

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *