kiddi_k

categories.php

Sep 27th, 2016
162
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. global $th_theme_data;
  3.  
  4. if ( !isset($th_theme_data['select_categories']) || !isset($th_theme_data['select_categories'][0]) || !is_plugin_active('wossthemes-shortcodes/wossthemes-functions.php') ){}
  5. else{ ?>
  6.  
  7. <!-- Categories -->
  8. <div class="top-categories">
  9. <div class="container">
  10. <!-- Item -->
  11. <div class="col-sm-3 col-xs-6 col-no-p">
  12. <div class="thumbnail">
  13. <a href="<?php echo esc_url( get_category_link($th_theme_data['select_categories'][0]) ); ?>">
  14. <img src="<?php echo esc_url( category_image_src( array('term_id'=>$th_theme_data['select_categories'][0]) ) , false ); ?>" alt>
  15. <div class="caption">
  16. <h3><?php echo esc_html( get_cat_name($th_theme_data['select_categories'][0]) ); ?></h3>
  17. </div>
  18. </a>
  19. </div>
  20. </div>
  21. <?php if ( isset($th_theme_data['select_categories'][1])){ ?>
  22. <!-- Item -->
  23. <div class="col-sm-3 col-xs-6 col-no-p">
  24. <div class="thumbnail">
  25. <a href="<?php echo esc_url( get_category_link($th_theme_data['select_categories'][1]) ); ?>">
  26. <img src="<?php echo esc_url( category_image_src( array('term_id'=>$th_theme_data['select_categories'][1]) ) , false ); ?>" alt>
  27. <div class="caption">
  28. <h3><?php echo esc_html( get_cat_name($th_theme_data['select_categories'][1]) ); ?></h3>
  29. </div>
  30. </a>
  31. </div>
  32. </div>
  33. <?php }
  34. if ( isset($th_theme_data['select_categories'][2])){ ?>
  35. <!-- Item -->
  36. <div class="col-sm-3 col-xs-6 col-no-p">
  37. <div class="thumbnail">
  38. <a href="<?php echo esc_url( get_category_link($th_theme_data['select_categories'][2]) ); ?>">
  39. <img src="<?php echo esc_url( category_image_src( array('term_id'=>$th_theme_data['select_categories'][2]) ) , false ); ?>" alt>
  40. <div class="caption">
  41. <h3><?php echo esc_html( get_cat_name($th_theme_data['select_categories'][2]) ); ?></h3>
  42. </div>
  43. </a>
  44. </div>
  45. </div>
  46. <?php }
  47. if ( isset($th_theme_data['select_categories'][3])){ ?>
  48. <!-- Item -->
  49. <div class="col-sm-3 col-xs-6 col-no-p">
  50. <div class="thumbnail">
  51. <a href="<?php echo esc_url( get_category_link($th_theme_data['select_categories'][3]) ); ?>">
  52. <img src="<?php echo esc_url( category_image_src( array('term_id'=>$th_theme_data['select_categories'][3]) ) , false ); ?>" alt>
  53. <div class="caption">
  54. <h3><?php echo esc_html( get_cat_name($th_theme_data['select_categories'][3]) ) ?></h3>
  55. </div>
  56. </a>
  57. </div>
  58. </div>
  59. <?php } ?>
  60. </div>
  61. </div>
  62. <!-- End Categories -->
  63.  
  64. <?php
  65. }
RAW Paste Data