• Resolved renato_s

    (@renato_s)


    Hi!
    I thought it was an easy task but am not managing to solve it. All I want is to make a loop to display 5 posts for every child-category of a specific category. To do this, I guess I have to obtain the IDs of those categories but I can’t find out how to do this.

    Here’s what I ant to do:
    1. Obtain all IDs for children of category X;
    2. For each child-category, create a Loop with get_posts;
    3. Display information about the posts for each child category;

    The thing is that these child-categories will be continuously updated, so I had to search for them automatically…

Viewing 1 replies (of 1 total)
  • Thread Starter renato_s

    (@renato_s)

    Sorry…
    I found it just after I posted the question.

    One has to use get_categories(‘child_of=X’);

    It will return an array that can be manipulated through foreach.

Viewing 1 replies (of 1 total)
  • The topic ‘Get IDs of children of category X’ is closed to new replies.