導讀:網(wǎng)站搭建網(wǎng)站搭建方法一: ID, $key, true); ?> 方法二: '.ge建站技術(shù)步梁技術(shù)網(wǎng)站。

方法一:
<?php $key="字段名"; echo get_post_meta($post->ID, $key, true); ?>
方法二:
'.get_field('字段名').'
方法三:
get_post_meta($post->ID, "quan", $single = true)
如:
echo '<h2><a'._post_target_blank().' href="'.get_permalink().'" title="'.get_the_title()._get_delimiter().get_bloginfo('name').'">'.get_the_title()dede模板免費.'',''.get_field('red_title').'</a></h2>';
在平時,我們可能常常會使用到自定義字段,但有時候自定義字段又跟某個DIV 標簽相關(guān)聯(lián),這時候,我們可以通過以下方式來操作。
$quan= get_post_meta($post->ID, "自定義字段", $single = true);
if($quan){
echo '<div class="quanquan">領(lǐng)取'.$quan.'優(yōu)惠券&ldede手機模板t;/div>';
}
else echo '';
[fa_insert_post ids=1161,864模板織夢,843] 相關(guān)建站技術(shù)步梁技術(shù)網(wǎng)站。
關(guān)鍵詞標簽: WordPress 自定義 字段
聲明: 本文由我的SEOUC技術(shù)文章主頁發(fā)布于:2023-07-23 ,文章wordpress調(diào)用自定義字段值,網(wǎng)站搭建主要講述自定義,字段,wordpress網(wǎng)站建設(shè)源碼以及服務(wù)器配置搭建相關(guān)技術(shù)文章。轉(zhuǎn)載請保留鏈接: http://www.bifwcx.com/article/web_35146.html