2012-05-24 4 views
0

나는 내 wordpress plugin의 shortcode를 만들었고 shortcode는 wordpress의 페이지 내용에 두 문장 사이에 위치했습니다. 하지만 두 문장은 pugin 부분의 하단에 표시됩니다. 문제가 될 수 있습니까? 내가으로 단축 코드를 배치wordpress shortcode formatting issue

,

내 플러그인

[PLUGIN]

새로운 워드 프레스 플러그인 ...

그러나 top.Then에 표시되는 플러그인의 HTML 콘텐츠 "My plugin"과 "New wordpress plugin ..."부분이 하단에 있습니다. "My plugin"과 shortcode 사이에 "br"태그를 사용했습니다. 그러나 "My plugin"은 항상 shortcode 부분에 표시됩니다. HTML 코드와 CSS. 도와주세요.

답변

1

짧은 코드에서 echo를 사용했다고 가정합니다.

결코 당신의

예 에코 "어쩌구 Blha"를 사용 :

나쁜 방법

function headbox() { 
if (is_home()) { 
    echo '<div id="headbox">'; 
    echo '<h1>Test</h1>'; 
    echo '</div>'; 
    } 
} 
add_action('thesis_hook_header', 'headbox'); 

올바른 방법을 반환

function headbox() { 
if (is_home()) { 
    $foo = '<div id="headbox">'; 
    $foo .= '<h1>Test</h1>'; 
    $foo .= '</div>'; 
     return $foo; 
    } 
} 
add_action('thesis_hook_header', 'headbox'); 
를 사용하여