最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

post meta - URL from get_post_meta() is broken my URL

programmeradmin2浏览0评论

I'm just another biginner on PHP and wordpress. Well, I've used another code to get meta data and use it as a link in my blog. Everything is fine, but the link is incorrect, wordpress add the website URL and my meta_data URL.

I'm using the code posted here: adding a URL to a post meta

 <?php
  if ( get_post_meta( $post->ID, "Link", true ) ){
    echo '<div class="pros"><p><strong>Movie Website:  </strong><a href="' .
    get_post_meta( $post->ID, "Link", true ) .
    '" target="_blank">' .
    get_post_meta( $post->ID, "Link", true ) .
    '</a></p></div>';
  }
?>

For exemplo: I've got "www.stackexchange" from my post. When I use this funcion to put this data into my blog, it came as "localhost/mysite/www.stackexchange"

Is anybody can help me?

发布评论

评论列表(0)

  1. 暂无评论