2014-10-29 4 views
0

그래서 나는이 코드 조각이 wp_customizer $ :T.Variable 오류 (워드 프레스 테마 사용자 정의)

<?php 
    function mytheme_register_theme_customizer($wp_customizer){_ 

    $wp_customizer->add_section(
     'display_option' , 
     array(
      'title'  => 'Display Options', 
      'priority' => 200 

      ) 
    ); 

    $wp_customizer->add_setting(
      'index_background_image' , 
      array(
        'default' => '' , 
        'transport' => 'postMessage' 
       ) 

     ); 

    $wp_customizer->add_control(
     new WP_Customize_Image_Control(
      $wp_customizer, 
      'index_background_image', 
      array(

        'label'  => 'Background Image', 
        'section' => 'display_options', 
        'settings' => 'background_image' 
       ) 
      ) 
     ); 
} 
add_action('customize_register', 'mytheme_register_theme_customizer'); 

?> 

을 그리고 내 브라우저에서 로컬 호스트에서 결과로 얻을 모든은 다음과 같습니다

"D에 구문 오류, 예기치 않은 '$ wp_customizer'(T_VARIABLE) : 구문 분석 오류 \ 바탕 화면 V2 \ XAMPP \ htdocs를 \ \ 테마 \ 줄에 \의 functions.php을 재고 WP-내용 50 "

어디 라인 (50)은 다음과 같습니다

$wp_customizer->add_section(

슬프게도 구문 오류가 표시되지 않습니다.

는 ** 내 모든 디렉토리는 mytheme으로 나열됩니다 *

답변

0

이 줄 끝에서 밑줄을 제거합니다.

function mytheme_register_theme_customizer($wp_customizer){_ 

는 그래서됩니다 :

function mytheme_register_theme_customizer($wp_customizer){ 
+1

맙소사. 보라색 이었기 때문에 나는 그것을 볼 수 없었다. 감사합니다, 좋은 하루 되세요! – Andrew

+0

당신은 환영합니다 :) – danmullen

관련 문제