我遇到插件问题,脚本会读取第一个字符(A,B,C ..来自字母),但如果是Č(或不同的语言特殊字符),则表示“抱歉,没有找到帖子!” 这是一个屏幕: http://postimg.org/image/m8lfc04uj/ 请告知问题在哪里,谢谢
<?php query_posts('post_parent=83&post_type=page&post_status=publish&orderby=title&order=ASC'); ?>
<?php if ( have_posts() ) {
$in_this_row = 0;
while ( have_posts() ) {
the_post();
$first_letter = mb_strtoupper(substr(apply_filters('the_title',$post->post_title),0,1));
if ($first_letter != $curr_letter) {
if (++$post_count > 1) {
end_prev_letter();
}
start_new_letter($first_letter);
$curr_letter = $first_letter;
}
if (++$in_this_row > $posts_per_row) {
end_prev_row();
start_new_row();
++$in_this_row; // Account for this first post
} ?>
<div class="title-cell"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></div>
<?php }
end_prev_letter();
?>
<div class="navigation">
<div class="alignleft"><?php next_posts_link('« Higher Letters') ?></div>
<div class="alignright"><?php previous_posts_link('Lower Letters »') ?></div>
</div>
<?php } else {
echo "<h2>Sorry, no posts were found!</h2>";
}
?>
<?php
function end_prev_letter() {
end_prev_row();
echo "</div><!-- End of letter-group -->\n";
// echo "<div class='clear'></div>\n";
}
function start_new_letter($letter) {
echo "<div class='letter-group'>\n";
echo "\t<div class='letter-cell'>$letter</div>\n";
start_new_row($letter);
}
function end_prev_row() {
echo "\t</div><!-- End row-cells -->\n";
}
function start_new_row() {
global $in_this_row;
$in_this_row = 0;
echo "\t<div class='row-cells'>\n";
}
?>
答案 0 :(得分:0)
尝试替换该行:
-std
..用:
$first_letter = mb_strtoupper(substr(apply_filters('the_title',$post->post_title),0,1));
这应该适用于非拉丁字符。