开发者

How to remove sidebar from certain pages and adjust post width div?

I'm trying to remove the sidebar from certain pages and once it is removed the width of the post div readj开发者_C百科usts. How to do this?


For pages you can create different template and use it with a specific pages. For posts you can use a custom field to mark pages that requires no sidebar, then read this custom field in your single.php and make corresponding layout adjustments. Hope you know how to do it.


You can use the simple PHP script in page.php to remove the sidebar from specific page.. Here is the PHP script-

<?php if (is_page('your_page_name')) { ?>
<? } else { ?>
<?php get_sidebar(); ?>
<? } ?>

Here is the complete tutorial on removing the wordpress sidebar from specific page http://masterblogster.com/how-to-hide-sidebar-on-particular-page-in-wordpress/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜