Homepage LearnDash Community Forums General (free) How to show lock icon in prefix of learndash group protected post title?

  • Dave Warfel

    Administrator
    May 24, 2022 at 1:47 pm

    Hi Santhosh – To do this, I think you’ll need a few things.

    1. You’ll need to find a LearnDash function that checks to see if the post is restricted to the current user. I would think something exists in the LearnDash developer docs here, but you could also ask LearnDash support.

    2. Then you’ll need to either use a hook to hook into a “before_title” or “before_post_title” type of hook (if your theme provides one), or customize the single.php template file in your theme/child theme, in order to add the icon.

    Best of luck.

  • Santhosh

    Member
    May 24, 2022 at 2:35 pm

    Thanks for the reply. But I’m not a developer and I don’t know much about coding. I can only copy-paste the code into code snippets plugin or edit theme files using FTP. Can you please share your code? I think this is the function https://developers.learndash.com/function/learndash_is_protected_meta/

    • Dave Warfel

      Administrator
      Jun 1, 2022 at 6:46 pm

      Sorry but I don’t have any code to share. I’ve never done what you’re asking. I was just trying to conceptualize it and provide you with an idea on how to achieve it.

Forum Rules

Forum Rules

Be Kind & Patient

We’re here to learn and/or help each other. Please don’t be mean, rude, or condescending. Treat all members the way you should be treating dogs and your elders—with the utmost love & respect.

External Links

✅ Other websites that add value, help solve problems & contribute to the discussion. ❌ Affiliate links are prohibited. (Site owners may use affiliate links to help support the site.)

Promotion

✅ You may promote your own products/services if they are relevant to an existing discussion. You must disclose your relationship with the product(s).
❌ You may not create new posts simply to promote your products.

Non-LearnDash Topics

❌ General (free) Forum: Only LearnDash-specific topics are allowed.
✅ Premium Forums: You are allowed to post other questions tangentially related to LearnDash. Please use the appropriately named forum. If it doesn’t exist, use the “LearnDash Integrations” forum.

Our Right to Remove

We reserve the right to remove any content, at any time, for any reason. We can also merge one post with another. We will exercise caution when removing content and always try to provide an explanation.