Advertisement
Guest User

Sample

a guest
Jun 17th, 2016
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.16 KB | None | 0 0
  1. <?php
  2. get_header();
  3. if(have_posts()):
  4. while(have_posts()):
  5. the_post();
  6. ?>
  7.  
  8. <div class="under-contents">
  9. <div id="product_01" class="under-firstview" data-hash="product"><div class="inner"></div></div>
  10.  
  11. <article class="block-box block-padding-bottom sep-block clearfix">
  12. <div class="container">
  13. <div class="product-obj-block">
  14. <h2 class="under-product-label">
  15. <span class="sub_title">タイトル1</span></h2>
  16. <div class="block-note tAc">
  17. <ul id="list_list" class="list1">
  18. <?php $args = array(
  19. 'nopaging' => true, // 'numberposts' => -1,
  20. 'post_type' => 'aaa',
  21. 'tax_query' => array( // タクソノミーのパラメータはこの形式
  22. array( // 配列の中に配列で書く
  23. 'taxonomy' => 'bbb',
  24. 'field' => 'slug', // 省略するとタームID
  25. 'terms' => 'xxx', // タームのスラッグ
  26. )
  27. ),
  28. );
  29. $customPosts = get_posts($args);
  30. if($customPosts) : foreach($customPosts as $post) : setup_postdata( $post );
  31. ?>
  32. <li>
  33. <?php $img = get_field('aaa_img');
  34. $imgurl = wp_get_attachment_image_src($img, 'large');
  35. if($imgurl){ ?>
  36. <a href="<? echo $imgurl[0]; ?>" class="bg_img" style="background: url(<? echo $imgurl[0]; ?>);" rel="shadowbox">
  37. <? } ?>
  38. <p class="product_p">タイトル1</p>
  39. <h3 class="product_title"><?php the_title(); ?></h3>
  40. <?php $txt = get_field('aaa_more');
  41. if($txt){ ?><p class="product_p"><? echo $txt; ?></p>
  42. <? } ?>
  43. </a>
  44. </li>
  45. <?php endforeach; ?>
  46. <?php endif; wp_reset_postdata(); ?>
  47. </ul>
  48. </div>
  49. <div class="sp-blank"></div>
  50. </div>
  51. </div>
  52. </article>
  53.  
  54. <div id="product_02" class="under-firstview" data-hash="product"><div class="inner" style="background-attachment: scroll;"></div></div>
  55.  
  56. <article class="block-box block-padding-bottom clearfix">
  57. <div class="container">
  58. <div class="product-obj-block">
  59. <h2 class="under-product-label">
  60. <span class="sub_title">タイトル2</span></h2>
  61. <div class="block-note tAc">
  62. <ul id="list_list" class="list2">
  63. <?php $args = array(
  64. 'nopaging' => true, // 'numberposts' => -1,
  65. 'post_type' => 'aaa',
  66. 'tax_query' => array( // タクソノミーのパラメータはこの形式
  67. array( // 配列の中に配列で書く
  68. 'taxonomy' => 'bbb',
  69. 'field' => 'slug', // 省略するとタームID
  70. 'terms' => 'yyy', // タームのスラッグ
  71. )
  72. ),
  73. );
  74. $customPosts = get_posts($args);
  75. if($customPosts) : foreach($customPosts as $post) : setup_postdata( $post );
  76. ?>
  77. <li>
  78. <?php $img = get_field('aaa_img');
  79. $imgurl = wp_get_attachment_image_src($img, 'large');
  80. if($imgurl){ ?>
  81. <a href="<? echo $imgurl[0]; ?>" class="bg_img" style="background: url(<? echo $imgurl[0]; ?>);" rel="shadowbox">
  82. <? } ?>
  83. <p class="product_p">タイトル2</p>
  84. <h3 class="product_title"><?php the_title(); ?></h3>
  85. <?php $txt = get_field('aaa_more');
  86. if($txt){ ?><p class="product_p"><? echo $txt; ?></p>
  87. <? } ?>
  88. </a>
  89. </li>
  90. <?php endforeach; ?>
  91. <?php endif; wp_reset_postdata(); ?>
  92. </ul>
  93. </div>
  94. <div class="sp-blank"></div>
  95. </div>
  96. </div>
  97. </article>
  98.  
  99. <div id="product_03" class="under-firstview" data-hash="product"><div class="inner" style="background-attachment: scroll;"></div></div>
  100.  
  101. <article class="block-box block-padding-bottom clearfix">
  102. <div class="container">
  103. <div class="product-obj-block">
  104. <h2 class="under-product-label">
  105. <span class="sub_title">タイトル3</span></h2>
  106. <div class="block-note tAc">
  107. <ul id="list_list" class="list3">
  108. <?php $args = array(
  109. 'nopaging' => true, // 'numberposts' => -1,
  110. 'post_type' => 'aaa',
  111. 'tax_query' => array( // タクソノミーのパラメータはこの形式
  112. array( // 配列の中に配列で書く
  113. 'taxonomy' => 'bbb',
  114. 'field' => 'slug', // 省略するとタームID
  115. 'terms' => 'zzz', // タームのスラッグ
  116. )
  117. ),
  118. );
  119. $customPosts = get_posts($args);
  120. if($customPosts) : foreach($customPosts as $post) : setup_postdata( $post );
  121. ?>
  122. <li>
  123. <?php $img = get_field('aaa_img');
  124. $imgurl = wp_get_attachment_image_src($img, 'large');
  125. if($imgurl){ ?>
  126. <a href="<? echo $imgurl[0]; ?>" class="bg_img" style="background: url(<? echo $imgurl[0]; ?>);" rel="shadowbox">
  127. <? } ?>
  128. <p class="product_p">タイトル3</p>
  129. <h3 class="product_title"><?php the_title(); ?></h3>
  130. <?php $txt = get_field('aaa_more');
  131. if($txt){ ?><p class="product_p"><? echo $txt; ?></p>
  132. <? } ?>
  133. </a>
  134. </li>
  135. <?php endforeach; ?>
  136. <?php endif; wp_reset_postdata(); ?>
  137. </ul>
  138. </div>
  139. <div class="sp-blank"></div>
  140. </div>
  141. </div>
  142. </article>
  143.  
  144. </div>
  145.  
  146. <?php
  147. endwhile;
  148. endif;
  149. get_footer();
  150. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement