2013-03-13 51 views

回答

2

能夠搞清楚。

<?php 
      $categories = get_the_category(); 
      $separator = ' '; 
      $output = ''; 
      if($categories){ 
       foreach($categories as $category) { 
        $prev_step .= '<a href="'.get_category_link($category->term_id-1).'" title="' . esc_attr(sprintf(__("View all posts in %s"), $category->name)) . '" class="previous-step">'.get_cat_name($category->term_id-1).'</a>'.$separator; 
        $next_step .= '<a href="'.get_category_link($category->term_id+1).'" title="' . esc_attr(sprintf(__("View all posts in %s"), $category->name)) . '" class="next-step">'.get_cat_name($category->term_id+1).'</a>'.$separator; 
       } 
      } 
      ?> 
     <?php echo trim($prev_step, $separator);?> 
     <?php echo trim($next_step, $separator);?> 
相關問題