kalponikoronno

meta box loop for list item

Feb 27th, 2015
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.15 KB | None | 0 0
  1. /************ for "list-item for about page meta box"   *********/
  2.  
  3.  
  4. <?php
  5.       $aboutpgpr_info = get_post_meta($post->ID, 'aboutpgpr_info', true );
  6.  
  7.       if ( ! empty( $aboutpgpr_info ) ) {
  8.         foreach( $aboutpgpr_info as $prs_set ) {
  9.           echo '
  10.  
  11.             <div class="col-md-4 col-sm-4 col-xs-4 item">
  12.                 <i class="fa fa-'.$prs_set['icon_name'].'"></i>
  13.                 <div class="data">
  14.                     <div class="title">Phone</div>
  15.                     <div class="value">+88 01712 127 664</div>
  16.                 </div>
  17.             </div>
  18.  
  19.            ';
  20.         }
  21.       }                        
  22. ?>                                         
  23.  
  24.  
  25.  
  26. /************ for "meta-boxes.php"   *********/
  27.  
  28.  
  29.       array(
  30.         'id'          => 'aboutpgpr_info',
  31.         'label'       => __( 'Personal info - part one', 'theme-text-domain' ),
  32.         'desc'        => __( 'Enter only three item' ),
  33.         'std'         => '',
  34.         'type'        => 'list-item',
  35.         'settings'    => array(
  36.           array(
  37.             'id'          => 'icon_name',
  38.             'label'       => __( 'Insert icon name', 'theme-text-domain' ),
  39.             'desc'        => '',
  40.             'std'         => '',
  41.             'type'        => 'text'
  42.           )
  43.         )
  44.       ),
Advertisement
Add Comment
Please, Sign In to add comment