Forums

[resolved] Custom page-title for pages created by plugins like photopress (7 posts)

  1. tcb
    Member
    Posted 6 years ago #

    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

  2. niziol
    Member
    Posted 6 years ago #

    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?

  3. tcb
    Member
    Posted 6 years ago #

    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.

  4. tcb
    Member
    Posted 6 years ago #

    i had some problems with the scope of variables, now i use getter&setter functions to store the info, well.

  5. niziol
    Member
    Posted 6 years ago #

    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.

  6. tcb
    Member
    Posted 6 years ago #

    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()

  7. Lester Chan
    Member
    Posted 6 years ago #

    Try this:
    add_filter('wp_title', 'photopress_pagetitle');
    function photopress_pagetitle($photopress_pagetitle) {
    return $photopress_pagetitle.' &raquo; Photopress';
    }

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags