Removing Sidebar on pages-conditional comments
-
Hi,
Taking my first steps with WP and having great fun with it.
I’m kinda stuck on one issue regarding the use of conditional comments to remove the sidebar.
I have a 4 page site: Home – Portfolio – About – Blog
I’d like to just have the sidebar showing on the Blog page. I did a search and found this advice:
linkbut I’m stuck on how to implement it into my sidebar.php file.
Please let me know if any more info is needed.
Appreciate your help.
Rob
-
Not sure if it would help, but here is my sidebar.php file in full:
[code moderated according to Forum Rules - please use the pastebin]
if your theme has the template file page.php, and you don’t want a sidebar on any static page, it might be the easiest to remove the
get_sidebar();code from page.php.the next challenge is then to stretch the content over the available space; by editing style.css.
details depend on the theme you are using.
link to your site?
Hi alchymyth,
Afraid I’m only working on it locally at the moment, but here is a link to the theme I am using: Live demo of theme
Thanks
@ Mods: Sorry about the code overload.
i have trouble downloading the theme 🙁
does it have a page.php template?
if so, have you tried my suggestion?
(keep a clean copy of the theme as a backup in case you need to reverse some changes)
Hi alchymyth,
Sorry for the delay, yes just removed get_sidebar(); from page.php and it works 🙂
As you say, there is now a slight problem with the sidebar looking a little out of synch, but that should be easily fixed in the CSS.
I will have a crack at that now. 🙂
All sorted 🙂
Thanks for your help alchymyth and an interesting site you have.
Cheers
thanks 😉
– if all is working, please mark this topic as ‘resolved’
The topic ‘Removing Sidebar on pages-conditional comments’ is closed to new replies.