GrandParent ,Parent, Child issue

You’re using get_children and it’s doing exactly what you told it to do. You told it to get all the descendants of that post, and thats what you got. You need to be more specific about what you’re querying for, that you only want immediate descendants. You almost had the right idea originally: $pages = … Read more

the_category() tag not styling HTML or CSS

get_the_category returns an array with all the categories $categories = get_the_category(); foreach ($categories as $category){ echo ‘<a class=”post-item” href=”‘ . get_category_link($category->term_id) . ‘”>’ . $category->cat_name . ‘</a>’; } Tha code should work, you can modify it to add the title Also, calling the_category echoes the result, that why i’m using the this function