我正在尝试做自己的滑块。我快完成了,但我需要将我的链接网址显示为标题或其他内容。
我应该添加什么来获取链接和显示?这是我的代码
<?php
// The Loop
while ( $the_query->have_posts() ) : $the_query->the_post(); ?><li>
<?php
// Check if there's a Slide URL given and if so let's a link to it
if ( get_post_meta( get_the_id(), 'wptuts_slideurl', true) != '' ) { ?>
<a href="<?php echo esc_url( get_post_meta( get_the_id(),'wptuts_slideurl', true) ); ?>">
<?php }
// The Slide's Image
echo the_post_thumbnail();
// Close off the Slide's Link if there is one
if ( get_post_meta( get_the_id(), 'wptuts_slideurl', true) != '' ) { ?>
</a> <?php } ?> </li>
<?php endwhile; ?>