[Tex/LaTex] How to remove the section title in the header on a specific page but keep the page number using fancyhdr

fancyhdrheader-footer

Since days I am trying to remove the header on a page but to keep the page number. Here is my working example. The issue is that, when I remove the header using: \thispagestyle{plain}, it also removes the page number.
My first page is working correct except for the missing number. The second page is correct.

\documentclass[a4paper,11pt]{article}
\usepackage[ngerman]{babel} 
\usepackage{lipsum}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\sectionmark}[1]{\markboth{#1}{}} % set the \leftmark
\fancyhf{}
\fancyhead[L]{\leftmark} % 1. sectionname
\fancyfoot[C]{\thepage}
\fancypagestyle{plain}{%
\fancyhf{}%
\renewcommand{\headrulewidth}{0.0pt}%
}
\begin{document}
\section{Titel}
\thispagestyle{plain}
\lipsum[2-10]
\end{document}

Best Answer

When you issue \fancyhf{} it clears both the header and the footer. So, in your redefinition of the plain style, you're clearing whatever header and footer exist(ed). Re-establish the footer by including \fancyfoot[C]{\thepage} as part of the redefinition:

\documentclass{article}
\usepackage{lipsum,fancyhdr}
\pagestyle{fancy}
\renewcommand{\sectionmark}[1]{\markboth{#1}{}} % set the \leftmark
\fancyhf{}% Clear header/footer
\fancyhead[L]{\leftmark} % 1. sectionname
\fancyfoot[C]{\thepage}
\fancypagestyle{plain}{% Redefine plain pages tyle
  \fancyhf{}% Clear header/footer
  \renewcommand{\headrulewidth}{0.0pt}%
  \fancyfoot[C]{\thepage}
}
\begin{document}
\section{Titel}
\thispagestyle{plain}
\lipsum[2-10]
\end{document}