亚洲国产精品久久一线不卡,日韩av片无码一区二区不卡电影 ,欧美搡BBBBB搡BBBBB,18禁裸男晨勃露J毛免费观看

專業(yè)WORDPRESS主題設計制作

get_the_tags()函數(shù)(getchildnodes()函數(shù)仔細解讀)

發(fā)布于: 2022-08-19

get_the_tags()函數(shù)用于獲取標簽信息,包括標簽ID、別名、名稱、描述等。get_the_tags()函數(shù)需要用在The Loop主循環(huán)中,如果在主循環(huán)之外使用,需要傳遞文章ID。

語法

get_the_tags( int $id = 0 )

參數(shù)

get_the_tags()函數(shù)
  1. $id 整數(shù)型,默認值:當前文章ID,指定文章ID,將返回該文章的標簽信息。

實例

<?php
	$posttags = get_the_tags();
	if ($posttags) {
	  foreach($posttags as $tag) {
		echo '標簽ID:' . $tag->term_id;
		echo '<br />標簽名稱:' . $tag->name;
		echo '<br />標簽描述:' . $tag->description;
	  }
	}
?>
WP技術資料 wordpress模板制作、wordpress主題開發(fā)相關知識常見問題總結
MORE
服務電話:
0533-2765967

微信 13280692153