How to add adblock code to all pages when not using wordpress?

Joined
Jan 20, 2016
Messages
439
Reaction score
52
I made a small website by hand to avoid the wordpress bloat. This hasn't proved to be a problem for just the simple posting of posts and adding of a couple of images per post but now I wanna ad the ads how can I make some sort of function that adds to all dynamically.

If I had to do it only once it wouldn't be a big issue however I will want to be testing ads so need some kind of function that will edit all pages at the same time.

I could code something in python to search every page and edit them through requests or suchlike but wondered if there are better ways to do it?

EDIT: oh noice php-include looks like what I want.
 
Last edited:
you should create a master-page / shared design template for all the common stuffs.

For example, let's say that your template is as follow

<html>
<body>
<header />
<content />
</body>
</html>

you could create two files, one as a template and other as the content (it depends in the library of your project

for example:

layout.template:
<html>
<body>
<header />
@include("content")
</body>
</html>

content.template
<content />
 
Back
Top