• ◇【テーマのカスタマイズ】Max Magazineの文字化けを直す方法

    Posted on by pasoko in wordpressカスタマイズ.

    wordpress Max Magazine カスタマイズ

    修正前

    <?php 
    	// display only first 26 characters in the title.	
    	$short_title = substr(the_title('','',FALSE),0,26);
    	echo $short_title; 
    	if (strlen($short_title) >25){ 
    		echo '...'; 
    	} 
    ?>
    

    修正後

    <?php 
    	// display only first 26 characters in the title.	
    	$short_title = mb_substr(the_title('','',FALSE),0,26,'UTF-8');
    	echo $short_title; 
    	if (strlen($short_title) >25){ 
    		echo '...'; 
    	} 
    ?>
    

    Post Tagged with
Comments are closed.