Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.45 KB | None | 0 0
  1. /*====================== CSS ==========================*/
  2.  
  3. .share-buttons {
  4. font-size: 2rem;
  5. line-height: 2rem;
  6. letter-spacing: 1px;
  7. text-transform: uppercase;
  8. margin: 0 0 60px;
  9. z-index: 2;
  10. position: relative;
  11. text-align: center;
  12. list-style-type: none;
  13. padding: 0;
  14. display: flex;
  15. /* flex-flow: row wrap; */
  16. /* justify-content: space-between; */
  17. /* align-content: flex-start; */
  18. }
  19.  
  20. .share-buttons li {
  21. margin-right: 5px;
  22. }
  23.  
  24. .share-buttons li:last-child {
  25.  
  26. margin-right: 0;
  27. }
  28.  
  29.  
  30.  
  31. .share-buttons a {
  32. display: block;
  33. height: 40px;
  34. width: 40px;
  35. line-height: 45px;
  36. color: #fff;
  37. font-size: 17px !important;
  38. }
  39. .share-vk{
  40. background: #4c75a3;
  41. }
  42. .share-pinterest{
  43. background: #c8232c;
  44. }
  45. .share-linkedin{
  46. background: #0077b5;
  47. }
  48. .share-twitter {
  49. background: #1da1f2;
  50. }
  51.  
  52. .share-facebook {
  53. background: #3b5998;
  54. }
  55.  
  56. .share-googleplus {
  57. background: #db4437;
  58. }
  59.  
  60. .share-pinterest {
  61. background: #b5071a;
  62. }
  63.  
  64. .single-similar-brand .product-image{
  65. width: 90px;
  66. float: left;
  67. }
  68.  
  69. .single-similar-brand .product-detail-inner-new,
  70. .single-similar-brand .sale-label,
  71. .single-similar-brand .wcfmmp_sold_by_container{
  72. display:none !important;
  73. }
  74. .single-similar-brand .items{
  75. clear: both;
  76. margin-bottom: 15px;
  77. }
  78. .single-similar-brand .items .product {
  79. display: flex;
  80. justify-content: center;
  81. align-items: center;
  82. }
  83. .single-similar-brand .items .product:not(:last-child){
  84. border-bottom: 1px solid #e1e1e1;
  85.  
  86. }
  87. .single-similar-brand .product-item:hover {
  88. -webkit-box-shadow: unset !important;
  89. box-shadow: unset !important;
  90. }
  91. .single-similar-brand {
  92. border: 1px solid #e1e1e1;
  93. }
  94. .single-similar-brand h3{
  95. background-color: #f4f4f4;
  96. padding-left: 20px;
  97. padding-right: 15px;
  98. padding-top: 12px;
  99. border-bottom: 1px solid #e1e1e1;
  100. padding-bottom: 12px;
  101. }
  102.  
  103.  
  104. /*============================ WooCoomm Functions ============================================*/
  105. <div class="col-md-3 col-sm-3">
  106. <?php
  107. if ( is_active_sidebar( 'product-single-sidebar' ) ) : ?>
  108. <?php dynamic_sidebar( 'product-single-sidebar' ); ?>
  109. <?php endif; ?>
  110.  
  111.  
  112.  
  113.  
  114. <?php global $product; $terms2 = get_the_terms( $product->get_id() , array( 'product_cat') );
  115. if($terms2){
  116. foreach( $terms2 as $term1){
  117. $cat_in_s= $term1->term_id;
  118. }
  119. };
  120.  
  121. ?>
  122.  
  123. <div class="single-similar-brand">
  124. <h3>Same Brand</h3>
  125. <?php
  126. global $product;
  127. $args = array(
  128. 'post_type' => 'product',
  129. 'posts_per_page' => 4,
  130. 'orderby' => 'date',
  131. 'order' => 'DESC',
  132. 'post__not_in' => array($product->get_id()),
  133. 'tax_query' => array(
  134. array(
  135. 'taxonomy' => 'product_cat', // taxonomy name
  136. 'field' => 'term_id', // term_id, slug or name
  137. 'terms' => $cat_in_s,
  138. 'operator' => 'IN', // term id, term slug or term name
  139. )
  140. )
  141. );
  142. $loop = new WP_Query( $args );
  143. if ( $loop->have_posts() ) {
  144. while ( $loop->have_posts() ) : $loop->the_post();
  145. echo '<div class="items clearfix">';
  146. wc_get_template_part( 'content', 'product' );
  147. echo '</div>';
  148.  
  149.  
  150. endwhile;
  151. } else {
  152. echo __( 'No products found' );
  153. }
  154. wp_reset_postdata();
  155. ?>
  156. </div>
  157. </div>
  158.  
  159.  
  160. /*======================================= Share Template==================================*/
  161. <ul class="share-buttons">
  162. <li>
  163. <a class="share-facebook" href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $url; ?>" target="_blank">
  164. <i class="fab fa-facebook-f"></i>
  165. </a>
  166. </li>
  167. <li>
  168. <a class="share-twitter" href="https://twitter.com/intent/tweet?text=<?php echo $title; ?>&amp;url=<?php echo $url; ?>" target="_blank">
  169. <i class="fab fa-twitter"></i>
  170. </a>
  171. </li>
  172.  
  173. <li>
  174. <a class="share-linkedin" href="https://www.linkedin.com/shareArticle?url=<?php echo $url; ?>" target="_blank">
  175. <i class="fab fa-linkedin-in"></i>
  176. </a>
  177. </li>
  178. <li>
  179. <a class="share-vk" href="http://vk.com/share.php?url=<?php echo $url; ?>" target="_blank">
  180. <i class="fab fa-vk"></i>
  181. </a>
  182. </li>
  183. <li>
  184. <a class="share-pinterest" href="http://pinterest.com/pin/create/button?media=<?php echo $url; ?>" target="_blank">
  185. <i class="fab fa-pinterest-p"></i>
  186. </a>
  187. </li>
  188. </ul>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement