Forums

[resolved] Variable in wp_list_categories (3 posts)

  1. sagive
    Member
    Posted 10 months ago #

    Hey ;/

    I need to use a variable inside a wp_list_categories command..

    i am using this code:

    $catout = get_category_by_slug('featured');
    $id = $catout->term_id;
    echo '<ul>';
    wp_list_categories('hide_empty=0&title_li=&depth=1&exclude=(here i need the $id var)');
    echo '</ul>';

    Would apreciate your help plz

  2. alchymyth
    The Sweeper
    Posted 10 months ago #

    wp_list_categories('hide_empty=0&title_li=&depth=1&exclude=' . $id );
  3. sagive
    Member
    Posted 10 months ago #

    Works like a charm :)
    Thanks a lot

Reply

You must log in to post.

About this Topic