Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.10 KB | None | 0 0
  1. <?php global $current_user;
  2. get_currentuserinfo(); ?>
  3. <!-- Grid Logged In -->
  4. <section class="grid-section">
  5. <div class="container">
  6. <div class="row">
  7. <div class="col-md-12">
  8. <div class="grid">
  9.  
  10. <?php
  11. $taxonomy = 'product_cat';
  12. // $orderby = 'name';
  13. $show_count = 0; // 1 for yes, 0 for no
  14. $pad_counts = 0; // 1 for yes, 0 for no
  15. $hierarchical = 1; // 1 for yes, 0 for no
  16. $title = '';
  17. $empty = 0;
  18. $args = array(
  19. 'taxonomy' => $taxonomy,
  20. 'orderby' => $orderby,
  21. 'show_count' => $show_count,
  22. 'pad_counts' => $pad_counts,
  23. 'hierarchical' => $hierarchical,
  24. 'title_li' => $title,
  25. 'hide_empty' => $empty,
  26. 'meta_query' => array(
  27. array(
  28. 'key' => 'feature',
  29. 'compare' => '==',
  30. 'value' => '1'
  31. )
  32. )
  33. );
  34. $all_categories = get_categories( $args ); ?>
  35. <?php foreach ($all_categories as $cat) : ?>
  36. <?php if ($cat->category_parent == 0) : ?>
  37. <?php $category_id = $cat->term_id; ?>
  38. <?php $thumbnail_id = get_woocommerce_term_meta( $cat->term_id, 'thumbnail_id', true ); ?>
  39. <?php $image = wp_get_attachment_url( $thumbnail_id ); ?>
  40. <?php $gradient = get_field('gradient', $cat); ?>
  41. <!-- Boxes -->
  42. <a href="<?php echo get_term_link($cat->slug, 'product_cat'); ?>">
  43. <?php if ($image) : ?>
  44. <div class="grid-item" style="background-image: url('<?php echo $image; ?>');" >
  45. <?php else: ?>
  46. <div class="grid-item <?php echo $gradient; ?>">
  47. <?php endif; ?>
  48. <div class="box-wrap">
  49. <div class="box-title">
  50. <h4><?php echo $cat->name; ?></h4>
  51. </div>
  52. </div>
  53. </div>
  54. </a>
  55. <!-- Boxes -->
  56. <?php endif; ?>
  57. <?php endforeach; ?>
  58. <div class="stamp stamp1 pink-gradient">
  59. xx
  60. </div>
  61. <div class="grid-item pink-gradient">
  62. <div class="box-wrap">
  63. <div class="box-title">
  64. <h4>Send us your ideas</h4>
  65. </div>
  66. </div>
  67. </div>
  68. <div class="grid-item social">
  69.  
  70. </div>
  71. <div class="grid-item welcome">
  72. <div class="welcome-inner">
  73. <div class="greeting">
  74. Hi, <?php echo $current_user->user_login; ?> <img src="<?php echo get_template_directory_uri(); ?>/images/smile.png" class="img-responsive" alt="Account Icon"/>
  75. </div>
  76. <div class="date">
  77. <?php the_time('F j') ?>
  78. </div>
  79. <div class="time">
  80. 08:45
  81. </div>
  82. </div>
  83. </div>
  84. <div class="grid-item astra">
  85.  
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. </section>
  92. <!-- Grid -->
  93. <script>
  94. jQuery(document).ready(function( $ ) {
  95. var $grid=$('.grid').isotope({
  96. layoutMode: 'packery',
  97. itemSelector: '.grid-item'
  98. // stamp: '.stamp'
  99. });
  100. // Add Placeholders to Custom Wordpress Login Form
  101. $('#user_login').attr( 'placeholder', 'Username' );
  102. $('#user_pass').attr( 'placeholder', 'Password' );
  103. });
  104. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement