Site logo

Archived topic

Content Template or Loop Template

5 replies · Started by PHILIP on December 13, 2022

Viewing posts 1–6 of 6

Is there a rule of thumb as to when I should use a ...
- Content Template (or)
- Loop Template
Please?

The loop template has the pagination option but otherwise they seem fairly similar.

What are the differences and is there any simple rational or reasoning I can go through to choose when to use which please?

For instance...

If it's a blog or archive page use the loop template.
However, if want to do this, this, or this ... use the content template.

Thanks.

Hi there,

Content Templates:
Use these for Single Posts / Singular templates ( this also includes things like 404 an No Results pages )
And Archive Pages where you want to use Theme features such as Columns, Masonry, Infinite Load.
They also allow you to mix multiple templates, so if you want a different template for different categories in your blog then you can.

Loop Template
Use these ONLY for Archives.
Use them where you want block editor level control for designing your grid and where you want to add other content around the loop without having to use other block elements.

Thanks David

This is what I've gathered so far...

The content template designs the way a single post is listed in the post grid. This will be repeated as many times as you have posts to display.

But it does not let you design the page above or below the grid of posts.

The loop template lets you build an introductory section above the post grid and a section below the post grid.

Also consider if you want to use the customiser settings to show or hide the featured image, display posts in columns or masonry layout, and display the read more link as a button.

Have I got this right?

The content template designs the way a single post is listed in the post grid. This will be repeated as many times as you have posts to display.

Correct.

[content template] But it does not let you design the page above or below the grid of posts.

Correct - you would need to use other Block Element Hooks to add content before / after posts.

Also consider if you want to use the customiser settings to show or hide the featured image, display posts in columns or masonry layout, and display the read more link as a button.

Correct for Content Templates with exceptions; the customizer will only control the columns, masonry, infinite scroll and spacing options. Featured images, read more and other elements that are displayed will be set in the Content Template.

The loop template lets you build an introductory section above the post grid and a section below the post grid.

Correct.

Thanks David

This gives me a much clearer understanding of when to use the content template and when to use the loop template.

You're welcome

This archived topic is closed to new replies.