Guest User

Untitled

a guest
Nov 16th, 2017
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.52 KB | None | 0 0
  1. <?php
  2. if ( ! defined( 'ABSPATH' ) ) {
  3. exit;
  4. }
  5. ?>
  6. <!DOCTYPE html>
  7. <html lang="en">
  8. <head>
  9. <meta charset="utf-8">
  10. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  11. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  12. <meta name="description" content="<?php bloginfo('description'); ?>">
  13. <?php
  14. if(get_field('fav_icon', 'option') != ''){
  15. $favId = get_field('fav_icon', 'option');
  16. $favDetails = wp_get_attachment_image_src($favId, 'full');
  17. }
  18. ?>
  19. <?php if(!empty($favDetails)): ?>
  20. <link rel="shortcut icon" href="<?php echo $favDetails[0]; ?>">
  21. <?php endif;?>
  22.  
  23.  
  24.  
  25.  
  26. <title><?php wp_title();?></title>
  27.  
  28.  
  29. <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
  30.  
  31.  
  32. <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  33. <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  34. <!--[if lt IE 9]>
  35. <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
  36. <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
  37. <![endif]-->
  38. <?php wp_head(); ?>
  39. <!--[if (lt IE 9)&(!IEMobile)]>
  40. <link rel="stylesheet" type="text/css" href="enhanced.css" />
  41. <link rel="stylesheet" type="text/css" href="iframe.css" />
  42. <![endif]-->
  43. <?php
  44. if(is_front_page()){
  45. $info = get_bloginfo('description');
  46.  
  47. echo '<meta name="og:description" content="'.$info.'">';
  48. echo '<meta name="og:title" content="Website">';
  49. }
  50. ?>
  51. <style>
  52. .main-header--frame {
  53. background-color: #a40057;
  54. margin-bottom: -40px;
  55. }
  56. .main-header--frame .categoryTitle {
  57. display: inline-block;
  58. padding-top: 19px;
  59. padding-left: 10px;
  60. color: #ffffff;
  61. }
  62.  
  63. .main-header.main-header--frame .container {
  64. max-width: 1200px;
  65. background-color: transparent;
  66. }
  67.  
  68. </style>
  69.  
  70. </head>
  71. <body>
  72. <header class="main-header main-header--frame">
  73. <nav>
  74. <div class="container">
  75. <div class="navbar-header">
  76. <a href="https://stiil.ee" class="navbar-brand">
  77. <img src="logo" alt="logo"
  78. class="img-responsive">
  79. </a>
  80. <h1 class="categoryTitle">Description</h1>
  81. </div>
  82. </div>
  83. </nav>
  84. </header>
  85. <main class="main-content main-content-inner valitud-content-inner">
  86. <div class="container">
  87. <?php
  88. $queried_object = get_queried_object();
  89. $taxChilds = get_terms( array(
  90. 'taxonomy' => 'category',
  91. 'hide_empty' => true,
  92. 'child_of' => $queried_object->term_id
  93. ) ); ?>
  94.  
  95. <?php if(isset($_GET) && $_GET['t'] == 'desktop'): ?>
  96. <div class="category-wrap">
  97. <?php
  98. $queried_object = get_queried_object();
  99. $count =0;
  100. foreach($taxChilds as $taxChild): ?>
  101. <?php
  102. $args = array(
  103. 'post_type'=> 'post',
  104. 'cat' => $taxChild->slug,
  105. 'posts_per_page' => '1',
  106. 'orderby' => 'rand',
  107.  
  108. 'tax_query' => array(
  109. array(
  110. 'taxonomy' => 'category',
  111. 'field' => 'term_id',
  112. 'hide_empty' => false,
  113. 'terms' => $taxChild->term_id,
  114. ),
  115. )
  116. );
  117. query_posts($args); if(have_posts()):
  118. while(have_posts()): the_post(); ?>
  119. <div class="col-md-4 all itemz <?php echo $taxChild->slug; ?>" data-cat="<?php echo $taxChild->slug; ?>">
  120. <div class="item-wrap">
  121. <a href="<?php the_permalink();?>"><?php the_post_thumbnail('size-370x416');
  122. $sponsored = get_field('is_sponsored_content');
  123. if($sponsored){
  124. echo '<div class="sponsored-text">Ad</div>';
  125. };
  126. ?></a>
  127. <div class="overlay">
  128. <div class="notify">
  129. <a href="<?php the_permalink(); ?>"><img src="<?php echo get_post_cat_img_src();?>" alt=""></a>
  130. </div>
  131. <h2 class="categoryTitle"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
  132. </div>
  133. </div>
  134. </div>
  135. <?php endwhile;
  136.  
  137. endif; wp_reset_query();?>
  138. <?php
  139. if ($count == 2) {
  140. break;
  141. }
  142. ?>
  143. <?php $count++; endforeach;?>
  144. </div>
  145. <?php endif; ?>
  146.  
  147. <?php if(isset($_GET) && $_GET['t'] == 'mobile'): ?>
  148. <div class="category-wrap">
  149. <?php
  150. $queried_object = get_queried_object();
  151. $count =0; foreach($taxChilds as $taxChild): ?>
  152. <?php
  153. $args = array(
  154. 'post_type'=> 'post',
  155. 'cat' => $taxChild->slug,
  156. 'posts_per_page' => '1',
  157. 'orderby' => 'rand',
  158.  
  159. 'tax_query' => array(
  160. array(
  161. 'taxonomy' => 'category',
  162. 'field' => 'term_id',
  163. 'hide_empty' => false,
  164. 'terms' => $taxChild->term_id,
  165. ),
  166. )
  167. );
  168. query_posts($args);
  169. if(have_posts()):
  170. while(have_posts()): the_post(); ?>
  171. <div class="col-md-4 all itemz <?php echo $taxChild->slug; ?>" data-cat="<?php echo $taxChild->slug; ?>">
  172. <div class="item-wrap">
  173. <a href="<?php the_permalink();?>"><?php the_post_thumbnail('size-370x416');
  174. $sponsored = get_field('is_sponsored_content');
  175. if($sponsored){
  176. echo '<div class="sponsored-text">SISUTURUNDUS</div>';
  177. };
  178. ?></a>
  179. <div class="overlay">
  180. <div class="notify">
  181. <a href="<?php the_permalink(); ?>"><img src="<?php echo get_post_cat_img_src();?>" alt=""></a>
  182. </div>
  183. <h2 class="categoryTitle"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
  184. </div>
  185. </div>
  186. </div>
  187. <?php endwhile;
  188. endif; wp_reset_query();?>
  189. <?php
  190. if ($count == 0) {
  191. break;
  192. }
  193. ?>
  194. <?php $count++; endforeach;?>
  195. </div>
  196. <?php endif; ?>
  197.  
  198. </div>
  199. </main>
  200. </body>
  201.  
  202. <!--main-content ends-->
  203. <?php wp_footer(); ?>
Add Comment
Please, Sign In to add comment