首页    >    新闻资讯    >   怎样不修改模板文件而移除WordPress主页上的Widget?

怎样不修改模板文件而移除WordPress主页上的Widget?

如果不想让主页显示Widget,又不想改动模板文件,怎么办?很简单,把下面的代码添加到functions.php文件中:

<?php
add_filter( 'sidebars_widgets', 'disable_all_widgets' );
function disable_all_widgets( $sidebars_widgets ) {
    if ( is_home() )
        $sidebars_widgets = array( false );
    return $sidebars_widgets;
}
?>

大功告成!

原文:How to: Remove widget areas on your blog homepage without editing template files

分类:新闻资讯

标签:, ,

* 版权声明:作者WordPress啦! 转载请注明出处。

kadıköy escortbostancı escortataşehir escortbostancı escortmaltepe escortmaltepe escortanadolu yakası escortanadolu yakası escortataşehir escortbostancı escortistanbul escortkartal escortbostancı escortkartal escortkadıköy escortpendik escortpendik escortmaltepe escortataşehir escortmaltepe escortmaltepe escortanadolu yakası escortkadıköy escortataşehir escortkadıköy escortataşehir escortümraniye escortataşehir escortkartal escortescort bayankartal escortpendik escortkartal escortgöztepe escorttuzla escortkadıköy escortkartal escortkadıköy escortmaltepe escortkartal escortataşehir escortmaltepe escortbostancı escortkartal escortpendik escortkadıköy escortataköy escortavrupa yakası escortataköy escortbakırköy escortbeylikdüzü escorttaksim escorthalkalı escortetiler escortbodrum escortmalatya escortankara escortantalya escortmersin escortantalya escortHacklinkHacklinkshellwso shellwso shellgörüntülü sohbettipobetbahis siteleri