How Do I Set the Page Title Dynamically?

There is no documentation on it but you could always apply a filter to the_title like this:

add_filter('the_title','some_callback');
function some_callback($data){
    global $post;
    // where $data would be string(#) "current title"
    // Example:
    // (you would want to change $post->ID to however you are getting the book order #,
    // but you can see how it works this way with global $post;)
    return 'Book Order #' . $post->ID;
}

See these:

http://codex.wordpress.org/Function_Reference/the_title

http://codex.wordpress.org/Function_Reference/add_filter

Leave a Comment