私はページに次のテキストを持っています。私のショートコードは下にありますが、コードが実行されたときに何らかの形でショートコードが出力されます。ここで他のコンテンツの前にショートコードが実行されるのはなぜですか?
<img class="alignnone" title="title_enquires" src="http://localhost/barcelona/wp-content/uploads/2011/08/title_enquires.jpg" alt="" width="589" height="77" />
<img class="alignnone" title="contact_map" src="http://localhost/barcelona/wp-content/uploads/2011/08/contact_map.jpg" alt="" width="555" height="222" />
[barcelona_address]
はfunction.phpファイル内の私の短いコード登録です:
<?php
add_shortcode('barcelona_address', 'barcelona_shortcode_handler');
function barcelona_address_func()
{
print "<p>sdsdsds</p>";
}
function barcelona_shortcode_handler($atts, $content=null, $code="")
{
if (function_exists($code . "_func"))
{
call_user_func($code . "_func", $atts);
}
}
?>
、結果は次のとおりです。
<p>sdsdsds</p>
<img class="alignnone" title="title_enquires" src="http://localhost/barcelona/wp-content/uploads/2011/08/title_enquires.jpg" alt="" width="589" height="77" />
<img class="alignnone" title="contact_map" src="http://localhost/barcelona/wp-content/uploads/2011/08/contact_map.jpg" alt="" width="555" height="222" />
回答ありがとうございました – Roman