2013-04-29 69 views
1

嗨,我有一个自定义短码以上,但我真的不知道为什么我的简码出现在内容上面,这是我的代码:WordPress的简码显示内容

function paydown_func($atts) { 
    extract(shortcode_atts(array(
     'id' => '', 
     'dialog' => '', 
     'header' => '', 
     'pay' => '', 
    ), $atts)); 

    if ($header == ''){ 
     $header = 'OPTIONAL<br>DONATION'; 
    } 
    if ($dialog == ''){ 
     $dialog = 'Don\'t worry. This resource will always remain free. However I would appreciate if you share some support and help me to get some coffee. Thank you very much!!'; 
    } 
    if ($pay == '') { 
     $pay = 'Donate $2'; 
    } 

    $pay_content = ''; 
    $pay_content .= '<div class="alert-gray">'; 
    $pay_content .= '<div class="one-tf column-first"><span class="ptitle">'.$header.'</span><br>Via Paypal</div>'; 
    $pay_content .= '<div class="one-ti column-inner psmall">'.$dialog.'</div>'; 
    $pay_content .= '<div class="one-tl column-last">'; 
    $pay_content .= '<a href="http://creativestocks.com/?pfd_checkout='.$id.'" target="_blank" class="button blue small alignright"><span class="button-inner">'.$pay.'</span></a>'; 
    $pay_content .= '</div></div>'; 

    return $pay_content; 
} 
+0

这是发生在所有的主题?这听起来很像CSS问题,尽管它也可能与一些过滤器有关。需要更多信息。 – 2013-04-29 06:12:59

回答

0

如果你是做在echo do_shortcode()你的函数文件,它会在内容之前输出短代码的内容。通常,您在页面上方获取短代码内容的原因是因为在错误的地方存在回显。