Make A Simple WordPress LMS in 10 Minutes

Keeping a blog for the purposes of journaling, reflecting, and sharing teaching ideas is great for us as teachers, but what about for our students? How do we share resources, provide essential course information, give and collect assignments, an so on? Of course, there are lots of different ways to do this, including creating a separate blog for each course, but I’ve found a relatively easy way to take one’s current (self-hosted) blog and set it up so that it can easily be made into a simple LMS (learning management system). By simple LMS, I mean a website where each course has its own main content and sidebar content separate from the main blog. All of this is based on categories and a few plugins, and is quite simple to set up.

My blog/LMS runs on the same ideas I’m giving below, but I’ve done a bit more hacking at the code. I’m providing a pretty simple method for creating separate course pages that should only take about 10 minutes to set-up. Here are the things you are going to need:


Step 1: Creating the course pages

Go to Posts>Categories and create a category called “courses,” “classes,” or whatever umbrella term you wish. This will be the parent category for all your courses. Then, create another category for each specific course, e.g. “Advanced English Conversation”. Give it a nice simple slug (web-friendly name) like “2014aec”. Then, select the umbrella category you created as the parent. Press “Add New Category”. The path to your new course will be something like, though this depends on your permalinks structure.

Adding a category.

Adding a new course page (category) and setting its parent.

Now, make a simple test post with some filler content and add only this category to the post. You can delete this post later.

Step 2: Make a sidebar

Create a new page and call it “sidebar”. Publish the page without any content. This first step is simply for organization purposes. It is much more convenient to keep all your course sidebars under a single parent page than to have them scattered about. Now, make another page and give it the title “sidebar-2014aec”. You can replace “2014aec” with whatever course name you chose in Step 1. Give this page some filler content (different from the above filler content so you can differentiate them), select the “sidebar” page as parent, and click publish.

Step 3: Show your new sidebar on your new category

After you have installed the above plug-ins, go to Appearance>Widgets. Select the “PHP Code” widget and drag it to the top of your sidebar. Give it a title and paste the following code into the main box:


$category = get_the_category($post->ID);
$incname = $category[0]->category_nicename;
$findpage = get_page_by_title( 'sidebar-'.$incname);
$pid = $findpage->ID;
$sidebar = get_post($pid);
$contents = apply_filters('the_content', $sidebar->post_content);
echo $contents;

What this code does is look at the current category (or the current post’s category), gets the category’s slug (web-friendly name), and then looks for a page called “sidebar-slug,” where slug is your category’s name, in this case “2014aec”. It then takes that page and displays only the content your wrote. Pretty neat, huh? A caveat: you should not crosspost to multiple categories or this may not display the current sidebar.

Now, at the bottom of the widget, you’ll notice a box called “Widget Logic”. This is where you will specify when your new sidebar will appear. For example, for the “Advanced English Composition” category, the following code is necessary:

is_category('2014aec') || is_single() && in_category('2014aec')

This tells your website to show your new sidebar if it is displaying category “2014aec”, or if it is showing a single post in category “2014aec”. It should look something like this:

PHP Code Widget

Adding the code to the PHP Code widget

This uses conditional formatting and with it, there are all sorts of different things you can do. For example, you could also limit all your other sidebar content so that it only shows on non-course pages. Select a normal sidebar widget (e.g. the “Links” widget) and in Widget Logic, type:

!is_category('2014aec') || is_single() && !in_category('2014aec')

There are many other things you can do. I suggest checking out both Widget Logic’s guide and the WordPress Codex. For our basic purposes, you only need the first code above.

Step 4: Test it out

Go to your new course page. Go to Posts>Categories and look for your new category. Hover over the name and select “view”. You should be taken to your category page which shows the filler post as well as the new sidebar. If it doesn’t work, re-check your steps and make sure you did everything correctly. If it does work, go to step 5.

Step 5: Add real content, make more courses, rinse, wash, repeat

Now that it works, you can add real posts and real sidebar content. You can also create more categories, following the same steps as abobe.

(Optional) Step 6: Hide your course from the main content

If you want to make sure that there is a clear separation between your course site and your main blog, you can use “Ultimate Category Excluder”. Go to Settings>Category Exclusion and select your category and where you want to hide it from.

(Optional) Step 7: Tagging course posts

If you want to tag your posts but keep them separate from your main blog, consider using custom taxonomies instead of the default tags. You can create these for all courses, or each individual course. For example, you could tag things as “grammar” or “organization” using the taxonomy “AEC Tags” rather than “Tags”. This is an advanced step, but there is a plug-in that can make it quite simple: “WCK Custom Fields and Custom Post Types Creator“. You can then list these new tags using the “PHP Code” box that contains your sidebar code. Under the sidebar code, add:

<?php wp_tag_cloud('taxonomy=topic&smallest=12&largest=12&format=flat&separator=<br/>&orderby=name'); ?>

This code adds a tag cloud that looks like a simple list (without bullet points). The only thing you need to change is topic. Change it to whatever slug you chose for the taxonomy you created.


There you have it. Setting up your first course site only takes about 10 minutes! Explore the plugins section for even more useful ways to transform your site into a useful LMS. Don’t forget to add your new course to your navigation menu!

Did it work? Did you have any problems? Let me know in the comments below. I’ll try to help out if I can.

You might also like this post: “How I Use WordPress as an LMS“.

2 thoughts on “Make A Simple WordPress LMS in 10 Minutes

  1. Aaron says:

    Congrats on this great article which is of a great help for anyone trying to sell online courses. Myself I want to build an e-learning website. But my biggest problem is how I can create the video for courses? I mean what hardwares and softwares do I need to create the courses. Thus it would very helpful if you could share some thoughts in this respect.
    Many thanks

    • Anthony Teacher says:

      Hi. Thanks for the comment. I would recommend using a webcam or smartphone to record lectures, or Screencast-O-Matic to record screen casts, and edit them in Windows Movie Maker. If you search for “make flipped learning videos”, “make a screencast”, “create video course content” or something like that, you’ll find better advice than what I can give.

Leave a Reply