【发布时间】:2020-07-05 04:55:02
【问题描述】:
我正在制作一个简码来显示首页上的所有漂亮链接。到目前为止,我已成功显示除缺少的链接之外的所有内容
// Display Pretty-Links
function custom_budurl() {
$links = new WP_Query(array(
'post_type' => 'pretty-link',
'orderby' => 'meta_value',
'order' => 'ASC',
));
if ($links -> have_posts()) :
// Start The Loop
while ($links -> have_posts()) : $links -> the_post();
echo '<li><a href="' . . '">' . get_the_title() . '</a></li>';
endwhile;
endif;
}
add_shortcode( 'budurl', 'custom_budurl' );
但我无法弄清楚要在 href="" 选项中写什么来打印创建的链接,如图所示。
如果有人能提供帮助,那就太好了。谢谢
【问题讨论】:
-
有人吗?
标签: wordpress hyperlink shortcode posts