编辑:我通过使用Advanced Custom Fields 我可以编辑页面上的多个字段。我永远也不知道为什么WP默认没有这个功能。
这是我一直在寻找的那种PerchCMS默认拥有的能力。
谢谢你的回答。
我不习惯使用Wordpress作为CMS来编写网站,过去我使用了一个名为PerchCMS的CMS,它允许我使用php标记添加额外的多个部分:
<?php perch_content(\'InformationTitle\');?>
<?php perch_content(\'Information\');?>
<?php perch_content(\'AboutTitle\');?>
<?php perch_content(\'AboutContent\');?>
有了Wordpress,我真的不知道如何以这种方式添加多个部分,我在互联网上搜寻答案,但其他地方似乎没有答案。我的部分代码如下:
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<img src="<?php bloginfo(\'template_directory\'); ?>/assets/img/logo.png" class="fg3 logo" alt="Logo" />
<div id=\'services\'>
<p>
<?php the_content(\'services\'); ?>
</p>
</div>
<div id=\'about\'>
<p>
<?php the_content(\'about\'); ?>
</p>
</div>
使用这种方法,我写的所有内容都会重复。我做错了什么?我知道这个循环是用来循环页面上的帖子的,我也看到有人提到过这样的插件来实现这一点,但Wordpress应该默认提供这个功能吗?有许多网站有不同的部分,需要独立编辑。
非常感谢您的帮助。