List Categories of the Parent Category of the Current Category

Assuming you have only two levels of categories, you could first retrieve the parent category and then list the child categories. Furthermore, calling get_children and wp_list_categories uses more resources than necessary, using only wp_list_categories would suffice. I’ve explained my answer in the following snippet that should behave exactly as you need it to! $category_id = … Read more

How to show posts of an columnized different categories on the same line or row?

One way to output the same query yet style it differently is to use current_post or in combination with rewind_posts, or using rewind_posts alone. So for example: Your initial query if ($my_query->have_posts()) :while ($my_query->have_posts()) : $my_query->the_post(); $counter_id = $my_query->current_post + 1; //this is the counter // then use a conditional to style each on based … Read more