Repeated blocks throughout site

I’ve been working so much with cms like wordpress lately that it’s been ages since I built a HTML/CSS site from scratch.

My mindset is creating sites based on themes and templates. What is best practice these days to repeat sections of sites across pages without repeating code? Should I use php includes? Any clever way to do this now?

most modern web technology works with code reuse.
include is one of the choice with php.

with asp .net you can build master page template and reuse it for different pages.

The easiest way is to use server-side includes. Wherever you want to pull in a repeated code block, just add the line

<!--#include virtual="../block1.htm" -->

and then save the appropriate fragment file as “block1.htm”. You can include as many different blocks as you want in any one page, but they do all have to be on the same domain.

You will need to either save your main files with a .shtml extension, or configure the server to treat all files as though they are .shtml.