How to disable (get rid of) home page main loop entirely?

I’m using a custom theme, the index page doesn’t depend on the main loop for home (which by default get the latest 10 posts for example).

How can I get rid of the home loop entirely, so the index doesn’t request any additional data from the database?

Related posts

1 comment

  1. “The Loop” is WordPress. Trying to get rid of it is impossible. It may return no results, but it will always be called.

    That being said, it does not mean that you have to call a listing of posts on your home page. If you instead plan on customizing the front page to be “static content” (ie. a “Page”), then you can use the WordPress Template Hierarchy to change the way it works.

    Create a template called “front-page.php” in your theme directory that will still run/display the loop. Then in the Administration panel under Settings->Reading, where it says “Front page displays”, select the radio button for “A static page (select below)”. You can then use that Page to modify the content area of your home page template.

    You can read more about the Template Hierarchy here… http://codex.wordpress.org/Template_Hierarchy

Comments are closed.