[wp-hackers] is it possible to change the_title halfway into the processing of a page/post?

Mike Little wordpress at zed1.com
Wed Feb 22 09:44:37 UTC 2012


You need to detect the query strings in the url early on in the process as
previously demonstrated to you. Do that with a template_redirect hook in
your theme's functions.php
But to do your actual processing, create a page template and fill that with
your display code, assign that template to your special page.

So:
* on the template_include hook detect your query vars,
* if detected query your db, calculate your title (cache the db results)
* set up the_title filter to return your desired title OR just add some
code to header.php to use your different title
*in the page template, output the results of your earlier db query.

Mike
-- 
Mike Little
http://zed1.com/


More information about the wp-hackers mailing list