• Resolved Jim Bouton

    (@piersrueb)


    I am using wp list categories to create a menu listing a series of categories, sub categories, sub sub categories and so on…

    <?php wp_list_categories('depth => 0&title_li='); ?>

    I want to remove the link from the outermost parent category. I have searched the documentation for this with no luck. Any help would be much appreciated. Ta

Viewing 3 replies - 1 through 3 (of 3 total)
  • The simplest way is to to remove them with javascript. :p

    Actually here is the way to do it with php.
    You should extend Walker_Category class.
    Add this to you your functions.php http://pastebin.com/MMkct4wW
    Then call this extended class from your template this way:

    $walker = new My_Walker_Category();
    $args = array( 'walker' => $walker );
    wp_list_categories($args);

    Add any options you want to pass to the function wp_list_categories to the array $args.

    Thread Starter Jim Bouton

    (@piersrueb)

    Thanks, i actually did it with js, but this is probable better.

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove links from wp list categories’ is closed to new replies.