wordpress - 如何在WordPress中的帖子标题上添加标题
解决方案
这可以通过多种方式实现,
您可以安装插件 ACF 将帖子元字段添加到每个帖子
在您的主题文件中打开 index.php 或打开您获取所有帖子的模板文件。
**
确保将代码粘贴到文件中的适当位置,并确保将其粘贴在此行之后:
<?php while ( have_posts() ) : the_post(); ?> And before: <?php endwhile; // end of the loop. ?> Use the following snipped to embed the metadata, changing the class name, field name and HTML formatting as required. <p class="myfieldname"><?php the_field('Field_Name'); ?></p> Save the file, and head to your site’s front-end to review.
**
推荐阅读
- .net - 脚本中忽略的 else 部分
- c# - 如何在 ASP.NET Core 2.0 中配置登录尝试并由管理员手动解锁?
- mysql - SSIS - 将 DateTime 变量作为参数传递时执行 SQL 任务 > 日期转换问题
- python - 友好数之和——欧拉任务 21
- scala - Scala - 写出时替代嵌套 for 循环
- javascript - 如何在没有 for 循环的情况下使用迭代器对数组值求和
- javascript - 使用javascript将背景图像应用于django中的div
- java - 我有一个例外。没有可用的事务性 EntityManager
- arrays - nodemcu解析JSOn数组
- mysql - 按每张表相同字段排序2张表,mysql,经典asp