Reverse the Default Page Title Order in Textpattern

posted on 2009-09-16 09:32:35+08:00 by 7895734
Textpattern's default page title markup -- txp:page_title -- always places the site name in front of the individual page name. This is irritating, because I prefer to have the interior content title come before the site title itself -- it just makes more sense that way and it's a lot more search engine friendly.

Use this code to replace txp:page_title on the page template to get the desired effect.
  1. <txp:if_section name="">
  2. <title><txp:site_name /></title>
  3. <txp:else />
  4. <txp:if_individual_article>
  5. <title><txp:title /> - <txp:site_name /></title>
  6. </txp:if_individual_article>
  7. </txp:if_section>

All Code Snippets

Hot Code Snippets

New Code Snippets