SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2004
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Modifying WordPress Page Title

    I'm writing a plugin for WP and I'm trying to modify the Page title (ie. the_title()) like this:

    PHP Code:
    add_filter('the_title', array(&$this'format_title') );

    function 
    format_title($title)
    {
        if (
    in_the_loop())
            
    $title '<span style="color: lime">'.$title.'</span>';
        return  
    $title;

    I've checked the page.php template and it is making a call to the_title() in the template.

    If I don't add the in_the_loop() conditional, the page names in the sidebar turn green.

    But no matter what I try, I can't seem to modify the Page title which appears in the Loop within the page.php template file.

    How can I do this?

    Thanks

  2. #2
    SitePoint Enthusiast
    Join Date
    Dec 2004
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nevermind. I had my add_filter() call in the wrong place.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •