Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Wordpress 的后端,-在“编辑页面”页面,-更具体地说是在“页面选项”区域,
我想包含一个自定义选项(比如说 option1)。我想在我的主题模板文件(page.php)中重用这个选项来修改页面的生成方式。我怎样才能做到这一点?
谢谢。
在您的页面中添加自定义字段名称 + 值。然后在页面模板中使用这个:
$meta_value = get_post_meta( $post_id, $meta_key, true );