📜  wp_get_attachment alt text - 任何代码示例

📅  最后修改于: 2022-03-11 14:57:40.256000             🧑  作者: Mango

代码示例1
First of all you need to get attachment ID for getting alt text..

Use this code to get that,

$img_id = get_post_thumbnail_id(get_the_ID());

Now add your code,