WordPress custom Field Output code design _php Tutorial

Source: Internet
Author: User
!--For example if this is a slide-->!--? php if (have_posts ()): The_post ();?--> 
  
  
    !--? php $images = Get_post_meta ($post--->id, ' images ', false); One more custom field you want to add images if ($images) {//start loop with the same name as the custom field foreach ($images as $image) { $fullvalue = Explode ("|", $image); $post _img= $fullvalue [0]; Image address $post _url= $fullvalue [1]; The picture corresponds to the article address $img _info= $fullvalue [2]; Picture information?>!--Start exporting custom fields-->
  • !--slide picture--> href= "!--? php echo $post _url?--" > "alt=" !--? php the_title (),?--> "title="!--? php the_title (),?-->/>!--slide title-->!--? php echo $img _info? ->!--End img_conent-->
  • !--? php}//end foreach} endif ?-->


This is the example of the slide show code, you can modify the style you want on this basis, loop output

http://www.bkjia.com/PHPjc/477221.html www.bkjia.com true http://www.bkjia.com/PHPjc/477221.html techarticle !--For example if this is a slide--div class=flexslider? php if (have_posts ()): The_post ();? ul class=slides? php $images = Get_po St_meta ($post-id, images, false); A ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.