开发者

Static html on a single page in wordpress

I would like to add some basic html page to my homepage that I setup as a static page in wordpress. Well it is a little more complex I would also like to add a jquery plugin only for that page as well. How would I go about doing this, some sort of IF statement I suppose. IF home page add this code IF NOT do not add code.

I know I need to use this is_home()

I have tried to do this but nothing outputs, and I am on the homepage so I am not sure what to do. UPDATE: Turns out it was not the homepage so I am trying to fix that right now. Ok well I have the home page set to a static page called About and when I am on the home page the else statment runs, that seems 开发者_如何学运维backwards to me, what am I doing wrong.

<?php
if ( is_home() ) {
    echo "<h1>Hello</h1>";
} else {
    // This is not a homepage
    echo "<h1>Goodbye</h1>";
}
?>

Thanks!


So Simple all I had to do was change is_home to is_front_page

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜