hi,
i'm wondering if it is possible to 'assign' a title to pages that are created by plugins like a newsletter-script or photopress.
I want this information to be used by a web-tracker that analyzes the user behaviour.
Problem is, the index page and all pages created by the plugins don't have a title, so how do i work around this, to have the information available in the header (where the tracker code sits).
Ideas are welcome! Thanks in advance
http://www.bastianfleig.de
Have you tried using the <?php wp_title(); ?> tag on the pages that are embedded with the plug-in?
The templates that the plug-in use to generate the pages, are they WP's templates or are they different within your blog?
i use only 2 wp-plugins.
wp_title(); returns nothing for a plugin-generated page - i have not figured out how to set a title by hand or make a dirty hack.
i had some problems with the scope of variables, now i use getter&setter functions to store the info, well.
Glad to see it works now! Maybe if you could post a more detail explanation of the solution, so other users can benefit from it as well.
Cheers,
Michael.
Very basic solution.
in template-functions-general.php
function setMyTitle($myTitleIn) {
global $myTitle;
$myTitle = $myTitleIn;
}
function getMyTitle() {
global $myTitle;
return $myTitle;
}
i then call setMyTitle('...') before calling get_header()
Try this:
add_filter('wp_title', 'photopress_pagetitle');
function photopress_pagetitle($photopress_pagetitle) {
return $photopress_pagetitle.' » Photopress';
}