For capturing the section unit titles and have fancyhdr-style headings, Javier Bezos' titleps package provides an easy alternative:

\documentclass{article}
\usepackage{titleps,lipsum}% http://ctan.org/pkg/{titleps,lipsum}
\newpagestyle{main}{%
\setheadrule{0pt}%
\sethead{\sectiontitle} % header left
{} % header center
{\thesubsection~\subsectiontitle\quad$|$\quad\thepage}% header right
}
\pagestyle{main}
\begin{document}
\section{A section}\lipsum[1-2]
\subsection{A subsection}\lipsum[3-4]
\subsection{Another subsection}\lipsum[5-6]
\subsection{A subsection}\lipsum[7-8]
\subsection{Another subsection}\lipsum[9-10]
\section{Another section}\lipsum[1-2]
\subsection{A subsection}\lipsum[3-4]
\subsection{Another subsection}\lipsum[5-6]
\subsection{A subsection}\lipsum[7-8]
\subsection{Another subsection}\lipsum[9-10]
\end{document}
Within twoside mode, you could use
\sethead[<even-left>][<even-center>][<even-right>]
{<odd-left>}{hodd-center>}{<odd-right>}
\setfoot[<even-left>][<even-center>][<even-right>]
{<odd-left>}{<odd-center>}{<odd-right>}
for setting different headers/footers on even/odd pages.
You have to decide which \subsection to include in your headers. titleps uses the last-defined sectional heading. However, see the titleps documentation for more options (section 4. Marks, p 4 onwards).
twosidemode? Do you use thearticledocument class? Do you usehyperref? Please create a minimal working example (MWE). – Werner Jan 23 at 19:20