[Twenty Eleven] Override single page template for custom post types
-
Hi,
Hoping somebody can help me. I’m currently trying to set up a Twenty Eleven child theme, and have added the sidebar to single pages. However I’m also posting photo galleries using Custom Post Types, and want those pages to take up the full width of the page (yes, like the one on Ma.tt!).
I can get the category page to not display the sidebar, I can get the individual image pages to not display the sidebar – but I cannot, cannot, CANNOT get the main gallery post pages to not display the sidebar. Unless I remove the ‘get_sidebar’ call from the single post template, at which point it disappears from the gallery post too. I do want to keep the sidebar on single posts if I can – just not gallery and image posts.
I’ve tried setting up CSS code to hide the sidebar on these pages. I’ve tried removing the get_sidebar call from everywhere I can get away with. I’ve tried conditional calls, which I think might be the solution but I can’t find the right one to stick. I’ve even tried creating a single-gallery.php template with the sidebar call removed, in the hope WP will call that before the single.php template on those pages – but I just cannot get the sidebar to budge! What am I doing wrong?!
Further to this, I’d also appreciate some advice on how to move the content in these pages back over to the centre, as even those not showing the sidebar are rigidly clinging to the left. I suspect the two issues may be connected (ie. I think the sidebar may only be ‘hidden’ on these pages, not removed completely).
Once again, any help anyone can offer me would be very much appreciated. ??
- The topic ‘[Twenty Eleven] Override single page template for custom post types’ is closed to new replies.