[theme-reviewers] Posts without Titles
Chip Bennett
chip at chipbennett.net
Wed Apr 20 21:20:57 UTC 2011
p.s. that function should be prefixed with theme-slug, and the conditional
should be written in "Yoda" casing:
if ( '' == $title )
rather than
if ( $title == '' )
;)
Chip
On Wed, Apr 20, 2011 at 4:15 PM, Philip Walton <philip at philipwalton.com>wrote:
> Right, I get that. I guess perhaps it's more an issue of why WordPress
> allows you to publish a post without a title in the first place. It seems to
> me that posts without titles have bigger problems than whether or not a user
> can get to them.
>
> Actually, as I'm writing this email, Emil posted a solution on the trac
> ticket that i really like:
>
> /**
> * Where the post has no post title, but must still display a link to the
> single-page post view.
> */
> add_filter('the_title', 'blank_slate_title');
>
> function blank_slate_title($title) {
> if ($title == '') {
> return 'Untitled';
> } else {
> return $title;
> }
> }
>
>
> This way you don't have to include an extra link if you don't want to.
>
> Thanks, Emil!
>
>
>
> On 4/20/11 1:58 PM, Chip Bennett wrote:
>
> Because the user needs to have *some* way of reaching the single-post view.
>
>
> Chip
>
> On Wed, Apr 20, 2011 at 3:55 PM, Philip Walton <philip at philipwalton.com>wrote:
>
>> A user, in response to a rejected them, posed this question re: smgrundy's
>> review:
>>
>> Cannot access single-page views of posts without titles from the index.
>> -> That's good, consistent and how I want it throughout the site. Is this
>> mandatory?
>>
>> I've wondered the same things as well. It's always seemed a little odd to
>> me to have the post date link to the post itself. Personally I think the
>> date should link to a date page. I know there are other ways to create a
>> title-less permalink, but this is the most common.
>>
>> Still, what is the rationale behind requiring posts with no titles to have
>> a permalink to them?
>> _______________________________________________
>> theme-reviewers mailing list
>> theme-reviewers at lists.wordpress.org
>> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>>
>
>
> _______________________________________________
> theme-reviewers mailing listtheme-reviewers at lists.wordpress.orghttp://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/20110420/9e4e6a48/attachment-0001.htm>
More information about the theme-reviewers
mailing list