WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Variable in wp_list_categories (3 posts)

  1. sagive
    Member
    Posted 3 years 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
    Forum Moderator
    Posted 3 years ago #

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

    Works like a charm :)
    Thanks a lot

Topic Closed

This topic has been closed to new replies.

About this Topic