WordPress.org

Ready to get started?Download WordPress

Forums

Help - Can't get categories (2 posts)

  1. kiriz
    Member
    Posted 2 years ago #

    Hi everyone!

    Please help, i am calling in my widget a get_categories function : for example
    $categories=get_categories('orderby=order&hide_empty=0&exclude=1');

    and it doesn't work - shows nothing.
    I also tried like this, it shows something, but that the Categories are empty:
    wp_list_categories($args)
    $args = array(
    'orderby' => 'name',
    'order' => 'ASC',
    'style' => 'list',
    'show_count' => 0,
    'hide_empty' => 1,
    'use_desc_for_title' => 1,
    'taxonomy' => 'category',
    'walker' => 'Walker_Category' );

    https://codex.wordpress.org/Template_Tags/wp_list_categories

    It shows:
    Categories
    No categories , although i have some.

    Please help!

  2. Jordy Meow
    Member
    Posted 1 year ago #

    Hey Kiriz,

    You should try with 'hide_empty' => false.

Topic Closed

This topic has been closed to new replies.

About this Topic