Move <title> markup to functions.php #12

Closed
obenland opened this Issue Mar 22, 2012 · 4 comments

Comments

Projects
None yet
3 participants
@obenland
Member

obenland commented Mar 22, 2012

From how I understand the WPTRT guideline on modifying the document title content, it would be best practice to filter 'wp_title' in functions.php and just have

<title><?php wp_title( /* optional params */ ); ?></title>

in header.php.

This would be a huge benefit for all SEO Plugins out there since they could easily modify the title and don't have to worry about stuff being added.

What do you say? :)

@ianstewart

This comment has been minimized.

Show comment
Hide comment
@ianstewart

ianstewart Mar 22, 2012

Contributor

I've been waiting for http://core.trac.wordpress.org/ticket/18548 to work itself out before moving on this but patches are welcome!

Contributor

ianstewart commented Mar 22, 2012

I've been waiting for http://core.trac.wordpress.org/ticket/18548 to work itself out before moving on this but patches are welcome!

@obenland

This comment has been minimized.

Show comment
Hide comment
@obenland

obenland Mar 22, 2012

Member

Hm, where would such a 'wp_title' filter function be placed best?
In tweak.php, since it tweaks the default behavior of the wp_title() function?
Or rather in functions.php itself, to make sure to always have a title?

What do you think?

Member

obenland commented Mar 22, 2012

Hm, where would such a 'wp_title' filter function be placed best?
In tweak.php, since it tweaks the default behavior of the wp_title() function?
Or rather in functions.php itself, to make sure to always have a title?

What do you think?

@ianstewart

This comment has been minimized.

Show comment
Hide comment
@ianstewart

ianstewart Mar 22, 2012

Contributor

Good question. I would probably put it in template-tags or functions.php

Contributor

ianstewart commented Mar 22, 2012

Good question. I would probably put it in template-tags or functions.php

@crondeau

This comment has been minimized.

Show comment
Hide comment
@crondeau

crondeau Jul 27, 2012

Has any progress or change been made on this? I submitted a theme to the repo and it was rejected because of the <title>. The reviewer mentioned the following - Themes are required to modify output via filter (wp_title/body_class/post_class)

(http://themes.trac.wordpress.org/ticket/8447)

Has any progress or change been made on this? I submitted a theme to the repo and it was rejected because of the <title>. The reviewer mentioned the following - Themes are required to modify output via filter (wp_title/body_class/post_class)

(http://themes.trac.wordpress.org/ticket/8447)

obenland added a commit that referenced this issue Nov 28, 2012

Merge pull request #79 from kovshenin/patch-11
* Introduces a filter for wp_title instead of hard-coding things in header.php
* Renames inc/tweaks.php to inc/extras.php
* Includes inc/extras.php by default in functions.php

See #12, #13, #33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment