2017-12-26 2 views

답변

0

다음 단계에 따라

1) 마스크를 입력 축소 된 here 플러그인을 다운로드를;

2) 테마 자바 스크립트 폴더 (예 : Twenty Seventeen)를 열고 축소 된 파일을 wp-content/themes/twentyseventeen/assets/js에 넣습니다. 문의 양식 7 (클래스의 입력을 작성)

//Enqueue Masked Input 
add_action('wp_enqueue_scripts', 'stackoverflow_enqueue_masked_input'); 

function stackoverflow_enqueue_masked_input(){ 

    if(is_page('contact')) //only the contact page will load the script 
     wp_enqueue_script('masked-input', 
     get_template_directory_uri().'/assets/js/jquery.maskedinput.min.js', array('jquery')); 
} 

add_action('wp_footer', 'stackoverflow_activate_masked_input'); 

//Activate Masked Input 
function stackoverflow_activate_masked_input(){ 

    if(is_page('contact')){ //again, only the contact page will load the script 
?> 
    <script type="text/javascript"> 
      jQuery(function($){ 
       $(".phone").mask("999-9999-999"); // will use contact form .phone class 
      }); 
    </script> 
<?php 
} 
} 

5 :

3) functions.php 파일을 엽니 다 (테마의 루트 폴더에있는)과의 botton을에 코드를 붙여 넣습니다 : 전화는 가면 입력에 사용됩니다) :

<label> Tel 
    [tel telephone class:phone placeholder "###-####-###"] 
</label> 

6) 이름이 '연락처'인 페이지를 생성하고 양식을 입력하십시오.

그게 전부입니다. 이 해결책은 in this site이지만 브라질 포르투갈어로 작성되었습니다.

관련 문제