Theme Support Forum

Support Forum for Free and Premium Themes. Premium Theme Forums are Private! Please log in first to see the Premium forums

Viewing 3 posts - 1 through 3 (of 3 total)

Site title problem

Home Forums Free Theme Support Zenon Lite Site title problem

  • #119933

    Jesse

    Hello,

    I really love the theme, it’s the best one I’ve found so far. I just have two small problems, it shows the site title twice, so for example if my site title is ZenoLite it shows ZenoLiteZenoLite. Also, on blog posts is shows it in this format ZenoLiteBlogposttitel, I need there to be a space between the site title and the blog post title, but I cannot figure out how to do it. I hope someone can help me fix this problem.

    #120198

    Towfiq I.

    administrator

    1. Open up functions.php and add this:

    //Zenon Site title
    function zenon_wp_title( $title, $sep ) {
    	global $paged, $page;
    
    	if ( is_feed() )
    		return $title;
    
    	// Add the site name.
    	$title .= get_bloginfo( 'name' );
    
    	// Add the site description for the home/front page.
    	$site_description = get_bloginfo( 'description', 'display' );
    	if ( $site_description && ( is_home() || is_front_page() ) )
    		$title = "$title $sep $site_description";
    
    	// Add a page number if necessary.
    	if ( $paged >= 2 || $page >= 2 )
    		$title = "$title $sep " . sprintf( __( 'Page %s', 'zenon' ), max( $paged, $page ) );
    
    	return $title;
    }
    add_filter( 'wp_title', 'zenon_wp_title', 10, 2 );

    before this line:

    //Include CSS

    then Open up header.php and replace this:

    <title><?php bloginfo('name'); ?><?php wp_title(); ?></title>

    with this:

    <title><?php wp_title( '|', true, 'right' ); ?></title>

    #120218

    Jesse

    Thank you so much, that fixed it. I would’ve never figured that out by myself!

You must be logged in to reply to this topic.