Advertisement
Guest User

Archive

a guest
Jan 15th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. <?php
  2. function is_subcategory_of($category = null, $parent = null) {
  3. if (is_category()) {
  4. if (null != $category){
  5. $cat = get_category($category);
  6. }else{
  7. $cat = get_category(get_query_var('cat'),false);
  8. }
  9. if ($cat->parent == $parent ){
  10. return true;
  11. }else{
  12. return false;
  13. }
  14. }
  15. return false;
  16. }
  17.  
  18. if(is_category()){
  19. if (is_category(3)) {
  20. include TEMPLATEPATH . "/archive-blog.php";
  21. } else if (is_subcategory_of(null, 3)) {
  22. include TEMPLATEPATH . "/archive-subcat.php";
  23. } else {
  24. include TEMPLATEPATH . "/archive-geral.php";
  25. }
  26. }
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement