Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.69 KB | None | 0 0
  1. <!-- RECENT BLOG POSTS -->
  2. <?php
  3. $recentargs = array(
  4. 'post_type' => 'post',
  5. 'post_status' => 'publish',
  6. 'category_name' => 'social-grid',
  7. 'posts_per_page' => $number_of_recent_posts,
  8. 'orderby' => 'post_date',
  9. 'order' => 'DESC'
  10. );
  11. $rec_arr_posts = new WP_Query( $recentargs );
  12.  
  13. if ( $rec_arr_posts->have_posts() ) :
  14.  
  15. while ( $rec_arr_posts->have_posts() ) :
  16. $rec_arr_posts->the_post();
  17. ?>
  18. <div class="gys-cube gys-blog-cube" style="
  19. <?php
  20. if ($grid_padding != '') : ?>
  21. padding: calc(<?php echo $grid_padding ?>px / 2);
  22. <?php endif; ?>
  23. ">
  24. <div class="cube-inner" style="
  25. <?php
  26. if ($grid_padding != '') : ?>
  27. padding: calc(<?php echo $grid_padding ?>px * 2);
  28. <?php endif; ?>
  29. <?php
  30. if ($font_color != '') : ?>
  31. color: <?php echo $font_color; ?>;
  32. <?php endif; ?>
  33. <?php
  34. if ($font_size != '') : ?>
  35. font-size: <?php echo $font_size; ?>px;
  36. <?php endif; ?>
  37. <?php
  38. if ($default_background_color != '') : ?>
  39. background-color: <?php echo $default_background_color; ?>;
  40. <?php endif; ?>
  41. <?php
  42. if ( has_post_thumbnail() ) : ?>
  43. background-image: url('<?php get_the_post_thumbnail_url(); ?>');
  44. <?php endif; ?>
  45.  
  46. <?php if (has_post_thumbnail( $post->ID ) ): ?>
  47. <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>
  48. background-image: url('<?php echo $image[0]; ?>');
  49. <?php endif; ?>
  50. ">
  51.  
  52. <a href="<?php the_permalink(); ?>" class="box-link" target="_blank"></a>
  53. <div class="cube-inner-hover" style="
  54. <?php
  55. if ($transition_speed != '') : ?>
  56. -webkit-transition: background-color <?php echo $transition_speed; ?>s ease-out;
  57. -moz-transition: background-color <?php echo $transition_speed; ?>s ease-out;
  58. -o-transition: background-color <?php echo $transition_speed; ?>s ease-out;
  59. transition: background-color <?php echo $transition_speed; ?>s ease-out;
  60. <?php endif; ?>
  61. "></div>
  62. <p class="tweet-text">
  63. <span class="tweet-text-title"><?php the_title(); ?></span>
  64. <?php echo get_the_excerpt(); ?>
  65. </p>
  66. </div>
  67. </div>
  68. <?php endwhile; ?>
  69.  
  70. <?php endif; ?>
  71.  
  72. <?php wp_reset_postdata(); ?>
  73. <!-- END RECENT BLOG POSTS -->
  74.  
  75. <!-- RANDOM BLOG POSTS -->
  76. <?php
  77. $randomargs = array(
  78. 'post_type' => 'post',
  79. 'post_status' => 'publish',
  80. 'category_name' => 'social-grid',
  81. 'posts_per_page' => $number_of_random_posts,
  82. 'offset' => $number_of_recent_posts,
  83. 'orderby' => 'rand',
  84. 'order' => 'DESC'
  85. );
  86. $rand_arr_posts = new WP_Query( $randomargs );
  87.  
  88. if ( $rand_arr_posts->have_posts() ) :
  89.  
  90. while ( $rand_arr_posts->have_posts() ) :
  91. $rand_arr_posts->the_post();
  92. ?>
  93. <div class="gys-cube gys-blog-cube" style="
  94. <?php
  95. if ($grid_padding != '') : ?>
  96. padding: calc(<?php echo $grid_padding ?>px / 2);
  97. <?php endif; ?>
  98. ">
  99. <div class="cube-inner" style="
  100. <?php
  101. if ($grid_padding != '') : ?>
  102. padding: calc(<?php echo $grid_padding ?>px * 2);
  103. <?php endif; ?>
  104. <?php
  105. if ($font_color != '') : ?>
  106. color: <?php echo $font_color; ?>;
  107. <?php endif; ?>
  108. <?php
  109. if ($font_size != '') : ?>
  110. font-size: <?php echo $font_size; ?>px;
  111. <?php endif; ?>
  112. <?php
  113. if ($default_background_color != '') : ?>
  114. background-color: <?php echo $default_background_color; ?>;
  115. <?php endif; ?>
  116. <?php
  117. if ( has_post_thumbnail() ) : ?>
  118. background-image: url('<?php get_the_post_thumbnail_url(); ?>');
  119. <?php endif; ?>
  120.  
  121. <?php if (has_post_thumbnail( $post->ID ) ): ?>
  122. <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>
  123. background-image: url('<?php echo $image[0]; ?>');
  124. <?php endif; ?>
  125. ">
  126.  
  127. <a href="<?php the_permalink(); ?>" class="box-link" target="_blank"></a>
  128. <div class="cube-inner-hover" style="
  129. <?php
  130. if ($transition_speed != '') : ?>
  131. -webkit-transition: background-color <?php echo $transition_speed; ?>s ease-out;
  132. -moz-transition: background-color <?php echo $transition_speed; ?>s ease-out;
  133. -o-transition: background-color <?php echo $transition_speed; ?>s ease-out;
  134. transition: background-color <?php echo $transition_speed; ?>s ease-out;
  135. <?php endif; ?>
  136. "></div>
  137. <p class="tweet-text">
  138. <span class="tweet-text-title"><?php the_title(); ?></span>
  139. <?php echo get_the_excerpt(); ?>
  140. </p>
  141. </div>
  142. </div>
  143. <?php endwhile; ?>
  144.  
  145. <?php endif; ?>
  146.  
  147. <?php wp_reset_postdata(); ?>
  148. <!-- END RANDOM BLOG POSTS -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement