• Resolved kasabian

    (@kasabian)


    Hi all, just got started using LifterLMS and it looks great, almost exactly what I was looking for.

    On the website I’m currently building with LifterLMS the terms “Course(s)” and “Lesson(s)”, which appears in the URL and in the breadcrumbs, aren’t entirely representative of what my site does.

    Could anybody point me in the right direction with how I would go about changing these terms wherever they appear? I’m reasonably comfortable with php so even letting me know what file I would need to edit would be a massive help.

    Thank you in advance and I hope my question makes sense.

    Cheers, Alex

Viewing 4 replies - 1 through 4 (of 4 total)
  • @kasabian,

    This is absolutely customizable. We don’t have options or settings or anything for it but using a filter you can change the language, slugs, etcs…

    Here’s a basic example that would rename “Course” to “Module”: https://gist.github.com/thomasplevy/7e57b0256fa7284911a7f96352926c13

    You can modify *anything* on the course (there’s a ton of options here). This filter gets passed to WP core register_post_type() so you can have a look at the docs there on all the options you can customize.

    You can do the same on lessons, changing the filter from lifterlms_register_post_type_course to lifterlms_register_post_type_lesson

    You can see the source file here: https://github.com/gocodebox/lifterlms/blob/3.12.2/includes/class.llms.post-types.php#L325-L365 (scroll down a bit to see the lesson defaults)

    Notes: Do not modify this file directly on your server. You’ll lose your customizations the next time you update LifterLMS. Use the filter. It’s a bit more work initially but you’ll kick yourself for making manual modifications when you lose them and don’t realize it for a week or something silly.

    Also: if you modify the SLUG the URLS to your existing courses/lessons WILL CHANGE and you’ll have 404s on the *new* and *old* urls. After installing your code snippet you’ll want to flush your permalinks to prevent those 404s: https://lifterlms.com/docs/how-to-flush-wordpress-rewrite-rules-or-permalinks/

    Hope that helps,

    Thread Starter kasabian

    (@kasabian)

    Amazing! thank you for your detailed response, and the link you’ve provided is basically exactly what I was looking for.

    Going to make a start on it right now.

    Thanks once again!

    Thread Starter kasabian

    (@kasabian)

    Hi @thomasplevy,
    Thanks for your help with my question. I’ve added the filter code to my child themes functions.php file to protect my code from any future updates.

    Was just wondering if you could help me out with one more thing…

    I currently have Courses now renamed to ‘Offers’ as per my last question.

    The URL when on a particular course’s page is now: ‘/offers/free-sign-up-offers/’, where ‘Free Sign Up Offers’ is the name of the course. When you go on to a particular lesson in this the URL is as follows: ‘/lesson/lesson-one’.

    How would I go about changing this so that the URL would instead be: ‘/offers/free-sign-up-offers/lesson-one’? If you could point me in the right direction with regards to this I would be very grateful.

    Thank you in advance once more.

    @kasabian,

    If you can figure out how to do this please share the source…

    This is something that gets asked from time to time and (ocassionally folks get pretty aggressive about how it’s stupid that it doesn’t work that way by default) and I’ve challenged and welcomed *everyone* to try to figure this out.

    WordPress doesn’t have an API for it.

    I’ve *tried to write the code* and it always ends in such a tremendous tangle of a series of hacks that I’ve ultimately decided that the collective you can simply deal with it until someone brilliant figures it out for us.

    That’s the best I can recommend.

    Best,

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Changing “Courses” and “Lessons” in url and breadcrumbs’ is closed to new replies.