LearnDash includes some great shortcodes for showing content to learners that are enrolled in courses as well as users that aren’t enrolled—the [visitor] and [student] shortcodes. These are great on course pages, but what about inside Open courses and elsewhere on a LearnDash site? Sometimes you may want to show content based on the user’s signed-in state rather than whether or not they’re enrolled in a course. We use this a lot when we want to hide content from anonymous visitors (while still giving them a taste of what’s available) and encourage users to create an account to view free course materials.
You can see an example below. If you’re logged in, you’ll see a photo of the moon landing. If you’re not logged in, you’ll see a photo of a man sitting at a laptop.