# Removing some slide numbers in Beamer class Berkeley?

Using exactlay the code provided here: Slide number in beamer Berkeley header? I inserted slide numbers. However, I do not want them for some slides (mostly back-up slides): Could you please help me? What I tried but did not work:

 \documentclass{beamer}
\usepackage[english]{babel}
\usepackage[ansinew]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amsfonts,amssymb}
\usepackage{mathptmx}
\usepackage{booktabs}
\usepackage{dcolumn}
\usepackage{tikz}
\usetikzlibrary{spy}

\usetheme{Berkeley}
\makeatletter
\setbeamertemplate{frametitle}{%
\nointerlineskip%
\vfil
\leftskip=-\beamer@leftmargin%
\rightskip=-\beamer@rightmargin%
{\usebeamercolor[fg]{frametitle}
{\usebeamercolor[fg]{framesubtitle}
\usebeamerfont{framesubtitle}\insertframesubtitle\par}%
\vbox{}%
\vskip-1em%
\vfil
}%
}
\makeatother
\usefonttheme{professionalfonts}
\setbeamertemplate{bibliography item}[triangle]

\begin{document}

\begin{frame}{Numbered slide}

I am a slide that wants a number.

\end{frame}

Here should be no number.
\end{frame}

\end{document}

• Please don't post code fragments. Instead, put your fragments into a complete compilable document that shows the problem. – erik May 23 '19 at 20:52
• thank you @erik – canIchangethis May 29 '19 at 16:49

You've redefined frametitle to include the frame number, but you haven't made that conditional on the noframenumbering option. To change this, you can redefine frametitle to omit the frame number for \ifbeamer@noframenumbering. Try the following in your example.

 \makeatletter
\setbeamertemplate{frametitle}{%
\nointerlineskip%
\vfil
\leftskip=-\beamer@leftmargin%
\rightskip=-\beamer@rightmargin%
{\usebeamercolor[fg]{frametitle}
\usebeamerfont{frametitle}