Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm trying to the $appLink variable with a custom field value outside of the loop. I'm using Wurfl to detect the users device, I'd like to echo the custom field value for the URL. This is what I have but I can't get it to work. Can anyone help please?

 else if ($os == 'iOS') 
  {  
  global $wp_query;
  $postid = $wp_query->post->ID;
  $appLink = echo get_post_meta($postid, 'ios_app_link_sb', true);
  wp_reset_query();
  } 
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
150 views
Welcome To Ask or Share your Answers For Others

1 Answer

It should be either

 echo get_post_meta($postid, 'ios_app_link_sb', true);

or

 $appLink = get_post_meta($postid, 'ios_app_link_sb', true);
 echo $appLink;

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...