Home>

I don't understand the list of posted articles retrieved by the Wordpress main loop, so please let me know.

Create an individual post page of "Blog" in single.php, create a main loop in index.php, and display the post list of "Blog" in single.php.

The idea is that if you create a post page with a custom post type, info-single.php "Notice" in the same site and create a main loop in archive-info.php, the post list of info-single.php will be displayed. Is it okay?

This is, for example, archive-aaa when displaying the list of post pages called single-aaa.php, archive-bbb.php when displaying the list of post pages called single-bbb.php, and so on. Is it okay to recognize that the archive.php page is archive-〇〇〇.php, and the post page article list of the character string of the part of 〇〇〇 is output?

Also, is the wordpress management screen->settings->display settings "post page" set to the post page (single.php), or is the article list page/fixed page (index.php) set?

  • Answer # 1

    solved.

    Since index.php has a lower priority than archive-info.php, if nothing is specified, the article list will be displayed in index.php. On the contrary, if the category etc. is specified, the category list is displayed in archive.php, so there is no problem that the "article list" is displayed in index.php and the category list is displayed in archive.php. did.

Related articles