Chance post id into post name 时间:2012-12-17 作者:ogni 我想回显帖子名称而不是帖子id。我的代码只显示id。<?php global $post; $customlink = get_post_meta( $post->ID, \'clink\', true ); echo $customlink; ?> 谢谢Ogni 2 个回复 最合适的回答,由SO网友:Mridul Aggarwal 整理而成 这个元字段是否存储了其他帖子的ID,您想从中检索帖子名称?如果是,试试这个<?php global $post; $customlink = get_post_meta( $post->ID, \'clink\', true ); echo get_post_field( \'post_name\', $customlink ); ?> SO网友:s_ha_dum <?php global $post; echo $post->post_title; // or even better echo apply_filters(\'the_title\',$post->post_title); ?> Like that? 结束 文章导航