generic-github-user / Star

A website where anyone can rate anything.
0 stars 1 forks source link

Automatically add header to all pages on website #20

Closed generic-github-user closed 6 years ago

generic-github-user commented 6 years ago

Probably using PHP includes.

generic-github-user commented 6 years ago

This can also be done easily with jQuery's .load() function:

generic-github-user commented 6 years ago

Header HTML include function has been added to main.js.

$(() => $("#header").load("header.html"));

Changes to the header.html file will be automatically reflected on all pages that load the header (just about all pages).

generic-github-user commented 6 years ago

Looks like this broke the post page . . .

generic-github-user commented 6 years ago

jQuery still needs to be added to the page.

generic-github-user commented 6 years ago

Added jQuery to the page.

generic-github-user commented 6 years ago

Post content is now filled directly into the header div for posts.