Support » Developing with WordPress » Basic WordPress Theme

  • Are there any very basic example themes using WordPress 5.5.1 best practices?
    I am interested in creating templates that use pagination for the following:
    category.php
    author.php
    search.php

    What best practices would need to go in function.php

    Before anyone suggests reading the www.4f19.cn Theme Handbook, that is what I have been trying to read. I have found the manual at the stage I am at too difficult to understand.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Forum Moderator & Support Team Volunteer

    Take a look at was the base “blank” theme for WP for several years, https://github.com/automattic/_s

    You can use its files as a tutorial for what you want to do.

    To see how it’s handled in the lastest themes, look at https://github.com/WordPress/twentytwentyone

    Thanks for replying Steven.

    I can’t see the category.php in the github files. I am looking for code to display all my posts in a list, with pagination showing 5-10 posts per page.

    Moderator bcworkz

    (@bcworkz)

    When category.php is not supplied by the theme, archive.php is used. The default queries in WP typically are setup to handle pagination. Your theme just needs to provide proper links to adjacent pages of post listings. You can see on the archive.php template this is done by calling the_posts_navigation().

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.