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/
加载中,请稍侯......
精彩评论