ThemeShaper Forums » Thematic

[closed]

getting blog tagline to show up in browser window

(8 posts)
  • Started 2 years ago by drewdavid
  • Latest reply from helgatheviking
  • This topic is not resolved
  1. Hi,

    I'd like the blog tagline/description to be placed in the title before or after the blog title, as well as individual post/page titles.

    Right now I only get the blog title on the home page, and only the page/post title.

    Thanks! :)

    Drew

    Posted 2 years ago #
  2. Hi so I found some information on this page:

    http://themeshaper.com/thematic/guide/?page_id=12

    Under the heading 'thematic_doctitle()'

    However by using that code I got the following error.

    Parse error: syntax error, unexpected T_STRING in /home/content/x/r/o/xroox/html/24hrknight/wp-content/themes/tuxedo/functions.php on line 21

    Thanks. :)

    Posted 2 years ago #
  3. syntax error means exactly that... error in your syntax. likely missing a ) , ; ' } or something some where. i can also mean you have some punctuation where you shouldn't but since it says unexpected string, you are probs not closing something right

    Posted 2 years ago #
  4. Hi Helga,

    I can't seem to figure out where the offender is! Here is my functions.php code as shown on the theme filters page:

    function childtheme_doctitle() {
    
    // You don't want to change this one.
    $site_name = get_bloginfo('name');
     
    // But you like to have a different separator
    $separator = '»';
     
    // We will keep the original code
    if ( is_single() ) {
    $content = single_post_title('', FALSE);
    }
    elseif ( is_home() || is_front_page() ) {
    $content = get_bloginfo('description');
    }
    elseif ( is_page() ) {
    $content = single_post_title('', FALSE);
    }
    elseif ( is_search() ) {
    $content = __('Search Results for:', 'thematic');
    $content .= ' ' . wp_specialchars(stripslashes(get_search_query()), true);
    }
    elseif ( is_category() ) {
    $content = __('Category Archives:', 'thematic');
    $content .= ' ' . single_cat_title("", false);;
    }
    elseif ( is_tag() ) {
    $content = __('Tag Archives:', 'thematic');
    $content .= ' ' . thematic_tag_query();
    }
    elseif ( is_404() ) {
    $content = __('Not Found', 'thematic');
    }
    else {
    $content = get_bloginfo('description');
    }
    
    if (get_query_var('paged')) {
    $content .= ' ' .$separator. ' ';
    $content .= 'Page';
    $content .= ' ';
    $content .= get_query_var('paged');
    }
    
    // until we reach this point. You want to have the site_name everywhere?
    // Ok .. here it is.
    $my_elements = array(
    'site_name' => $site_name,
    'separator' => $separator,
    'content' => $content
    );
    
    // and now we're reversing the array as long as we're not on home or front_page
    if (!( is_home() || is_front_page() )) {
    $my_elements = array_reverse($my_elements);
    }
    
    // And don't forget to return your new creation
    return $my_elements;
    }
    
    // Add the filter to the original function
    add_filter('thematic_doctitle', 'childtheme_doctitle');
    Posted 2 years ago #
  5. well what is line 21 and just prior? though i see this double semi-colon right away

    $content .= ' ' . single_cat_title("", false);;
    Posted 2 years ago #
  6. Here are lines 19-22:

    function childtheme_doctitle() {
     
     // You don't want to change this one.
     $site_name = get_bloginfo('name');

    Thanks. :)

    Posted 2 years ago #
  7. I also found this post which has some different code at: http://forums.themeshaper.com/topic/change-doctitle?replies=4#post-24794

    For the most part it seems to work just fine, except my home page has no separator. The blog title and the tagline run straight together...

    Either solution would be great to get working... Thanks.

    Posted 2 years ago #
  8. tested locally this should add the site title to the beginning of the doctitle everywhere except for the home/front pages where it already is:

    function childtheme_doctitle($elements) {
    
    	$site_name = get_bloginfo('name');
    	$separator = apply_filters('thematic_doctitle_separator', '|');
    
    	// and now adding the site name if we're not on home or front_page
    	if (!( is_home() || is_front_page() )) {
    		array_unshift($elements, $site_name, $separator);
    	}
    
    	return $elements;
    }
    add_filter('thematic_doctitle', 'childtheme_doctitle');
    Posted 2 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.