• <?php
    add_action( ‘init’, ‘create_post_type’ );
    function create_post_type() {
    register_post_type( ‘tabako’,
    array(
    ‘labels’ => array(
    ‘name’ => __( ‘入札情報’ ),
    ‘singular_name’ => __( ‘入札情報’ )
    ),
    ‘public’ => true,
    ‘has_archive’ => true,
    ‘menu_position’ => 100,
    )
    );
    }
    ?>

    日本語部分がメニューとして文字化けしてしまう。
    原因はなんでしょうか。

3件の返信を表示中 - 1 - 3件目 (全3件中)
  • モデレーター gatespace

    (@gatespace)

    __() は翻訳に使う関数です。
    日本語そのままで使うのなら、
    'name' => '入札情報' ,
    で良いんじゃないですかね?

    モデレーター jim912

    (@jim912)

    ファイルの文字コードを確認してください。

    トピック投稿者 monnsukyasanda

    (@monnsukyasanda)

    ご回答ありがとうございます。
    add_action( ‘init’, ‘create_post_type’ );
    function create_post_type() {
    register_post_type( ‘tabako’,
    array(
    ‘labels’ => array(
    ‘name’ => ‘入札情報’ ,
    ‘singular_name’ => ‘入札情報’
    ),
    ‘public’ => true,
    ‘has_archive’ => true,
    ‘menu_position’ => 100,
    )
    );
    }
    文字化けしてしまいます。

    文字コードはUTF-8

3件の返信を表示中 - 1 - 3件目 (全3件中)
  • トピック「文字化け。。。」には新たに返信することはできません。