[theme-reviewers] Ticket #8055: Need help.

Philip M. Hofer (Frumph) philip at frumph.net
Wed Jun 6 20:08:28 UTC 2012


This one is new to me, the reference is here:

http://codex.wordpress.org/Theme_Review#Required_Hooks_and_Navigation

apply_filters(‘wp_title is found in wp-includes/general-template.php
It determines what the title is supposed to output, however it doesn’t do everything that people want it to, in most cases it doesn’t output the bloginfo appropriately on the home page that is specific for the theme.
It’s not that the codex is wrong at being a requirement, it’s more so that the current standards do not have enough documentation and core automatic themes are not utilizing the filter appropriately.
Example twentyeleven theme:

<title><?php
    /*
     * Print the <title> tag based on what is being viewed.
     */
    global $page, $paged;

    wp_title( '|', true, 'right' );

    // Add the blog name.
    bloginfo( 'name' );

    // Add the blog description for the home/front page.
    $site_description = get_bloginfo( 'description', 'display' );
    if ( $site_description && ( is_home() || is_front_page() ) )
        echo " | $site_description";

    // Add a page number if necessary:
    if ( $paged >= 2 || $page >= 2 )
        echo ' | ' . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) );

    ?></title>

This could actually be written as such:

add_filter(‘wp_title’, ‘twentyeleven_wp_title’);

function twentyeleven_wp_title($title) {
global $wp_query, $paged, $page;
    // add the blog name.
    $title .= get_bloginfo(‘name’);
    // Add the blog description for the home/front page.
    $site_description = get_bloginfo( 'description', 'display' );
    if ( $site_description && ( is_home() || is_front_page() ) )
        $title .= " | $site_description";
    // add a page number if necessary
    // Add a page number if necessary:
    if ( $paged >= 2 || $page >= 2 )
        $title .= ' | ' . _x( 'Page %s', 'twentyeleven' ), max( $paged, $page ) ;
    return $title;
}

^  little unsure of the _x( part and I’m doing this from memory.

But the biggest issue probably is lack of documentation to make that a requirement and people in the know not using it.

However, as you can see.   It *should* be done this way.

So the end result would be:

<title><?php wp_title( ‘|’, true, ‘right’); ?></title>

^^ Now, the problem will be the output.    Someone else want to chime in on if this is correct?
- Phil
From: Gazpo Themes 
Sent: Wednesday, June 06, 2012 12:52 PM
To: theme-reviewers at lists.wordpress.org 
Subject: [theme-reviewers] Ticket #8055: Need help.

Hello,
I need help about my theme ticket (http://themes.trac.wordpress.org/ticket/8055)

The theme reviewer has suggested: 'Themes must use wp_title filter.'
I have used the wp_title from the twenty eleven theme, and I can see that it works fine. Can someone tell me what's wrong with it?

Also about the header banner, it is by default linked to the local site where it will be installed. I really can't see where the problem is. 

Can someone please tell me about above issues, I will highly appreciate.

Thanks.
Sami.



--------------------------------------------------------------------------------
_______________________________________________
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/20120606/82bdc817/attachment.htm>


More information about the theme-reviewers mailing list