Php 如何在wordpress中使用占位符

Php 如何在wordpress中使用占位符,php,wordpress,Php,Wordpress,问题很清楚。如何使用占位符中的文本,例如下面脚本中的文本。我一直在寻找这个问题,但没有找到解决方案。谢谢你的帮助 Theme-options.php文件: <input type="text" placeholder="1.jpg" name="director_image1" value="<?php print get_option('director_image1'); ?>" /> 在PHP代码中,向image元素添加一个id。使用getElementById检

问题很清楚。如何使用占位符中的文本,例如下面脚本中的文本。我一直在寻找这个问题,但没有找到解决方案。谢谢你的帮助

Theme-options.php文件:

<input type="text" placeholder="1.jpg" name="director_image1"
value="<?php print get_option('director_image1');
?>" />

在PHP代码中,向image元素添加一个id。使用
getElementById
检索img元素

  $image1 = of_get_option('director_image1');
  if ($image1) echo "<img id=\"dir_image\" src=\"" . $image1 . "\" />";

  var image1 = document.getElementById('dir_image');
  if (image1) 
  {
   // do something ...
  }
$image1=of_get_选项('director_image1');
如果($image1)echo“”;
var image1=document.getElementById('dir_image');
如果(图1)
{
//做点什么。。。
}
  $image1 = of_get_option('director_image1');
  if ($image1) echo "<img id=\"dir_image\" src=\"" . $image1 . "\" />";

  var image1 = document.getElementById('dir_image');
  if (image1) 
  {
   // do something ...
  }