web-dev-qa-db-ja.com

Bloginfo( 'template_directory')を配列で使う方法

bloginfo( 'template_directory' )を配列で渡したい

私はこれを試したが動作しませんでした。正しく書くには?

<?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はJustin Tadlockプラグインからの関数です

2
Dipa

bloginfo()echoを使用しています。その値を返す関数get_bloginfo()が必要です。

この場合、get_bloginfo()が使っている関数get_template_directory_uri()だけを使うこともできます。

4
fuxia