Tag Archives: Templates

Get Lesson Object for a Topic in LearnDash

While customizing LearnDash I came across an issue in the topic.php file where the $lesson_post variable was returning null even when there was a parent lesson for the topic.

So, after digging around at the LearnDash source code a bit I came up with this simple solution to grab the lesson whenever I needed using the topic post which is accessible via $post.

Not sure if others will find this helpful, but there are not a ton of extensive docs or articles on developing for LearnDash so wanted to share 🙂

How to Embed a Shortcode from a Plugin Directly into a Template File

I recently came across a great shortcode that I wanted to embed directly into a template, rather than use as a shortcode from within the admin area.

If you ever need to do this you can use the do_shortcode function, and pass any necessary parameters as you would need.

<?php echo do_shortcode('[shortcode with="parameters"]'); ?>

I’m Curious to See How Swift Templates Work in the Real World with Clients

Swift template example

Swift templates is a way to use a simple templating language to create custom templates from within the admin area, and even the Publish page.  I suppose for the right client and use case it would be helpful, but for the type of work I do creating simple sites for clients, it doesn’t really apply.

That said, I’m curious to see how it evolves and if anyone has experience using it.  You can read more about the feature here or check out the WordPress Creation Kit, which it is a part of.

Link

If you’re building an admin settings page for a plugin, you should check out this plugin to get easy, copy and paste code to create all the WordPress default layouts and markup.

Thanks Frank for making it so easy!