Advertisement
Guest User

Untitled

a guest
Jan 31st, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.04 KB | None | 0 0
  1. <?php global $data;
  2.  
  3. $sohienthi = $data['ssp_home']; ?>
  4.  
  5. <div class="home-box">
  6. <div class="wrap-sanpham">
  7. <h2 style="font-size: 15px; margin:10px;">Thực phẩm chức năng</h2>
  8. <?php $spm = new WP_Query(array('showposts'=>4,'post_type'=>'sanpham')); ?>
  9. <?php while($spm->have_posts()):$spm->the_post(); ?>
  10. <div class="box-sanpham">
  11.     <div class="titleSP">
  12.         <h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
  13.     </div>
  14.     <div class="imgSP">
  15.         <a href="<?php the_permalink(); ?>"><?php if ( has_post_thumbnail() ) { ?><img src="<?php $imageURL1 = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'thumbnail' );  echo $imageURL1[0]; ?>"/>
  16. <?php
  17. }
  18. else { ?> <img src="<?php bloginfo( 'template_directory' );?>/images/eco.png"/><?php } ?></a>
  19.     </div>
  20.     <div class="infoSP">
  21.         <p>
  22.             Giá bán : <span class="infoSP_price"><?php $gia = get_field('gia'); echo number_format($gia,0,'3','.'); ?>đ</span>
  23.         </p>
  24.        
  25.     </div>
  26. </div><!--BoxSP-->
  27. <?php endwhile; ?>
  28.  
  29. <div class="clear"></div>
  30. </div>
  31.  
  32.  
  33. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement