Support » Plugin: Namaste! LMS » Certificates

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author prasunsen


    Not yet, we’ll have to add shortcode for this.

    @prasunsen thanks for such awesome plugin

    @gmwestrup: if you are still looking for a workaround I have made the following changes to shortcodes.php in controllers folder:

    function mynamastecertificates() {
       	global $wpdb, $user_ID;
       	if(!is_user_logged_in()) return "";
       		$_cert = new NamasteLMSCertificateModel();
    		$certificates = $_cert -> student_certificates($user_ID);
    		$student_id = $user_ID;
       		if(!sizeof($certificates)) _e('No Completed certificates.', 'namaste');
       		$content = ob_get_contents();
       		return $content;
       add_shortcode( 'mynamastecertificates', 'mynamastecertificates' );

    and I just use [mynamastecertificates] shortcode anywhere on the page or post and it shows the user certificates. 🙂

    You will have to make some changes to my-certificates.php in view folder as well.

    In line 12 I have changed

    <tr><td><a href="admin.php?page=namaste_view_certificate&id=<?php echo $certificate->id?>&student_id=<?php echo $student_id?>&noheader=1" target="_blank"><?php echo $certificate->title?></a></td>


    <tr><td><a href="<?php echo get_option('siteurl'); ?>/wp-admin/admin.php?page=namaste_view_certificate&id=<?php echo $certificate->id?>&student_id=<?php echo $student_id?>&noheader=1" target="_blank"><?php echo $certificate->title?></a></td>

    Hope it helps 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Certificates’ is closed to new replies.