# Modify footer of first page in custom class

I know I can do

\maketitle
\thispagestyle{fancy}


But I want my custom class that I am making (based on article) to do this for me. It already does pagestyle{fancy}, but I can't get it to change the first page.

I tried (adding this to myclass.cls)

\AtBeginDocument{\thispagestyle{fancy}}


but that didn't work.

I also tried redefining \maketitle and adding it at the end:

\def\@maketitle{%
\newpage
\null
\vskip 2em%
\begin{center}%
\let \footnote \thanks
{\LARGE \@title \par}%
\vskip 1.5em%
{\large
\lineskip .5em%
\begin{tabular}[t]{c}%
\@author
\end{tabular}\par%
}%
\vskip 1em%
{\large \@date}%
\end{center}%
\par
\vskip 1.5em%
\thispagestyle{fancy} %%%%%%%%%%%%% HERE
}


but that didn't work either.

-
I've added what I tried with \maketitle in the post. I copied the code from tex.stackexchange.com/a/844/8289, and found that it did not change the appearance so it must be right (but of course the line I added in didn't change anything either, when it should have). –  Mk12 Jun 27 '12 at 22:36

It wouldn't matter adding \thispagestyle{fancy} at the end of \@maketitle, since \maketitle issues \thispagestyle{plain} after calling \@maketitle, overriding any styles you set within \@maketitle.
Add the following to your class, after loading fancyhdr and the definition of \maketitle (or loading article, if you're not defining \maketitle yourself):
\g@addto@macro{\maketitle}{\thispagestyle{fancy}}

This appends \thispagestyle{fancy} after \maketitle. And, since article doesn't issue a page break after \maketitle, you should still be on the same page, making the above additional valid.