Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter pzo3xic

    (@pzo3xic)

    Hi

    Thanks for reply

    Is there any other way? By adding content into excerpt it displays whole page content in
    meta description tag.

    Regards

    Thread Starter pzo3xic

    (@pzo3xic)

    sorted

    function previous_and_next_lesson_shortcode() {
    	$msg = '<div class="center-pagination sidebar"><nav aria-label="Page navigation"><ul class="pagination justify-content-end">';
    if (!empty(do_shortcode('[namaste-prev-lesson "Previous"]')))
    {
    	$msg .= '<li class="page-item">'.do_shortcode('[namaste-prev-lesson "<span class=\'oi oi-chevron-left\'></span>"]').'</li>';
    }
    else
    {
    	$msg .= '<li class="page-item disabled"> <a class="page-link" href="#" title="#" tabindex="-1"><span class=\'oi oi-chevron-left\'></span></a></li>';
    }
    if (!empty(do_shortcode('[namaste-next-lesson "Next"]')) AND (trim(strip_tags(do_shortcode('[namaste-lesson-status]')))) == 'Completed')
    {
    		$msg .= '<li class="page-item">'.do_shortcode('[namaste-next-lesson "<span class=\'oi oi-chevron-right\'></span>"]').'</li>';
    }
    else
    {
    	$msg .= '<li class="page-item disabled"> <a class="page-link" href="#" title="#" tabindex="-1"><span class=\'oi oi-chevron-right\'></span></a></li>';
    }
    $msg .= '</ul></nav></div>';
    return $msg;
    }
    add_shortcode( 'previous_and_next_lesson', 'previous_and_next_lesson_shortcode' );
    • This reply was modified 5 years, 4 months ago by pzo3xic.
    • This reply was modified 5 years, 4 months ago by pzo3xic.

    What about:
    <?php echo '<a href="/login?redirect_to='.get_permalink().'">Your login link with redirect</a>'; ?>

    Thread Starter pzo3xic

    (@pzo3xic)

    Ahh ok that will do! ??

    Thread Starter pzo3xic

    (@pzo3xic)

    I just come up with a workaround:

    function course_1_completed_check_shortcode($atts = [], $content = null) {
    $lesson1 = do_shortcode( '[namaste-lesson-status lesson_id="600"]' );
    $lesson2 = do_shortcode( '[namaste-lesson-status lesson_id="700"]' );
    if ($lesson1 =='Completed' AND $lesson2 =='Completed') {
    	$content = 'Course completed <span class="oi oi-check"></span>';
    	return $content;
    	}
    else
    	return $content;
    	}
    add_shortcode( 'course_1_completed_check', 'course_1_completed_check_shortcode' );

    the above is in functions.php

    then in lesson HTML I use:

    <div class="alert alert-info">[course_1_completed_check]You joined this course. See lessons below.[/course_1_completed_check]</div>
    which will display that user has enrolled but if completed all lessons it displays “Course completed”.

    The above involves a lot of work for a single course and it also means I won’t be able to delegate creating courses to others. Please don’t think of it as final solution.

    • This reply was modified 5 years, 8 months ago by pzo3xic.
Viewing 5 replies - 1 through 5 (of 5 total)