Browsing Tag wp

Comments
Say no to sidebars! (customize your Wordpress pages)

custom drinkTypically, 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:

<?php get_sidebar();; ?>

to:

<?php if(!is_page('Forum')) get_sidebar();; ?>

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:

<?php if(!is_page('Forum')) { ?>
<div id="contentleft">
<?php } else { ?>
<div id="widecolumn">
<?php } ?>

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!

Permalinks on WordPress

Comments

Before today, I had a vague understanding of what a permalink was. I thought it was some sort of hyperlink that was… well, permanent.

Now I know more about permalinks, and how it’s important in WordPress. A permalink is simply a URL for a WordPress entry/page. The default URL, or permalink, in WordPress look something like this: http://www.billselak.com/?p=153. Pretty ugly. Here is how to fix that in WordPress:

  1. Go to Settings > Permalinks.
  2. Change the radio button from Default to Numeric.
  3. Save Changes.

So now, your URLs that once looked like:

http://www.billselak.com/educ525/?p=153

now look like:

http://www.billselak.com/educ525/weekly/week2

Now, when you write a new blog post or create a new page, there is a little box that lets you type in the URL you want.

If you’ve recently installed WordPress, you are all set! If, however, you already typed in the nasty default URLs, you’ll want to go back and update them. WordPress will automatically forward the old links, but it’s in bad form to leave it that way.

About

Hi. I'm Bill. This site discusses how technology is shaping the face of education these days. You’ll find insights, links, ideas, and the occasional joke. Subscribe to keep updated with educational technology news.

Archives

Other Links