Bill Selak
All That is EduAwesome
  • Podcast
    • Subscribe on Apple Podcasts
    • Subscribe on Google Play
    • Subscribe on Stitcher
    • Subscribe on Deezer
  • Blog
    • How-to
    • Editorial
    • Presentations
    • Ed Tech
    • Music
  • Rising Decline Project
    • The Rising Decline Project on Bill Selak Talks: Part 1 of 30
    • The Rising Decline Project on Bill Selak Talks: Part 2 of 30
    • The Rising Decline Project on Bill Selak Talks: Part 29 of 30
    • The Rising Decline Project on Bill Selak Talks: Part 30 of 30
  • Photography
    • Project 52
    • Photo-a-Day Year 4
    • Hollywood Photowalk 2012
    • selakphotography.com
    • Photo-a-Day older blog, with 1095 daily photos
  • Hi, I’m Bill Selak
    • Bio
    • Presentations
    • Consulting
November 11, 2009
conditional formatting, customize, php, sidebar, WordPress, wp
Like 0 Thanks! You've already liked this
525, Blog, Ed Tech, How-to, html, Web Design, WordPress

Say no to sidebars! (customize your WordPress pages)

custom drink

Typically, I blog about educational technology that the average teacher can understand. This, however, is some heavy lifting.

Here is an advanced trick for WordPress users. This is how I removed the sidebar from one specific page (titled forum) on my wordpress site. After much searching, I found that I needed to implement conditional formatting using php.

Here’s my problem:
I wanted one single wordpress page to not have a sidebar. I wanted it to take up the entire width of the page. Makes sense for a forum, right? Not so easy…

Solution:
In the wordpress dashboard, navigate to Appearance > Editor > page.php.
On page.php, I changed:

[sourcecode language=”plain” light=”true”]<?php get_sidebar();; ?>[/sourcecode]

to:

[sourcecode language=”plain” light=”true”]<?php if(!is_page(‘Forum’)) get_sidebar();; ?>[/sourcecode]

Here’s what that means:
Typically, wp displays the sidebar. That’s what we usually want. In this case, the exclamation point means “if it is not”. So, the php translation is, “If it’s not the Forum page, then show the sidebar.”

Perfect, so far. However, there was a blank space where the sidebar used to be. Another problem. The forum should be wider. This won’t happen, though, because my stylesheet says the page can only be 510 pixels wide.

So, I went to my stylesheet and created a div titled #widecolumn with a width of 100%.

Back on page.php, I changed the original div titled #contentleft to:

[sourcecode language=”plain”]<?php if(!is_page(‘Forum’)) { ?>
<div id="contentleft">
<?php } else { ?>
<div id="widecolumn">
<?php } ?>[/sourcecode]

Again, with the php translation: “If it’s not the Forum page, use the div #contentleft (with a width of 510 px). If it is the Forum page, use the #widecolumn div that you just made (with a width of 100%).

Yay!

The Essential Approach to Masking in Photoshop Google Wave
screen3
ai, Apple, Blog, Coding, Creative Rigor, Ed Tech, EdFailFwd, Featured

How AI Helped Me Build My First Indie App — and Why Creativity Still Matters

billselak-nickprovenzano
ai, Blog, Ed Tech, Education Leadership, Featured, interview, Podcast

Supercharging Creativity: AI in Education, and Empowering Learners

Ed Tech

Rising Decline Revisited: November Tragedies [Part 18 of 18]

Featured

  • IMG_5097Navigating New Realms: AI’s Role in Shaping Educator Identities
  • IMG_4958The Educator’s Guide to AI-Powered App Development
  • IMG_4828Punk Rock and Pedagogy: Lessons in Authenticity from Blink 182

Subscribe to Podcast

Apple PodcastsAndroidby EmailRSS

Recent Posts

  • How AI Helped Me Build My First Indie App — and Why Creativity Still Matters
  • Supercharging Creativity: AI in Education, and Empowering Learners

Search

  • Featured Posts
  • Presentations
© Bill Selak 2026
Powered by WordPress • Themify WordPress Themes