Change site style→

style-1 style-2
  1. nazenani
  2. >
  3. >
  4. >
  5. Making category archive.

Making category archive.

Wanna display 5 articles in multiple categories.

I…I was struggled…. Thank Mr.X for giving great advice!

Bad example

This code has some defects. It used only one category. If multiple categories are needed, how do I code?

Good example

Above code was improved about how to use array and where array used in.

Reference

取得したカテゴリ情報を配列に格納し、WP_Queryで使用する方法

Wanna make simple category archive.

‘get_categories’ give us categories data defined $args.
The point is ‘hide_empty’.
if a category don’t have any posts, the category is not shown.

comment

Fields with * is required.

go to related tags archive?

No tags setted.