从cmb2自定义元文件文件(CMB2)获取图像替代文字

时间:2017-02-23 19:31:17

标签: wordpress

我使用wordpress cms和cmb2插件来注册自定义元框和字段。我注册了图片字段,无法获取它的替代文字。如何在循环中获取图像alt文本?我有这个:

<?php $successful_students_items = get_post_meta( get_the_id(), 'successful_students_block_box', true );
                              if( !empty( $successful_students_items ) ) {
                                foreach( $successful_students_items as $successful_students_item ) { ?>
                            <div class="ipd-je-8 ipd-rz-8 ipd-pv-12 ipd-ke-24">
                                <div class="rjeudirnskxzi nnu">
                                                    <div class="h1ge6swchqzj6de">
                                                        <div class="h1ge6swchqzj6de_cvz">
                                                      <figure class="o309iruhgtybgyu5">
                                      <blockquote><?php echo $successful_students_item['successful_students_block_testimonial']; ?>
                                        <div class="ingi3h38d8jj4"></div>
                                      </blockquote>
                                      <img alt="" src="<?php echo $successful_students_item['successful_students_block_image']; ?>"/>
                                      <div class="ewr4i9548jfdeuthie">
                                        <h5><?php echo $successful_students_item['successful_students_block_name_lastname']; ?>
                                          <span>
                                            <br>
                                            <?php echo $successful_students_item['successful_students_block_position']; ?>
                                          </span>
                                        </h5>
                                      </div>
                                    </figure>
                                  </div>
                                </div>
                              </div>
                            </div>
                          <?php } 
                          } ?>

对任何帮助都很高兴..谢谢

0 个答案:

没有答案