ThemeShaper Forums » Thematic

[closed]

Change doctitle / title

(1 post)
  • Started 3 years ago by ahoereth
  • This topic is not resolved
  1. ahoereth
    Member

    I want to filter the thematic_doctitle function so that all titles are displayed like "Blogtitle | Pagetitle".

    
    function test_doctitle() {
    	$site_name = get_bloginfo('name');
        $separator = '$bull;';
    
        if ( is_single() ) {
    		$title = $site_name . $seperator . single_post_title('', FALSE);
        }
    	elseif ( is_home() || is_front_page() ) {
    		$title = $site_name . $seperator . get_bloginfo('description');
        }
        elseif ( is_page() ) {
    		$title = $site_name . $seperator . single_post_title('', FALSE);
        }
        elseif ( is_search() ) {
    		$search_results = __('Search Results for:', 'thematic');
    		$search_results .= ' ' . wp_specialchars(stripslashes(get_search_query()), true);
    		$title = $site_name . $seperator . $search_results;
        }
        elseif ( is_category() ) {
    		$category = __('Category Archives:', 'thematic');
    		$category .= ' ' . single_cat_title("", false);;
    		$title = $site_name . $seperator . $category;
        }
        elseif ( is_tag() ) {
    		$tag = __('Tag Archives:', 'thematic');
    		$tag .= ' ' . thematic_tag_query();
    		$title = $site_name . $seperator . $tag;
        }
        elseif ( is_404() ) {
    		$error = __('Not Found', 'thematic');
    		$title = $site_name . $seperator . $error;
        }
        else {
    		$title = $site_name . $seperator . get_bloginfo('description');
        }
    
    	$title = "\t" . "<title>" . $title . "</title>" . "\n\n";
    
        echo apply_filters( 'test_doctitle', $title );
    }
    add_filter('thematic_doctitle','test_doctitle');
    

    Whats wrong? :-/

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.