SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast fatihturan's Avatar
    Join Date
    Aug 2008
    Location
    Turkey
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wordpress functions.php problem

    Hello.

    I'm using a function for display page title in functions.php in here (i'm using Wordpress 2.7 Beta 1):
    Code PHP:
    <?php function emerald_title () {
    	if(get_option("blogname") != "") {
    		$title = get_option("blogname"); 
    	}
     
    	if(get_option("blogdescription") != "") {
    		$title .= " - " . get_option("blogdescription"); 
    	}
     
    	if (get_option("blogname") == "" && get_option("blogdescription") == "") {
    		$title = "You must enter your blog name and description in WP-Admin panel (Settings>General).";
    	}
     
    	if (is_home()) {
    		echo "<title>" . $title;
    		if (is_paged()) {
    			echo " | Sayfa: " . get_query_var('paged');
    		}
    		echo "</title>";
    	}
     
    	if (is_search()) {
    		echo "<title>" . the_search_query() . "Terimi Hakkında Arama Sonuçları — " . $title;
    		if (is_paged()) {
    			echo " | Sayfa: " . get_query_var('paged');
    		}
    		echo "</title>";
    	}
     
    	if (is_404()) {
    		echo "<title>Aradığınız Sayfa Bulunamadı — " . $title . "</title>"; 
    	}
     
    	if (is_single() || is_page()) {
    		echo "<title>" . wp_title("—", true, "right") . $title . "</title>";
    	}
     
    	if (is_category()) {
    		echo "<title>" . wp_title("Kategorisi Altındaki Yazılar —", true, "right") . $title;
    		if (is_paged()) {
    			echo " | Sayfa: " . get_query_var('paged');
    		}
    		echo "</title>";
    	}	
    } 
     
    if ( function_exists('register_sidebar') )
        register_sidebar(array('name'=>'left',
            'before_widget' => '<div id="%1$s" class="widget %2$s">',
            'after_widget' => '</div>',
            'before_title' => '<h2>',
            'after_title' => '</h2>',
        ));
        register_sidebar(array('name'=>'bottom',
            'before_widget' => '<div id="%1$s" class="widget %2$s">',
            'after_widget' => '</div>',
            'before_title' => '<h3>',
            'after_title' => '</h3>',
        ));
    ?>


    And of course i'm calling emerald_title(); function on header.php.

    But blog's title isn't displaying right (i added screenshot attachment). I think Wordpress's built-in functions isn't work right on functions.php. Or whatever.

    What i can do for solve this problem?
    Attached Images Attached Images
    Last edited by fatihturan; Nov 2, 2008 at 13:03.

  2. #2
    SitePoint Enthusiast fatihturan's Avatar
    Join Date
    Aug 2008
    Location
    Turkey
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I fixed this problem with not echoing wp_title output like this:
    PHP Code:
    wp_title("—", [B]false[/B], "right"
    Web & User Interface Designer — Co-Founder at Unicrow


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
  •