This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on May 17th, 2011  |  syntax: None  |  size: 0.62 KB  |  views: 78  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <div class="fichacat"><b>Categoria</b></div>
  2. <?php
  3. foreach((get_the_category()) as $childcat) {
  4.         $parentcat = $childcat->category_parent;
  5.         if( $parentcat != 0 ) echo '<a href="' . get_category_link($parentcat) .'"><div class="fichavalue">' .get_cat_name($parentcat) .'</div></a>';
  6. }
  7. ?>
  8.  
  9.  
  10. <div class="fichacat"><b>Sub-Categoria</b></div>
  11. <?php $child_category = post_child_category(get_the_ID()); ?>
  12.         <a href="<?php echo get_category_link($child_category->cat_ID); ?>" title="<?php echo $child_category->cat_name;?>"><div class="fichavalue">
  13.             <?php echo $child_category->cat_name;?>
  14.         </div></a>
clone this paste RAW Paste Data