# Removing header from empty page without removing page numbering

I'm using a two-sided openright report template for my thesis and I am trying to only remove the page header from the auto-generated empty pages (due to the even/odd page number interaction) and keep the page numbering. I have tried to include the emptypage package but to no avail, as it also removes the page numbering at the start of a new chapter. Down below is the code generating the page header and page numbering.

% Header and footer settings (Select TWOSIDE or ONESIDE layout below)
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{\thechapter.\space#1}{}}

% Select one-sided (1) or two-sided (2) page numbering
\def\layout{2}  % Choose 1 for one-sided or 2 for two-sided layout
% Conditional expression based on the layout choice
\ifnum\layout=2 % Two-sided
\fancyhf{}
\fancyfoot[LE,RO]{\thepage}
\fancypagestyle{plain}{         % Redefine the plain page style
\fancyhf{}
\fancyfoot[LE,RO]{\thepage}
\else           % One-sided
\fancyhf{}
\fancyfoot[C]{\thepage}
\fi


How should I proceed?

You have to include \fancyfoot[LE,RO]{\thepage} in the argument for fancy page style plain, if the page number should appear on chapter pages.

If the blank pages should use page style plain, you can load package scrextend with option cleardoublepage=plain:

\documentclass[twoside,openright]{report}

\usepackage[cleardoublepage=plain]{scrextend}

% Header and footer settings (Select TWOSIDE or ONESIDE layout below)
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{\thechapter.\space#1}{}}

% Select one-sided (1) or two-sided (2) page numbering
\def\layout{2}  % Choose 1 for one-sided or 2 for two-sided layout
% Conditional expression based on the layout choice
\ifnum\layout=2 % Two-sided
\fancyhf{}
\fancyfoot[LE,RO]{\thepage}
\fancypagestyle{plain}{         % Redefine the plain page style
\fancyhf{}
\fancyfoot[LE,RO]{\thepage}
}
\else           % One-sided
\fancyhf{}