Forums

[resolved] wp_list_categories: include a variable (5 posts)

  1. Jellelle
    Member
    Posted 5 months ago #

    Hi all

    I want to modify the wp_list_categories(); a bit

    I have an array 'category_ID' which contains the ID's of a category I want to include. But how the hell do you do that? :D

    This doesn't work of course, but you get the drift :)
    wp_list_categories( 'include=category_ID[0]' );

    Cheers,
    Jelle

  2. MichaelH
    moderator
    Posted 5 months ago #

    Assuming $category is the array of ids

    $args = array('include' => $category);
    wp_list_categories($args);
  3. Jellelle
    Member
    Posted 5 months ago #

    Great, I'm getting it!
    Know how I still can add '&title_li='?

    Need to go to work, will take a look tonight
    Cheers :)

  4. MichaelH
    moderator
    Posted 5 months ago #

    $args = array(
    'include' => $category,
    'title_li' =>''
    );
  5. Jellelle
    Member
    Posted 5 months ago #

    My prayers have been answered!
    Thanks!

Reply

You must log in to post.

About this Topic