サポート » 使い方全般 » カスタム投稿の記述を追記するとエラーが出てしまいます。

  • カスタム投稿を設置すべく奮闘しているのですが、functions.phpにコードを追加したとたんエラーが表示されてしまいます。

    【エラー内容】
    Warning: Cannot modify header information – headers already sent by (output started at /home/*****/www/*****/wp-content/themes/test/functions.php:1) in /home/*****/www/test/wp-includes/pluggable.php on line 876

    functions.phpに書いているカスタム投稿用のコードを削除するとエラーが消える為、コードに原因がありそうなのですが、何がいけないのか見つけることができず、1日半悩み続けております。どなたか助けていただけないようでしょうか。

    ——————————

    <?php
    if ( function_exists(‘register_sidebar’) )
    register_sidebar();

    register_nav_menus(array(
    ‘navbar’ => ‘ナビゲーションバー’,
    ‘footer-menu’ => ‘フッターメニュー’
    )
    );

    add_action( ‘init’, ‘create_post_type’ );
    function create_post_type() {
    register_post_type( ‘blog’,
    array(
    ‘labels’ => array(
    ‘name’ => __( ‘店長のブログ’ ),
    ‘singular_name’ => __( ‘店長のブログ’ )
    ),
    ‘public’ => true,
    ‘has_archive’ => true,
    ‘menu_position’ =>5,
    )
    );
    }

    ?>

    ——————————

2件の返信を表示中 - 1 - 2件目 (全2件中)
2件の返信を表示中 - 1 - 2件目 (全2件中)
  • トピック「カスタム投稿の記述を追記するとエラーが出てしまいます。」には新たに返信することはできません。