Posted By

m-pokrovskii on 03/01/10


Tagged

php wordpress markup


Versions (?)

Markup categories menu


 / Published in: PHP
 

  1. <?php
  2.  
  3. # Помечаем первый и последний пункт в меню Wordpress ( use wp_list_categories() )
  4.  
  5. function add_markup_categories($output) {
  6. $output= preg_replace('/cat-item/', ' first-cat-item cat-item', $output, 1);
  7. $output=substr_replace($output, " last-cat-item cat-item", strripos($output, "cat-item"), strlen("cat-item"));
  8. return $output;
  9. }
  10. add_filter('wp_list_categories', 'add_markup_categories');
  11. ?>

Report this snippet  

You need to login to post a comment.