How to use bloginfo( ‘template_directory’ ) in array

I want to pass bloginfo( 'template_directory' ) in an array

I tried this but not working. How to write it correctly?

<?php
get_the_image( array( 'size' => 'full',
              'default_image' => bloginfo( "template_directory" ) .'/img/dflt.png',
              'image_scan' => true,
              'link_to_post' => false ) );
?>

get_the_image is a function from Justin Tadlock plugin

1 Answer
1

bloginfo() is using echo, you need a function that returns its value: get_bloginfo().

In this case you could also use just the function get_bloginfo() is using: get_template_directory_uri().

Leave a Comment