[Tex/LaTex] Fancyhdr displaying wrong chapter

fancyhdr

I'm currently writing my dissertation and used this template;
https://www.sharelatex.com/templates/thesis/graduate-thesis

However I'm getting the most unusual error when using fancyhdr to display the chapter name in the header.

I want it so on the left side it displays the chapter name, and the page number on the right. Previously in the template the following was used;

\lhead{\emph{Contents}}  % Set the left side page header to "Contents"
\tableofcontents  % Write out the Table of Contents

So I copied this syntax when including the chapters like so ;

\input{Chapters/Chapter1} % Introduction
\lhead{\emph{Introduction}}  % Set the left side page header to "Introduction"

\input{Chapters/Chapter2} % Background Research 
\lhead{\emph{Background Research}}  % Set the left side page header to "Background Research"

The problem I am getting is that the chapter names are messing up, for example: Chapter 4 = Project Planning, and chapter 5 = Design, but for chapter 5 it wont display 'Design' in the header at all and carry on displaying 'Project Planning'.

Something else that is baffling me is that I originally had a chapter named 'Development' , and another named 'Testing', however I merged the two into one (just deleted the testing chapter and put the content into the development chapter), and renamed the lhead to 'Development & Testing', however when compiling and viewing the PDF, some pages will show 'Development' in the header, and others 'Development & Testing'.

I don't know why this is happening, the compiling I am doing is;

PdfLaTeX + Bib(la)tex + PdfLaTeX (x2) + View Pdf

If more code is required, I can supply it, but I thought If I were to link the template I am using, it would show what the code would look like.

Many Thanks for your help.

Best Answer

Thanks all for the comments and advice. Reading the link supplied by Johannes_B;

https://github.com/johannesbottcher/templateConfusion/blob/master/ourFamousThesisTemplate.md

A quick fix to the solution is to include the following in each chapter file (providing you remove the \lhead{chapter name goes here} from the main file);

\chapter{Background Research}
\label{Chapter2}
\lhead{\emph{Background Research}} % Write in your own chapter title to set the page header

This fixes the problem if you don't have the time to start fresh / use a better template.

However, for myself I think it will be best to start a fresh minimal template to reduce further errors from the template I have been using.

Thank you to those who have contributed.