Forums

how to list parent terms only (3 posts)

  1. rakeshraja
    Member
    Posted 8 months 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
    Posted 8 months 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. rakeshraja
    Member
    Posted 8 months ago #

    I did try but didnt work

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

Reply

You must log in to post.

About this Topic