2013-08-26 3 views
0

Желаю показать категорию 35 до 33 на index.php и archive.php. Это возможно?Заказать в петле wordpress

Мой код заключается в следующем:

<?php 
    if (in_category('467')) { 
     echo 'Todas las provincias'; 
    } else { 
     foreach((get_the_category()) as $category) { 

      if (($category->cat_ID == '2') || ($category->cat_ID == '3') || ($category->cat_ID == '5') || ($category->cat_ID == '6') || ($category->cat_ID == '38') || ($category->cat_ID == '39') || ($category->cat_ID == '40') || ($category->cat_ID == '41') || ($category->cat_ID == '42') || ($category->cat_ID == '43') || ($category->cat_ID == '44') || ($category->cat_ID == '45') || ($category->cat_ID == '46') || ($category->cat_ID == '47') || ($category->cat_ID == '48') || ($category->cat_ID == '50') || ($category->cat_ID == '51') || ($category->cat_ID == '52') || ($category->cat_ID == '53') || ($category->cat_ID == '54') || ($category->cat_ID == '55') || ($category->cat_ID == '56') || ($category->cat_ID == '57') || ($category->cat_ID == '58') || ($category->cat_ID == '60') || ($category->cat_ID == '61') || ($category->cat_ID == '62') || ($category->cat_ID == '63') || ($category->cat_ID == '64') || ($category->cat_ID == '65') || ($category->cat_ID == '66') || ($category->cat_ID == '67') || ($category->cat_ID == '68') || ($category->cat_ID == '69') || ($category->cat_ID == '70') || ($category->cat_ID == '71') || ($category->cat_ID == '72') || ($category->cat_ID == '73') || ($category->cat_ID == '74') || ($category->cat_ID == '75') || ($category->cat_ID == '76') || ($category->cat_ID == '77') || ($category->cat_ID == '78') || ($category->cat_ID == '79') || ($category->cat_ID == '80') || ($category->cat_ID == '81') || ($category->cat_ID == '82') || ($category->cat_ID == '83') || ($category->cat_ID == '326') || ($category->cat_ID == '327') || ($category->cat_ID == '335')) { 
       echo '<a href="' . get_category_link($category->term_id) . '" title="' . sprintf(__("View all posts in %s"), $category->name) . '" ' . '>' . $category->name.'</a><span> , </span>'; 
      } 
     } 
    } 
?> 

ответ

Смежные вопросы