Output parent/child categories and posts in that parent/child hierarchy
You’re right that we need to handle parent-child relationships differently. Let me explain the approach and then show you the code changes needed. The key is to: First get only top-level categories (parent = 0) For each top-level category, check for child categories Display the hierarchy properly in the accordion <script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js”></script> <link rel=”stylesheet” href=”https://ajax.googleapis.com/ajax/libs/jqueryui/1.13.2/themes/smoothness/jquery-ui.css”> … Read more