WordPress发布文章/页面时自动添加默认的自定义字段
2024-10-19 13:29:38
如果你每篇文章或页面都需要插入同一个自定义字段和值,可以考虑在WordPress发布文章/页面时,自动添加默认的自定义字段。将下面的代码添加到当前主题的 functions.php 即可:
1 |
|
注:根据自己的需要,修改第 10 行的字段名和字段值。也可以修改 5、6 行决定是发布文章还是页面才添加。
最新文章
- Android学习---如何创建数据库,SQLite(onCreate,onUpgrade方法)和SQLiteStudio的使用
- TortoiseSVN 过滤文件(包括已提交和未提交)
- poj3692 最大点权独立集/最大独立集
- VB6 GDI+ 入门教程[8] Bitmap魔法(1):创建
- Apriori算法实例----Weka,R, Using Weka in my javacode
- XFS文件系统功能解析
- HBase API详解
- 设计模式六大原则-OCP
- projecteuler----&;gt;problem=14----Longest Collatz sequence
- Hibernate进化史-------Hibernate概要
- C++一些注意点之转换操作符
- [原创]JS实现数据筛选(each)
- Linux指令--which,whereis,locate,find
- Oracle 11g R2性能优化 10046 event
- Appium 框架工作流程及原理
- exl表格找两个字符间的数据
- 【转】C++拷贝构造函数详解
- ubuntu 安装source insight3.5
- PAT (Advanced Level) Practise 1002 解题报告
- 转载:centos安装redis