Advertisement
alchymyth

if else single category

Oct 5th, 2011
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. <?php
  2.  
  3. if (is_single()) {
  4.  
  5. echo '<div id="mainwrap"><div class="titleh2">
  6. <h2><a href="'; the_permalink(); echo ' "rel="bookmark" title="Permanent Link to ';
  7. the_title_attribute(); echo '">'; the_title(); echo '</a></h2></div></div>';
  8.  
  9. }
  10.  
  11. elseif( is_category() ) {
  12.  
  13. echo'<div id="mainwrap"><div class="titleh2">
  14. <h2><a href="'. get_category_link(get_query_var('cat')) . ' "rel="bookmark" title="Permanent Link to ' . esc_attr( single_cat_title('', false) ) . '">'; single_cat_title(); echo '</a></h2></div></div>';
  15.  
  16. } ?>
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement