2017-03-04 1 views
0

당 나는워드 프레스 단축 코드 페이지

function wiki_show($atts ) { 

    // Attributes 
    $atts = shortcode_atts(
     array(
      'name' => '', 
      'height' => '500', 
     ), 
     $atts, 
     'wiki' 
    ); 

    // Return custom embed code 
    return '<div><iframe src="https://en.wikipedia.org/wiki/' . '&name=' . $atts['name'] . '" height="' . $atts['height'] . '"/></div> '; 

} 
add_shortcode('wiki', 'wiki_show'); 

내가 그래서 같은 워드 프레스 페이지 내에서 사용할 다음 워드 프레스 단축 코드가 한 번만 실행 :

AAAAAAAA 

[wiki name="Wolfenstein_3D" height="500"] 

BBBBBBB 

[wiki name="Nelson_Mandela" height="800"] 

CCCCCCCC 

문제가를 그 첫 번째 후 iframe, 콘텐츠가 표시되지 않음 (첫 번째 iframe 이후의 BBBB ....가 아님)

"iframe"대신 "foo"태그에 단축 코드를 변경하면 모든 코드가 표시됩니다 바르게.

2 개의 iframe을 수동으로 (짧은 코드없이) 포함하면 정상적으로 작동합니다.

단축 코드는 어떻게 작성합니까? 내가 도대체 ​​뭘 잘못하고있는 겁니까?

답변

관련 문제