Wordpress-自定义域

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Wordpress-自定义域相关的知识,希望对你有一定的参考价值。

  1. /**
  2.  * Custom Field
  3.  **/
  4. // From the current post (as string)
  5. $value = get_post_custom_values("customfield");
  6. // From the current post (as array)
  7. $values = get_post_custom_values("Thumb"); echo $values[0];
  8. // From another post
  9. $value = get_post_meta($id, "customfield", 1);
  10. // From another post (as array)
  11. $values = get_post_meta($id, "customfield", 0);

以上是关于Wordpress-自定义域的主要内容,如果未能解决你的问题,请参考以下文章