WordPress.org

Ready to get started?Download WordPress

Forums

Display Chinese on a static page (3 posts)

  1. AkaMaDdiSk
    Member
    Posted 5 years ago #

    I have a site that posts in Chinese, on the actual blog, the Chinese posts comes up correctly, but when I use the look in a static page, the Chinese comes up as gibberish.

    # 哄動一時的藝人裸照事件
    哄動一時的藝人裸照事件

    I basically have the installation in one folder and then in a separate directory I have a file that displays the latest two posts from the WP installation.

    Here's my code below. Basically the <?php the_title(); ?> shows up as gibberish on this separate page, but the same Chinese title shows up fine on the actual Blog. Does anyone have any clues?

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
      <meta http-equiv="content-type" content="text/html; charset=windows-1250">
      <meta name="generator" content="PSPad editor, www.pspad.com">
      <?php
    // Include WordPress
    define('WP_USE_THEMES', false);
    require('/home/mydmmain/public_html/cn/wp-blog-header.php');
    query_posts('showposts=2');
    ?>
    
      <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    
      <title></title>
      </head>
      <body style="margin:0; background-color: #000000;">
    <div id="container">
    <div id="latestposts">
    <?php if (have_posts()) : ?>
    <ul>
    <?php $count = 0; ?>
      <?php while (have_posts()) : the_post(); ?>
        <?php $count++; ?>
          <?php if ($count <= 3) : ?>
    <li>
      <a href="<?php the_permalink() ?>" rel="bookmark" title="Link to <?php the_title(); ?>" target="_parent">
    
      <div id="latestTitles"><?php the_title(); ?></div></a>
    
    </li>
          <?php else : ?>
          <?php endif; ?>
      <?php endwhile; ?>
      <?php else : ?>
    <?php endif; ?>
    </ul>
    </div>
    
      </body>
    </html>
  2. iridiax
    Member
    Posted 5 years ago #

    Try using the same charset in this page as in your WordPress blog. You have charset=windows-1250" in the above code.

  3. AkaMaDdiSk
    Member
    Posted 5 years ago #

    Thanks! I just tried that right before you posted, and it worked! Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic