WordPress.org

Ready to get started?Download WordPress

Forums

how to list parent terms only (3 posts)

  1. Rakesh Raja
    Member
    Posted 2 years ago #

    Hello Friends

    I have the following code to list all terms, but I need a code where I can list only "parent terms" as they all have child terms too

    http://pastebin.com/G6K7gDXE

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    get_terms() has the 'parent' parameter:

    parent
    (integer) Get direct children of this term (only terms whose explicit parent is this value). If 0 is passed, only top-level terms are returned. Default is an empty string.

    http://codex.wordpress.org/Function_Reference/get_terms

  3. Rakesh Raja
    Member
    Posted 2 years ago #

    I did try but didnt work

    Can you look at my code and tell me where to add?

Topic Closed

This topic has been closed to new replies.

About this Topic