WORDPRESS: Is Custom Fields the solution for my portfolio?

前端 未结 2 981
予麋鹿
予麋鹿 2021-01-27 06:17

Here\'s a brief explanation of what I\'m trying to do:

My homepage will have about 12 thumbnail images with title, short description, maybe web url (arranged 3 x 4 or wh

2条回答
  •  旧巷少年郎
    2021-01-27 06:48

    I really understand your situation. In fact i have already done the same plugin before where you have to attach several images in one post and in one custom field. Here is my solution:

    $images = trim(get_post_meta($post->ID,'images',true)); 
    $images_array = explode(',',$images);
    foreach($images_array as $i){
       echo '';
    }
    

    Let me know if that helps.

提交回复
热议问题