【发布时间】:2015-04-05 10:36:00
【问题描述】:
我在 WordPress 中有一个子主题,我想在每篇文章的末尾插入此代码:
<?php the_tags(); ?>
我不想编辑 single.php。我想通过functions.php插入这段代码
我找到了这个帖子并在这个答案中使用了代码:https://wordpress.org/support/topic/insert-info-into-bottom-of-posts#post-3990037
它对我来说效果很好,但我不知道如何插入我的 PHP 代码。
这些是我尝试过但没有在前端反映我想要的东西:
$content.= '<?php the_tags(); ?>';
$content.= ' the_tags();';
$content.= <?php the_tags(); ?>;
$content.= the_tags();
如何更改该 WordPress 线程中的代码以包含 php?
谢谢。
【问题讨论】: