• Hi, 
    I customized the single course tab content by adding acf fields. It worked fine but I have an issue with the Curriculum tab which doesn't works anymore. 
    I saw that a curriculum-v2.php file is available now, but I'm not able to make my code works. I'm using a theme child and I use the same path as recommended, but the acf content is not showing.
    Here is my code : 
    
    
    <?php
    
    /**
    
    * Template for displaying curriculum tab of single course.
    
    *
    
    * This template can be overridden by copying it to yourtheme/learnpress/single-course/tabs/curriculum.php.
    
    *
    
    * @author ThimPress
    * @package Learnpress/Templates
    * @version 4.0.1
    
    */
    
    defined( 'ABSPATH' ) || exit();
    
    $course = LP_Global::course();
    $user = learn_press_get_current_user();
    
    if ( ! $course || ! $user ) {
    return;
    }
    
    $can_view_content_course = $user->can_view_content_course( $course->get_id() );
    ?>
    <div class="course-curriculum" id="learn-press-course-curriculum">
    <div class="curriculum-scrollable custom-curriculum">
    <?php the_field('curriculum'); ?>
    </div>
    </div>
    
    I also try that code which works, but I can get a dynamic id for the courses : 
    <div class="course-curriculum" id="learn-press-course-curriculum">
        <div class="curriculum-scrollable">
            <?php 
           
           $curriculum_content = get_field('curriculum', 2839);
            if ($curriculum_content) {
                echo $curriculum_content;
            } else {
                echo 'Aucun contenu trouvé pour le champ curriculum.';
            }      
    ?>
        </div>
    </div>
    
    How can I solve that? 
    
    Thanks

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author ThimPress

    (@thimpress)

    Hi paulettepaillette,

    To show your data cusstom on the Curriculum, you need use hook to add more code. You shouldn’t override file, on the feature we’ll disable function override via file.

    With the content your file custom, we think you override file curriculum.php is the old file on child theme, with way, you need clone file curriculum-v2.php and edit it on your child theme.

    Thanks.

Viewing 1 replies (of 1 total)

The topic ‘ACF content in Curriculum Tab’ is closed to new replies.