Title: Loop Template not called
Last modified: November 7, 2025

---

# Loop Template not called

 *  [Collie-IT, Anne K. Frey](https://wordpress.org/support/users/collieit/)
 * (@collieit)
 * [7 months ago](https://wordpress.org/support/topic/loop-template-not-called/)
 * Dear Support,
 * i try to add a text after the title in every couse in a Category list.
 *     ```wp-block-code
       <h3 class="course-title"><?php the_title(); ?> <?php $course_id = get_the_ID();$tage = array("So. ", "Mo. ", "Di. ", "Mi. ", "Do. ", "Fr. ", "Sa. ");date_default_timezone_set("Europe/Berlin");$tag = date("w",  strtotime(get_post_meta($course_id, "_lp_course_startdate")[0]));echo ( $tage[$tag] . date('d.m.Y', strtotime(get_post_meta($course_id, "_lp_course_startdate")[0])). " ab ". date('H:i', strtotime(get_post_meta($course_id, "_lp_course_startdate")[0]))  );?></h3>
       ```
   
 * I have overwritten the **wp-content\plugins\learnpress\templates\loop\course\
   title.php** with **wp-content\themes\generatepress_child\learnpress\loop\course\
   title.php**
 * And I Use the filter in the functions.php
 *     ```wp-block-code
       add_filter( 'learn-press/override-templates', function(){ return true; } ); 
       ```
   
 * I have also tried to write in the **wp-content\plugins\learnpress\templates\loop\
   course\title.php** directly but the code will not be called.
 * What can I do?
 * Best regards
 * Collie-IT

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Support [brianvu-tp](https://wordpress.org/support/users/briantp/)
 * (@briantp)
 * [7 months ago](https://wordpress.org/support/topic/loop-template-not-called/#post-18712843)
 * Dear Collie-IT,
 * Thank you for reaching out.
 * Please try changing the override path in your child theme to include the version
   directory, **`learnpress-v4`**:
    - **Current Path (likely incorrect):**
      `wp-content/themes/generatepress_child/
      learnpress/loop/course/title.php`
    - **Suggested New Path:**
      `wp-content/themes/generatepress_child/learnpress-
      v4/loop/course/title.php`
 * If the issue persists, could you please provide a **screenshot** of the exact
   area on the course list page where you want the custom date/time to appear? Seeing
   the context will help us identify the precise template file you need to override.
 * Let us know the result of changing the template path!
 * Best regards,
   Brianvu-tp
 *  Thread Starter [Collie-IT, Anne K. Frey](https://wordpress.org/support/users/collieit/)
 * (@collieit)
 * [7 months ago](https://wordpress.org/support/topic/loop-template-not-called/#post-18713308)
 * Dear Supprt,
 * here is the image. Suddently it has no effect.
 * ![](https://i0.wp.com/www.collie-it.de/wp-content/uploads/2025/11/place.png?ssl
   =1)
 * Best regards
 * Collie-IT
 *  Plugin Support [brianvu-tp](https://wordpress.org/support/users/briantp/)
 * (@briantp)
 * [7 months ago](https://wordpress.org/support/topic/loop-template-not-called/#post-18714504)
 * Hi Collie-IT,
 * Thank you for your reply and for providing the screenshot.
 * To modify that specific section, you can use the following hook:
 * `apply_filters( 'learn-press/layout/list-courses/item/section/bottom', '…' );`
 * This hook is [located in](https://github.com/LearnPress/learnpress/blob/50a36733dd80f092057f8b17475cb56d4dce5242/inc/TemplateHooks/Course/ListCoursesTemplate.php#L285):
   **
   wp-content/plugins/learnpress/inc/TemplateHooks/Course/ListCoursesTemplate.php**
 * You can apply your custom code through this filter in your child theme to achieve
   the desired customization.
 * Best regards,
   Brianvu-tp
 *  Thread Starter [Collie-IT, Anne K. Frey](https://wordpress.org/support/users/collieit/)
 * (@collieit)
 * [7 months ago](https://wordpress.org/support/topic/loop-template-not-called/#post-18715045)
 * Dear Support,
 * unfurtunatly if I use
 *     ```wp-block-code
       apply_filters( 'learn-press/layout/list-courses/item/section/bottom', '…' );
       ```
   
 * I don’t get the cursespecifc inputs. with paramaters are needed for the function?
 * Best Regards
 * Collie-IT
 *  Plugin Support [brianvu-tp](https://wordpress.org/support/users/briantp/)
 * (@briantp)
 * [7 months ago](https://wordpress.org/support/topic/loop-template-not-called/#post-18715950)
 * Dear Collie-IT,
 * Thank you for the quick follow-up!
 * Here is an example function you can place in your **child theme’s functions.php**
   file. This code display your [course start date](https://prnt.sc/cyG9lnQECKBo)
   directly below the title in the course list:
 *     ```wp-block-code
       add_filter( 'learn-press/layout/list-courses/item/section/bottom', function( $components, $course, $settings ) {    if ( ! is_array( $components ) || empty( $components['title'] ) ) {        return $components;    }    // Get course ID    $course_id = method_exists( $course, 'get_id' ) ? $course->get_id() : get_the_ID();    // Build display string using LearnPress user item start_time, formatted like: "Mo. 01.01.2025 ab 10:00"    $dateStr = ' - ';    $user_id = get_current_user_id();    if ( $user_id ) {        $userCourseModel = \LearnPress\Models\UserItems\UserCourseModel::find( (int) $user_id, (int) $course_id, true );        if ( $userCourseModel instanceof \LearnPress\Models\UserItems\UserCourseModel ) {            $start_time = $userCourseModel->get_start_time();            if ( ! empty( $start_time ) ) {                try {                    $tage = array( 'So. ', 'Mo. ', 'Di. ', 'Mi. ', 'Do. ', 'Fr. ', 'Sa. ' );                    $tz   = new \DateTimeZone( 'Europe/Berlin' );                    // start_time is stored in UTC format (string), convert to Europe/Berlin                    $dt   = new \DateTime( $start_time, new \DateTimeZone( 'UTC' ) );                    $dt->setTimezone( $tz );                    $weekdayIndex = (int) $dt->format( 'w' );                    $prefix       = isset( $tage[ $weekdayIndex ] ) ? $tage[ $weekdayIndex ] : '';                    $dateStr      = $prefix . $dt->format( 'd.m.Y' ) . ' ab ' . $dt->format( 'H:i' );                } catch ( \Exception $e ) {                    $dateStr = ' - ';                }            }        }    }    // Insert before closing heading tag; fallback to append at the end    $closing_tags = array( '</h1>', '</h2>', '</h3>', '</h4>', '</h5>', '</h6>' );    $inserted = false;    foreach ( $closing_tags as $closing ) {        if ( strpos( $components['title'], $closing ) !== false ) {            $components['title'] = str_replace(                $closing,                ' <span class="course-start">' . esc_html( $dateStr ) . '</span>' . $closing,                $components['title']            );            $inserted = true;            break;        }    }    if ( ! $inserted ) {        $components['title'] .= ' <span class="course-start">' . esc_html( $dateStr ) . '</span>';    }    return $components;}, 10, 3 );
       ```
   
 * Let me know if this works!
 * Best regards,
   Brianvu-tp

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Loop Template not called’ is closed to new replies.

 * ![](https://ps.w.org/learnpress/assets/icon-256x256.gif?rev=3254420)
 * [LearnPress - WordPress LMS Plugin for Create and Sell Online Courses](https://wordpress.org/plugins/learnpress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/learnpress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/learnpress/)
 * [Active Topics](https://wordpress.org/support/plugin/learnpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/learnpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/learnpress/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [brianvu-tp](https://wordpress.org/support/users/briantp/)
 * Last activity: [7 months ago](https://wordpress.org/support/topic/loop-template-not-called/#post-18715950)
 * Status: not resolved