请在这个问题上忍受我。我知道这可能不太清楚,但建议是有帮助的。如何在PHP的the_content()字段中包含帖子ID?
所以我创建了一个模板页面,并在该模板页面中有两个标签。
一个字段的默认:
<?php the_content(); ?>
,另一种是
<?php the_field('test_advertisement_two', 25017); ?>
,我使用ACF(先进的自定义字段)创建了包括邮政编号。我如何在<?php the_content(); ?>
字段中包含帖子ID?
我想我可能会困惑<?php the_content(); ?>
如何工作。有没有办法给它命名一个名字?
这是我在做什么:
我打电话模板页面包含(测试的template.php):
<?php the_content(); ?>
<?php the_field('test_advertisement_two', 25017); ?>
从不同的位置
使用
的交显示内容<?php the_field('test_advertisement_two', 25017); ?>
,但不显示<?php the_content(); ?>
的内容。这就是为什么我认为我需要包括一个职位ID在<?php the_content(); ?>
你是什么意思的“在标签”?你不能只是做'<?php the_content(); the_field('test_advertisement_two',25017); ?>' – ceejayoz
让我改述一下。我希望在字段名称中包含帖子ID <?php the_content(); ?> – Mariton
我仍然无法理解你想要做什么。 – ceejayoz