获取wordpress主题中的自定义字段值
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了获取wordpress主题中的自定义字段值相关的知识,希望对你有一定的参考价值。
get custom fields value in wordpress theme
To be used only inside WordPress’s Loop It displays the value of the custom field. Replace “custom_field_name†with the chosen name of your custom field. To display the value outside the loop use <?php global $wp_query; $postid = $wp_query->post->ID; echo get_post_meta($postid, 'custom_field_name', true); ?>
以上是关于获取wordpress主题中的自定义字段值的主要内容,如果未能解决你的问题,请参考以下文章
如何从表格视图的自定义单元格内的文本字段中获取值(标签)以发布到 URL [重复]
根据 WooCommerce 中的自定义结帐单选按钮和文本字段设置动态费用