WordPress CMS » Lecture 5: Plugins & Widgets

Update: November 9th, 2009

Assignment

  • Install at least 3 Plugins Write a blog post or page explaining which ones you chose and why.
  • Decorate your sidebar with Widgets

Lecture Notes

Plugins

Plugins allow you to extend the basic functionality of the WordPress framework. Plugins can range in functionality from such simple adjustments as adding a Twitter username field to the author's profile page to more advanced changes like administering Search Engine Optimization (SEO) for the whole site.

Like many other open source applications that support plugins/extentions (see Firefox, MediaWiki, Linux, etc), there are so many developers and users of the system that if you find you need something, chances are pretty good that someone has already made a plugin that you can install. If not, the WordPress Codex explains how to use the WordPress API to create your own plugins (PHP programming required).

WordPress.org has over 4,000 plugins hosted but there are gobs more if you search google for what you need (e.g. a Mortgage Calculator

Recommended WordPress Plugins

  • All in One SEO Pack
  • AntiVirus for WordPress
  • AskApache Password Protect
  • Block Bad Queries
  • Breadcrumb Titles for Pages
  • Broken Link Checker
  • Contact Form 7
  • Delete-Revision
  • Exec PHP
  • Feedburner FeedSmith
  • Google XML Sitemap Generator
  • Login LockDown
  • OpenID
  • PageMash
  • qTranslate
  • WordPress Database Table Optimizer
  • WP DB Backup
  • WP Security Scan
  • WP Super Cache
  • WP Syntax
  • WP Touch (iPhone Theme)
  • Widgets

    Widgetizing Your Theme

    sidebar.php

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    
    <ul id="sidebar">
    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
     <li id="about">
      <h2>About</h2>
      <p>This is my blog.</p>
     </li>
     <li id="links">
      <h2>Links</h2>
      <ul>
       <li><a href="http://example.com">Example</a></li>
      </ul>
     </li>
    <?php endif; ?>
    </ul>

    functions.php

    basic:

    1
    2
    
    if ( function_exists('register_sidebar') )
        register_sidebar();

    customized:

    1
    2
    3
    4
    5
    6
    7
    8
    
    if ( function_exists('register_sidebar') ) {
    	register_sidebar(array(
    		'before_widget' => '<li id="%1$s" class="widget %2$s">',
    		'after_widget' => '</li>',
    		'before_title' => '<h2 class="widgettitle">',
    		'after_title' => '</h2>',
    	));
    }
    No comments yet.
    You must be logged in to post a comment.
    TOP