我想在 WordPress 中的每个帖子之后插入一些代码...我知道您可以在此之后执行此操作,例如,在 single.php 中
<?php the_content(); ?>
但是,如果我这样做,它会把它放在错误的地方.. 一个示例帖子在这里:http ://www.hardwareblog.com/348/computer-hardware/top-10-gadget-gift-ideas-to-avoid- this-christmas/ -- 如果我把它放在上面的代码示例之后,它将被放在社交和 facebook 链接之后.....我想把它放在那些之前,所以它就在帖子之后。
我做了一些检查和测试..这里的代码来自 post-template.php
function the_content($more_link_text = null, $stripteaser = 0) {
$content = get_the_content($more_link_text, $stripteaser);
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
echo $content;
}
似乎 facebook 和社交代码被插入到 apply_filters() 函数的输出中......虽然我不知道在哪里。
对我正在尝试做的事情有任何帮助吗?