I added the code that you provided in my wplms-customizer.php file in wplms customizer plugin, but still not working.
Could you tell me the correct place where should I add?
Thank you.
Here is my page url and admin credentials.
http://contentsbank.cc/
ID: admin
PW: S02aab6Mm
Can you please share more information and also the link of the code ,tip or topic to check this out .
Shortcode to show course duration in certificate are not working in my site.
I added the code that you provided in my wplms-customizer.php file but still not working.
Here is code that you provided.
https://wplms.io/support/knowledge-base/shortcode-to-show-course-duration-in-certificate/
Here is certificate which I added the shortcode.
http://contentsbank.cc/members/toshinari/
Well this tip requires that the activity when user started course must be recorded in the system .
It fetches date when the user started the course .
If it is not recorded then it will mot work .
Please check if the activity is recorded when the user started the course on your activity page . (that will be : yoursite.com/activity)
Thank you for your help, it's working now.
But, actually I hope can display the Start Date or duration date, not <span style="line-height: 1.5;">duration TIME.</span>
Is it possible display the <span style="line-height: 1.5;">Start Date?</span>
You can use this code instead to show start date.
add_shortcode('certificate_course_duration', 'vibe_certificate_course_duration2');
function vibe_certificate_course_duration2( $atts, $content = null ) {
global $bp,$wpdb;
$student_id=$_GET['u'];
$course_id=$_GET['c'];
$start_time = $wpdb->get_var($wpdb->prepare("SELECT date_recorded FROM {$bp->activity->table_name} WHERE type ='subscribe_course' AND item_id=%d AND component='course' AND user_id=%d ORDER BY id DESC LIMIT 1", $course_id,$student_id));
$expiry=get_user_meta($student_id,$course_id,true);
if(isset($start_time) && $start_time)
return date_i18n( get_option( 'date_format' ), strtotime( $start_date ));
else
return '[certificate_course_duration]';
}