Home  >  Article  >  Backend Development  >  wordpress自定义字段输出代码设计_PHP教程

wordpress自定义字段输出代码设计_PHP教程

WBOY
WBOYOriginal
2016-07-14 10:12:071370browse




  


  
    ID, 'images', false); //一会你要添加的自定义字段 images if($images){ //开始循环同名自定义字段 foreach ($images as $image) { $fullvalue = explode("|", $image); $post_img=$fullvalue[0]; //图片地址 $post_url=$fullvalue[1]; //图片对应的文章地址 $img_info=$fullvalue[2]; //图片信息 ?>


这个是幻灯片的实例代码,可以在这个基础上修改自己需要的样式,循环输出

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/477221.htmlTechArticle!--举个例子 假如这是一个幻灯片-- div class=flexslider ?php if ( have_posts() ) :the_post(); ? ul class=slides ?php $images = get_post_meta($post-ID, images, false); //一...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn