|

New Plug-in: Latest Post Redirect

One thing I often forget to do is update social links when I’m promoting a new blog post or podcast episode. Especially on Instagram, I’ll say something like, “link in the profile,”1 only to forget to add the link to the profile! Services like Linktree help a little, but you still need to update. Well over a couple of days, I built a plugin to help me (and hopefully you) with this little problem.

Read More “New Plug-in: Latest Post Redirect”
| | |

Learning HTML and CSS (with My New Book, Out Now!)

I’ve always been a learn-by-doing kind of guy. Maybe it’s because I’m thinking about other things when something is explained to me, or maybe people are bad at explaining things. But either way, a concept doesn’t really sink in until I do it, or until I see an immediate application for it. When I learned HTML and CSS, I learned it by doing it. I’d make a page in Microsoft Front Page one then see what the generated source looked like.

Eventually, when I moved to using Notepad (or more accurately, Notepad++), I’d try something and see what happens, or copy someone else’s source and modify it. It wasn’t ideal, and today there are lots of great alternatives. I’m happy to add a new one to the fray: my new book, HTML and CSS: Visual QuickStart Guide.

Read More “Learning HTML and CSS (with My New Book, Out Now!)”
| |

How I Built It is Officially Hosted by Castos!

Castos is a fantastic WordPress-centric podcast hosting platform that I’ve been recommending in my courses and coaching calls. But I have a confession to make: since Castos launched after I launched my podcast, I’ve been using Libsyn.

For a long time, I’ve considered making the switch, but the migration process always seemed so daunting. On top of that, I’d need to make updates to my website and it never felt like the right time. Well that changes today!

Read More “How I Built It is Officially Hosted by Castos!”
|

Setting All Videos To Show Controls In LearnDash

One of the biggest pieces of feedback I’ve gotten on my course videos in recent weeks was that the controls on my videos were hidden. To be honest, I didn’t realize students couldn’t scrub through videos, or rewind – I assumed everything was working! After looking through the LearnDash settings and not finding a global option, I decided to the problem with just a little bit of code.

TL;DR: The Code

So I’ll cut to the quick and give you code first. Read on to learn about it! This is the setting you want: 

learndash_update_setting( get_the_ID(), 'lesson_video_show_controls', true ); 

The full code is in this public gist.

Updating the LearnDash Setting

A few months ago I dug through the LearnDash code for a similar plugin I wrote to convert ACF videos to native LearnDash videos. I figured there was a similar setting for video controls, and I was right. If you use the Chrome inspector, you can see the name of the control in the source.

So I grabbed the name of that form field and fed it into the function I discovered earlier:learndash_update_setting(), which accepts a post ID, the setting name, and the value.

Confirming it worked for a single setting, it’s time to write the loop that would update all settings.

The Loop

I won’t dig into the full mechanics of the loop, but I do want to point out the custom post types I needed to update: 

$lessons = new WP_Query(
    array(
        'post_type' => array( 'sfwd-lessons', 'sfwd-topic' ),
        'posts_per_page' => -1,
    )
);

I’m grabbing all posts that are lessons and topics within LearnDash. Then I loop through them all, updating the video controls settings.

This is slightly inelegant because I should really check to see if there is a video on the post before turning on controls, but it worked!

Hooking it in.

Now that we have a working function that will update all posts, we need to figure out where to hook it into WordPress. Honestly, there’s only one smart option for this, and it’s on plugin activation: 

register_activation_hook( __FILE__, 'jc_swap_videos' ); 

This will ensure the code only runs once, when the plugin is enabled.

If you are adding it to your functions.php file or something like that, you should do it at a point where it won’t disrupt end users, so I would choose an admin hook, like admin_init.

I would also make sure it executes once, then comment out the action so it doesn’t run every time you load the admin.

Future Proofing

Now, this only counts for existing posts and not future lessons and topics you might add. I’d recommend toggling the option as you add the rest, but if you really want to make sure you don’t forget, you could repurpose the code to set the option on post save. Something like this will work:

function jc_set_video_controls_on( $post_id ) {
      learndash_update_setting( $post_id, 'lesson_video_show_controls', true );
}
add_action( 'save_post', 'jc_set_video_controls_on' );

What Do You Think?

When you take online courses, do you prefer video controls on? I sure do! As a course creator, what reasons do you have for turning them off? Let me know in the comments!

| |

Creating a Responsive Gutenberg Price Table

Last week I worked on an upcoming tutorial for a popular online publication on how to style the Gutenberg Columns block (I’ll be sure to send that along when it comes out). As as result, I decided to experiment to see what you could reasonable do, and came up with this Gutenberg Price Table: https://codepen.io/jcasabona/pen/RYvEYd. In this tutorial, we’ll go over some of the things we need to do to make this happen.

Read More “Creating a Responsive Gutenberg Price Table”

Coding Projects as my Side Hustle

I did some thinking over the weekend, after I wrote the post about my learning plan. I looked at my project pipeline. I looked at what people were hiring me to do, and I reviewed the next few personal projects I’m working on. You know what I saw? No coding projects. Honestly, I shouldn’t. That’s no longer my core business. I turn down freelance jobs 90% of the time. But I still want to write code. I will have to for some of the online courses I’m taking. Luckily, there’s the whole idea of a “side hustle,” and since I made my side hustle my main gig last year, my side hustle has an opening.

Read More “Coding Projects as my Side Hustle”

| |

How I Launched Creator Courses in One Week

7 months ago I took my business full-time. Being a freelancer for most of my life, and even doing it full-time for a while after college, I thought I had a pretty good handle on how things would work. But as it turns out, the product space is a lot harder to work in than the services space (for me). I’ve lamented over the last few months that it’s easier for me to sell one person on a $5,000 project, than 100 people on a $50 course. But after attending CaboPress and participating in an amazing Master Mind group, I was able to get some perspective and readjust. The Autumn and Winter have been much better than the Summer.

But what does that have to do with a new site I launched called Creator Courses? Everything! I decided that as well as do an intro course on Gutenberg, I would launch a new brand. Here’s how I did it, and why.

Read More “How I Launched Creator Courses in One Week”

|

How I Built my WordPress Development Course on Udemy

My course has been out for 6 weeks and I’ve been promoting it on social media and in my newsletter; if you subscribe to any of those places you know it’s currently available. The cat’s out of the bag. But that doesn’t mean I don’t have more to tell about it. See, I originally set out to make this an announcement post. The fanfare, the glitz, and the glamore. But man, there’s been a lot on my plate and when that happens, my blog is always the first to suffer. That’s OK though! I’m back and I’ll be making lots of more great content, starting with a question I usually ask people on my own podcast: how did I build my WordPress Development course?

Read More “How I Built my WordPress Development Course on Udemy”

| |

Deleting 3 Million Spam Comments from a WordPress Database

Over at the Crowd Favorite blog, I wrote up a post about an interesting problem I solved recently. I laid out everything you need to know there, but it involves downloading a HUGE database and putting WP-CLI to good use. If you haven’t used it before and you do development with WordPress, it’s super valuable. Anyway, check out the post – it’s a good one!

Deleting 3 Million Spam Comments from Your WordPress Database