2016-04-30 6 views
1

には表示されません。すべては問題ありませんが、コンテンツを保存してもコンテンツは表示されません。wp_editorの内容は、私がwp_editorを挿入しようとするテーマオプション

function display_slogan_element() { 
    $editor_id = "home_slogan"; 
    $editor_class = "slogan"; 
    $textarea_name = "slogan"; 
    $content = get_post_meta($post->ID, 'slogan', true); 
    $settings = array('teeny'=> TRUE); 

    wp_editor($content, $editor_id, $settings = array()); 

} 

問題は何かわかりません。誰でも私を助けることができますか?

答えて

0

あなたはそれをチェックした後global $post;を定義していただけますか?例えば

function display_slogan_element() { 
    global $post; 
    $editor_id = "home_slogan"; 
    $editor_class = "slogan"; 
    $textarea_name = "slogan"; 
    $content = get_post_meta($post->ID, 'slogan', true); 
    $settings = array('teeny'=> TRUE); 

    wp_editor($content, $editor_id, $settings = array()); 

} 
+0

いや...まだ動作することはできません – Alan

関連する問題