[theme-reviewers] No-Title Filter for the_title()

Chip Bennett chip at chipbennett.net
Tue Mar 8 20:25:38 UTC 2011


The issue arises when Post Title is the only available permalink to the
Single-Post view. In this case, the developer may want to provide text such
as "No Title", etc., so that the permalink still gets displayed.

Chip

On Tue, Mar 8, 2011 at 2:15 PM, <michael at mfields.org> wrote:

> Is there a need for a conditional test?
>
> I wrap all my code within the function and the conditional as pect is
> handled for you:
>
> the_title( '<h2>', '</h2>' );
>
> This way the tags will not be printed if the title is empty.
>
> -Mike
>
> > Ran across this suggestion on the WPORG support forums:
> >
> >
> http://wordpress.org/support/topic/handling-display-of-title-when-none-exists?replies=1
> >
> > I like this approach; it is cleaner than performing a conditional test in
> > the template file.
> >
> > Just thought I'd pass it along...
> >
> > Chip
> > _______________________________________________
> > theme-reviewers mailing list
> > theme-reviewers at lists.wordpress.org
> > http://lists.wordpress.org/mailman/listinfo/theme-reviewers
> >
>
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20110308/68717f13/attachment.htm>


More information about the theme-reviewers mailing list