Display Chinese on a static page (3 posts)

  1. AkaMaDdiSk
    Posted 6 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">
      <meta http-equiv="content-type" content="text/html; charset=windows-1250">
      <meta name="generator" content="PSPad editor, www.pspad.com">
    // Include WordPress
    define('WP_USE_THEMES', false);
      <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
      <body style="margin:0; background-color: #000000;">
    <div id="container">
    <div id="latestposts">
    <?php if (have_posts()) : ?>
    <?php $count = 0; ?>
      <?php while (have_posts()) : the_post(); ?>
        <?php $count++; ?>
          <?php if ($count <= 3) : ?>
      <a href="<?php the_permalink() ?>" rel="bookmark" title="Link to <?php the_title(); ?>" target="_parent">
      <div id="latestTitles"><?php the_title(); ?></div></a>
          <?php else : ?>
          <?php endif; ?>
      <?php endwhile; ?>
      <?php else : ?>
    <?php endif; ?>
  2. iridiax
    Posted 6 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
    Posted 6 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