• Resolved nataliamdasilva

    (@nataliamdasilva)


    Hi! I’m trying to output a lesson’s course title so that I can add it before the course lesson. I.e. “Course Title: Course Lesson”

    I’ve looked at the code that outputs the title for the breadcrumb and for the widget but I was not able to get just the title to work in my child theme. Any help would be greatly appreciated.

    Thank you for your time.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter nataliamdasilva

    (@nataliamdasilva)

    Hi! Just following up. Does anyone have any advice on how to do this? Thanks!

    Plugin Support Dan (a11n)

    (@drawmyface)

    Where exactly are you trying to add this? To the lesson title on the single lesson page?

    Thread Starter nataliamdasilva

    (@nataliamdasilva)

    Hi Dan,

    Yes. Our website uses a theme we created that outputs a custom menu between page titles and content. We would like to pull the course title in this extra header, followed by the lesson title (which we are currently pulling through get the title). After that we display our menu and then any content the page/post might have. Since our customers can take multiple courses, we find the need to output the course title in this header so that they know right away where they are.

    – N

    Plugin Support Dan (a11n)

    (@drawmyface)

    You should be able to repurpose the same code used in the breadcrumb function:
    https://github.com/Automattic/sensei/blob/9e481a6e0afd73871f777ce75cf36f0b3d973f2e/includes/class-sensei-frontend.php#L599

    What code have you tried?

    Thread Starter nataliamdasilva

    (@nataliamdasilva)

    Hi Dan, that is the code I tried but it outputted a blank space. Do you have any tips on how I can call it? the “$html = ‘<section class=”sensei-breadcrumb”>’ . esc_html( $sensei_breadcrumb_prefix );” part confuses me because I am not sure if I add <?php before it or if I just start from the next line. Any guidance would be really helpful.

    Plugin Support Dan (a11n)

    (@drawmyface)

    $html = ... is PHP, so if you’re adding it within an HTML block it will need a <?php tag.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Output Course Title on Single Lesson’ is closed to new replies.