Plugin

Simple Course Creator

Simple Course Creator

View it on WordPress.

Simple Course Creator is designed to easily link posts together in a series and output that series list in the content of each included post.

You can see this plugin live and in action on any of the articles from the How to Build a WordPress Theme course. Check out the first article.

How It Works

Once activated, a new taxonomy (think category and tag) is added to your Posts menu called “Courses.” Courses are created in the same way categories and tags are.

When creating a new course, it’s important to give the course a description as well as a course title, which is a new field added by this plugin.

new-course

Now with at least one course created, you have the ability to select which course a post belongs to from the edit post screen.

select-course

Once a course is selected and saved, a course listing will appear in the content of the post as long as it’s not the only post in a course.

The course listing will display as a container that shows nothing but the course title and the course description, which is what you filled out when creating a new course.

The series of posts will be hidden until you click a subtle link for displaying them, at which point the container will gracefully expand to reveal all posts in the course. They will all be linked except for the current post.

Here’s a basic implementation of a course container.

course-collapsed

Here’s an expanded view revealing all posts in a course, while linking other posts not currently being viewed.

course-expanded

Styles are kept to a minimum so theme styles are inherited as much as possible.

Simple Course Creator Settings

Simple Course Creator comes with a few very simple options.

Choose to display your course containers above post content, below post content, both above and below post content, or do not display it at all while still preserving the course configuration.

You may also choose your course list style type. They can be displayed as a numbered list, a bulleted list, or a list with no list indicator at all… simply stacked like paragraphs.

scc-settings

Expect more options in the future.

Theme Overrides

WordPress Hooks & Filters

The simplest way to edit your course output is with hooks and filters in your active theme’s functions file. SCC comes with built-in hooks littered throughout the output as well as a filter for the course toggle.

Here’s a list of all the hook names:

  • scc_before_container
  • scc_container_top
  • scc_below_title
  • scc_below_description
  • scc_before_toggle
  • scc_after_toggle
  • scc_above_list
  • scc_list_item
  • scc_below_list
  • scc_container_bottom
  • scc_after_container

To use any of these hooks, create your own custom function and use WordPress’ `add_action()` function to call your function with the specific hook location. Here’s an example.

function function_name() { ?>
    -- custom --
<?php }
add_action( 'scc_container_top', 'function_name' );

Pasting that PHP into your active theme’s functions file will output “– custom –” just inside every course container box.

To edit the “full course” toggle link, use the built-in filter `course_toggle` like so.

function function_name_filter( $content ) {
	$content = str_replace( 'full course', 'complete series', $content );
	return $content;
}
add_filter( 'course_toggle', 'function_name_filter' );

With a little CSS usage in your own theme stylesheet, the plugin settings, and the above actions, you can customize SCC however you’d like.

Or…

Active Theme File Overrides

You are more than welcome to override the basic default styles, behavior, or HTML template responsible for displaying the course container.

If you only want to edit a few CSS styles, you’re better off using your own theme’s stylesheet and simply writing stronger CSS.

If you would like to override the actual CSS file, JavaScript file, or HTML template for displaying the course container, you can easily do so by creating a folder in the root of your theme called “scc_templates” and copying any of the files you’d like from the plugin’s “includes/scc_templates” folder into your new theme folder.

Your theme files will now completely override the plugin files.

Be sure to copy these files and not simply create new, empty ones. Even if they’re empty, they’ll still override.

License

This plugin, like WordPress, is licensed under the GPL. GNU General Public License v2 or later: http://www.gnu.org/licenses/gpl-2.0.html

Developers

Feel free to fork the repo on Github and submit pull requests if you’d like to make contributions to the plugin.

View Simple Course Creator on Github