Return to Snippet

Revision: 24393
at March 1, 2010 06:16 by m-pokrovskii


Initial Code
<?php  

# Помечаем первый и последний пункт в меню Wordpress ( use wp_list_categories() )

function add_markup_categories($output) {
    $output= preg_replace('/cat-item/', ' first-cat-item cat-item', $output, 1);
	$output=substr_replace($output, " last-cat-item cat-item", strripos($output, "cat-item"), strlen("cat-item"));
    return $output;
}
add_filter('wp_list_categories', 'add_markup_categories');
?>

Initial URL

                                

Initial Description

                                

Initial Title
Markup categories menu

Initial Tags
php, wordpress

Initial Language
PHP