<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">The problem is that the output is not filterable in its entirety, and Plugins can't modify it.<div><br></div><div><a href="http://codex.wordpress.org/Theme_Review#Function_Parameters.2C_Filters.2C_and_Action_Hooks">The requirement</a> is pretty clear on this: "wp_title(): Themes are <b>required</b> to modify output via filter (<tt><font class="Apple-style-span" face="Helvetica">wp_title)"</font></tt></div><div><br></div><div>So no, the way Twenty Eleven and countless other Themes do it is not correct, as frumph pointed out.</div><div>The example Cais gave earlier is great, as is <a href="http://wordpress.stackexchange.com/questions/32622/when-calling-wp-title-do-you-have-to-create-some-kind-of-title-php-file">Chip's on StackExchange</a>.</div><div><br></div><div>Konstantin<br><div><br><div><div>On 07.06.2012, at 07:26, Gazpo Themes wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">I am still confused, most of the recently accepted themes are using following code. I have used exactly same but theme reviewer is not accepting mine. What's the problem with it?<br><br><title><?php<br> global $page, $paged;<br>
wp_title( '|', true, 'right' );<br> bloginfo( 'name' );<br><br> $site_description = get_bloginfo( 'description', 'display' );<br> if ( $site_description && ( is_home() || is_front_page() ) )<br>
echo " | $site_description";<br><br> if ( $paged >= 2 || $page >= 2 )<br> echo ' | ' . sprintf( __( 'Page %s', 'silverorchid' ), max( $paged, $page ) );<br><br> ?></title><br>
<br>Thanks.<br>Sami.<br><br><br><br><br><div class="gmail_quote">On Thu, Jun 7, 2012 at 3:11 AM, Edward Caissie <span dir="ltr"><<a href="mailto:edward.caissie@gmail.com" target="_blank">edward.caissie@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Yes, there is some confusion here ...<br><br>1. The use of the template tag `wp_title` is expected; but,<br>2. `wp_title` is expected to be use "correctly" as well.<br>
<br>Essentially, after varied discussions and input from several people, it was decided the correct / best practice method of using the template tag was to initially use the standard parameters then filter any "decorative" text, etc. into it afterward. The example in TwentyEleven works but could be improved upon to maintain the extensibility of the `wp_title` template tag.<br>
<br>As an example from Desk Mess Mirrored, which generates a very similar output to TwentyEleven (and TwentyTen) see the following code:<br><br>Use `<?php wp_title( '|', true, 'right' ); ?>` in the header.php template; and,<br>
<br>Use something similar to the following as the filtered function:<br><br>`<?php<br>/**<br> * Use as filter input<br> *<br> * @param string $old_title - default title text<br> * @param string $sep - separator character<br>
* @param string $sep_location - left|right - separator placement in relationship to title<br> *<br> * @return string - new title text<br> */<br> function dmm_wp_title( $old_title, $sep, $sep_location ) {<br>
global $page, $paged;<br> /** Set initial title text */<br> $dmm_title_text = $old_title . get_bloginfo( 'name' );<br> /** Add wrapping spaces to separator character */<br>
$sep = ' ' . $sep . ' ';<br><br> /** Add the blog description (tagline) for the home/front page */<br> $site_tagline = get_bloginfo( 'description', 'display' );<br>
if ( $site_tagline && ( is_home() || is_front_page() ) )<br> $dmm_title_text .= "$sep$site_tagline";<br><br> /** Add a page number if necessary */<div class="im"><br>
if ( $paged >= 2 || $page >= 2 )<br></div>
$dmm_title_text .= $sep . sprintf( __( 'Page %s', 'desk-mess-mirrored' ), max( $paged, $page ) );<br><br> return $dmm_title_text;<br> }<br> add_filter( 'wp_title', 'dmm_wp_title', 10, 3 );<br>
?>`<br><br>Again, this is only a (working) example, and it is not a definitive requirement that themes do this explicitly; but, it will make plugin authors much happier and your end-users as well, especially those that use SEO plugins which typically hook into the `wp_title` template tag.<br>
<br>Hope that makes some sense of the issue ...<br><br><br clear="all">Cais.<div class="HOEnZb"><div class="h5"><br>
<br><br><div class="gmail_quote">On Wed, Jun 6, 2012 at 6:39 PM, Kirk Wight <span dir="ltr"><<a href="mailto:kwight@kwight.ca" target="_blank">kwight@kwight.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I think the confusion is in terminology. There are both a wp_title filter and a wp_title template tag; the requirement refers to the template tag which, if taken as-is from Twenty Eleven, should be fine.<div>
<div><div><br></div><div>
<br><div class="gmail_quote">On 6 June 2012 16:08, Philip M. Hofer (Frumph) <span dir="ltr"><<a href="mailto:philip@frumph.net" target="_blank">philip@frumph.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div dir="ltr">
<div style="font-size:12pt;font-family:'Calibri'">
<div>This one is new to me, the reference is here:</div>
<div> </div>
<div><a title="http://codex.wordpress.org/Theme_Review#Required_Hooks_and_Navigation" href="http://codex.wordpress.org/Theme_Review#Required_Hooks_and_Navigation" target="_blank">http://codex.wordpress.org/Theme_Review#Required_Hooks_and_Navigation</a></div>
<div> </div>
<div>
<div style="font-size:small;font-style:normal;text-decoration:none;font-family:'Calibri';display:inline;font-weight:normal">apply_filters(‘wp_title
is found in wp-includes/general-template.php</div></div>
<div>
<div style="font-size:small;font-style:normal;text-decoration:none;font-family:'Calibri';display:inline;font-weight:normal"> </div></div>
<div>
<div style="font-size:small;font-style:normal;text-decoration:none;font-family:'Calibri';display:inline;font-weight:normal">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.</div></div>
<div>
<div style="font-size:small;font-style:normal;text-decoration:none;font-family:'Calibri';display:inline;font-weight:normal"> </div></div>
<div>
<div style="font-size:small;font-style:normal;text-decoration:none;font-family:'Calibri';display:inline;font-weight:normal">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.</div></div>
<div>
<div style="font-size:small;font-style:normal;text-decoration:none;font-family:'Calibri';display:inline;font-weight:normal"> </div></div>
<div>
<div style="font-size:small;font-style:normal;text-decoration:none;font-family:'Calibri';display:inline;font-weight:normal">Example
twentyeleven theme:</div></div>
<div>
<div> </div>
<div><title><?php</div>
<div> /*</div>
<div> * Print the <title> tag based on what is
being viewed.</div>
<div> */</div>
<div> global $page, $paged;</div>
<div> </div>
<div> wp_title( '|', true, 'right' );</div>
<div> </div>
<div> // Add the blog name.</div>
<div> bloginfo( 'name' );</div>
<div> </div>
<div> // Add the blog description for the home/front
page.</div>
<div> $site_description = get_bloginfo( 'description',
'display' );</div>
<div> if ( $site_description && ( is_home() ||
is_front_page() ) )</div>
<div> echo " |
$site_description";</div>
<div> </div>
<div> // Add a page number if necessary:</div>
<div> if ( $paged >= 2 || $page >= 2 )</div>
<div> echo ' | ' . sprintf( __( 'Page
%s', 'twentyeleven' ), max( $paged, $page ) );</div>
<div> </div>
<div> ?></title></div></div>
<div> </div>
<div>This could actually be written as such:</div>
<div> </div>
<div>add_filter(‘wp_title’, ‘twentyeleven_wp_title’);</div>
<div> </div>
<div>function twentyeleven_wp_title($title) {</div>
<div>global $wp_query, $paged, $page;</div>
<div> // add the blog name.</div>
<div> $title .= get_bloginfo(‘name’);</div>
<div> // Add the blog description for the home/front
page.</div>
<div> $site_description = get_bloginfo( 'description',
'display' );</div>
<div> if ( $site_description && ( is_home() ||
is_front_page() ) )</div>
<div> $title .= " |
$site_description";</div>
<div> // add a page number if necessary</div>
<div> // Add a page number if necessary:</div>
<div> if ( $paged >= 2 || $page >= 2 )</div>
<div> $title .= ' | ' . _x( 'Page %s',
'twentyeleven' ), max( $paged, $page ) ;</div>
<div> return $title;</div>
<div>}</div>
<div> </div>
<div>^ little unsure of the _x( part and I’m doing this from memory.</div>
<div> </div>
<div>But the biggest issue probably is lack of documentation to make that a
requirement and people in the know not using it.</div>
<div> </div>
<div>However, as you can see. It *should* be done this way.</div>
<div> </div>
<div>So the end result would be:</div>
<div> </div>
<div><title><?php wp_title( ‘|’, true, ‘right’);
?></title></div>
<div> </div>
<div>
<div style="font-size:small;font-style:normal;text-decoration:none;font-family:'Calibri';display:inline;font-weight:normal">^^
Now, the problem will be the output. Someone else want to
chime in on if this is correct?</div></div>
<div>
<div style="font-size:small;font-style:normal;text-decoration:none;font-family:'Calibri';display:inline;font-weight:normal"> </div></div>
<div>
<div style="font-size:small;font-style:normal;text-decoration:none;font-family:'Calibri';display:inline;font-weight:normal">-
Phil</div></div>
<div>
<div style="font-size:small;font-style:normal;text-decoration:none;font-family:'Calibri';display:inline;font-weight:normal"> </div></div>
<div>
<div style="font-size:small;font-style:normal;text-decoration:none;font-family:'Calibri';display:inline;font-weight:normal"></div>
<div style="FONT:10pt tahoma">
<div style="BACKGROUND:#f5f5f5">
<div><b>From:</b> <a title="themes@gazpo.com" href="mailto:themes@gazpo.com" target="_blank">Gazpo Themes</a> </div>
<div><b>Sent:</b> Wednesday, June 06, 2012 12:52 PM</div>
<div><b>To:</b> <a title="theme-reviewers@lists.wordpress.org" href="mailto:theme-reviewers@lists.wordpress.org" target="_blank">theme-reviewers@lists.wordpress.org</a>
</div>
<div><b>Subject:</b> [theme-reviewers] Ticket #8055: Need
help.</div></div></div>
<div> </div></div>
<div style="font-size:small;font-style:normal;text-decoration:none;font-family:'Calibri';display:inline;font-weight:normal"><div><div>Hello,<br>I
need help about my theme ticket (<a href="http://themes.trac.wordpress.org/ticket/8055" target="_blank">http://themes.trac.wordpress.org/ticket/8055</a>)<br><br>The
theme reviewer has suggested: 'Themes must use wp_title filter.'<br>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?<br><br>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. <br><br>Can someone please tell me about above issues,
I will highly appreciate.<br><br>Thanks.<br>Sami.<br>
</div></div><div>
<br class="webkit-block-placeholder"></div><hr>
_______________________________________________<br>theme-reviewers mailing
list<br><a href="mailto:theme-reviewers@lists.wordpress.org" target="_blank">theme-reviewers@lists.wordpress.org</a><br><a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br><div><br class="webkit-block-placeholder"></div></div></div></div></div>
<br>_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org" target="_blank">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org" target="_blank">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
<br></blockquote></div><br>
</div></div><br>_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
<br></blockquote></div><br>
_______________________________________________<br>theme-reviewers mailing list<br><a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>http://lists.wordpress.org/mailman/listinfo/theme-reviewers<br></blockquote></div><br></div></div></body></html>