f4d8be57 by Jeff Balicki

certs

Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent 577b4694
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
......@@ -5,6 +5,8 @@ add_shortcode('course-list', 'course_list');
function course_list(){
try{
$custom_args = array(
'post_type' => 'sfwd-courses',
'posts_per_page' => -1,
......@@ -39,9 +41,13 @@ function course_list(){
</div>
</div>
<?php endif;
wp_reset_query();
$output = ob_get_clean();
return $output;
wp_reset_query();
$output = ob_get_clean();
return $output;
}catch(Throwable $e) {
error_log("course_list()". $e->getMessage()) ;
}
}
add_shortcode('my-course-list', 'my_course_list');
......@@ -55,7 +61,7 @@ $enrolled_courses = learndash_user_get_enrolled_courses(get_current_user_id());
if (is_array($enrolled_courses)): ?>
<div class="carousel course">
<div id="<?php echo $uniqid; ?>" class="course-carousel carousel-items">
<div class='swiper-wrapper'>
<div class='swiper-wrapper container'>
<?php foreach($enrolled_courses as $enrolled){
echo course_card($enrolled);
}; ?>
......
......@@ -5,6 +5,8 @@ add_shortcode('resources-list', 'resources_list');
function resources_list(){
try{
$custom_args = array(
'post_type' => 'resource',
'posts_per_page' => -1,
......@@ -54,9 +56,14 @@ function resources_list(){
</table>
</div>
<?php endif;
wp_reset_query();
$output = ob_get_clean();
return $output;
wp_reset_query();
$output = ob_get_clean();
return $output;
}catch(Throwable $e) {
error_log("resources_list()". $e->getMessage()) ;
}
}
......
......@@ -4,6 +4,7 @@ add_shortcode( 'promos', 'promos' );
function promos(){
try{
$custom_args = array(
'post_type' => 'promo',
'posts_per_page' => 3,
......@@ -29,9 +30,12 @@ function promos(){
</div>
<?php endif;
wp_reset_query();
$output = ob_get_clean();
return $output;
wp_reset_query();
$output = ob_get_clean();
return $output;
}catch(Throwable $e) {
error_log("promos()". $e->getMessage()) ;
}
}
function promos_slides($id){
......@@ -107,4 +111,51 @@ function firstname(){
$user = get_userdata( get_current_user_id() );
return $user->first_name;;
}
add_shortcode( 'certs', 'certs' );
function certs(){
try{
$enrolled_courses = learndash_user_get_enrolled_courses( get_current_user_id(), array(), false);
ob_start();
if (is_array($enrolled_courses)):?>
<div class="carousel">
<div id="cert" class="cert-carousel carousel-items">
<div class='swiper-wrapper'>
<?php foreach($enrolled_courses as $enrolled_course){
$cert = learndash_get_course_certificate_link($enrolled_course, get_current_user_id());
if(!empty($cert)){
$sfwd_course = get_post_meta($enrolled_course , '_sfwd-courses', true );
$thumbnail_id = "911"; ?>
<div class="swiper-slide container">
<div class="cert">
<?php echo '<a target="_blank" style="background-image:url('.wp_get_attachment_url( $thumbnail_id).')" class="cert_link" href="'.$cert.'"><p><strong>'
.get_user_meta(get_current_user_id(), 'first_name', true )." ". get_user_meta(get_current_user_id(), 'last_name', true ).'</strong></p>'
.get_the_title( $enrolled_course ).'</a>';
?>
</div>
</div>
<?php }
}; ?>
</div>
<div class="swiper-pagination"></div>
<div class="swiper-button-prev" data-id="cert"></div>
<div class="swiper-button-next" data-id="cert"></div>
</div>
</div>
<?php endif;
wp_reset_query();
$output = ob_get_clean();
return $output;
}catch(Throwable $e) {
error_log("certs()". $e->getMessage()) ;
}
}
\ No newline at end of file
......
......@@ -32984,18 +32984,26 @@
_id = jQuery(this).attr('id');
}
if (jQuery(this).hasClass('course-carousel')) {
offset = (window.innerWidth - $('.entry-content').width()) / 2 - 28;
offset = 0;
PerView = 3;
space = 0;
SlidesPerGroup = 3;
offsetAfter = (window.innerWidth - $('.entry-content').width()) / 2 - 28;
space = 45;
SlidesPerGroup = 1;
offsetAfter = 0;
_id = jQuery(this).attr('id');
}
if (jQuery(this).hasClass('cert-carousel')) {
offset = 0;
PerView = 3;
space = 40;
SlidesPerGroup = 1;
offsetAfter = 0;
_id = jQuery(this).attr('id');
}
if ($(window).width() < 600) {
offset = 0;
PerView = 1;
SlidesPerGroup = 1;
space = 0;
SlidesPerGroup = 0;
space = 40;
offsetAfter = 0;
}
var swiper_params = {
......@@ -33632,6 +33640,8 @@
document.getElementById('main-nav').classList.add('fixed-top');
} else {
document.getElementById('main-nav').classList.remove('fixed-top');
document.getElementById('search').classList.remove('open');
document.getElementById('search-button').classList.remove('open');
}
});
});
......@@ -33659,9 +33669,12 @@
$__default["default"](document).ready(function ($) {
var $search = $('.search').clone();
$search.addClass('mobile');
$('.search').attr('id', 'search');
$('.search-button').attr('id', 'search-button');
$('#navbarNavDropdown').prepend($search);
$(document).on("click", ".search-button a, .close", function (e) {
e.preventDefault();
$('.search-button').toggleClass('open');
$('.search').toggleClass('open');
});
});
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
......@@ -33,20 +33,33 @@ jQuery(document).ready(function($) {
_id = jQuery(this).attr('id');
}
if (jQuery(this).hasClass('course-carousel')) {
offset = ((window.innerWidth - $('.entry-content').width()) / 2) - 28;
offset =0;
PerView = 3;
space = 45;
SlidesPerGroup = 1;
offsetAfter = 0;
_id = jQuery(this).attr('id');
}
if (jQuery(this).hasClass('cert-carousel')) {
offset = 0;
PerView = 3;
space = 0;
SlidesPerGroup = 3;
offsetAfter = ((window.innerWidth - $('.entry-content').width()) / 2) - 28;
space = 40;
SlidesPerGroup = 1;
offsetAfter = 0;
_id = jQuery(this).attr('id');
}
if ($(window).width() < 600) {
offset = 0;
PerView = 1;
SlidesPerGroup = 1;
space = 0;
SlidesPerGroup = 0;
space = 40;
offsetAfter = 0;
}
......
......@@ -35,8 +35,11 @@ document.addEventListener("DOMContentLoaded", function() {
window.addEventListener('scroll', function() {
if (window.scrollY > 57) {
document.getElementById('main-nav').classList.add('fixed-top');
} else {
document.getElementById('main-nav').classList.remove('fixed-top');
document.getElementById('search').classList.remove('open');
document.getElementById('search-button').classList.remove('open');
}
});
});
......@@ -72,10 +75,14 @@ function backToTop() {
jQuery(document).ready(function($) {
var $search = $('.search').clone();
$search.addClass('mobile');
$('.search').attr('id','search');
$('.search-button').attr('id','search-button');
$('#navbarNavDropdown').prepend($search);
$(document).on("click", ".search-button a, .close", function(e) {
e.preventDefault();
$('.search-button').toggleClass('open');
$('.search').toggleClass('open');
......
......@@ -156,4 +156,4 @@ max-width: 100% !important;
.wp-block-image.is-style-rounded img{
border-radius: 25px;
}
\ No newline at end of file
}
......
......@@ -113,7 +113,11 @@
.admin-bar .fixed-top {
top: 32px;
@media only screen and (max-width: 768px) {
top: 0px;
}
}
#main-nav.fixed-top {
height: 80px !important;
......@@ -160,6 +164,11 @@
right: 0px;
width: 200px;
height: 200px;
@media only screen and (max-width: 900px) {
width: 140px;
height: 140px;
}
background-image: url("../images/logo-border.png");
}
......@@ -218,20 +227,32 @@
.search-button a {
text-indent: 99999px;
position: relative;
background-repeat: no-repeat;
width: 35px;
height: 35px;
background-image: url("data:image/svg+xml,%3Csvg id='Component_33_1' data-name='Component 33 %E2%80%93 1' xmlns='http://www.w3.org/2000/svg' width='35' height='35' viewBox='0 0 35 35'%3E%3Ccircle id='Ellipse_8' data-name='Ellipse 8' cx='17.5' cy='17.5' r='17.5' fill='%230484b8'/%3E%3Cg id='Group_1454' data-name='Group 1454' transform='translate(-1077.417 -15.667)'%3E%3Ccircle id='Ellipse_7' data-name='Ellipse 7' cx='6.701' cy='6.701' r='6.701' transform='translate(1086.75 25)' fill='none' stroke='%23fff' stroke-width='3'/%3E%3Cline id='Line_39' data-name='Line 39' x2='4.188' y2='4.188' transform='translate(1098.896 37.146)' fill='none' stroke='%23fff' stroke-linecap='round' stroke-width='3'/%3E%3C/g%3E%3C/svg%3E");
}
.search{
display: none;
.search-button.open{
display:none;
}
.search{
top:57px;
height: 128px;
background-color:rgba(255,255,255,0.9);
position: fixed;
right:0px;
visibility: hidden;
transition: 0.4s;
width: 100%;
right: -100%;
.search-form{
width: 60%;
margin: auto;
margin-top: 40px;
margin-top: 20px;
@media only screen and (max-width: 768px) {
width: 99%;
margin-top: 0px;
......@@ -245,13 +266,15 @@
@media only screen and (max-width: 768px) {
width: 98%;
}
}
.search-field{
all: unset;
width: 100%;
margin: auto;
border-bottom:1px solid #2c2c2c;
}
.search-submit{
......@@ -274,6 +297,7 @@
background-color: #2c2c2c;
}
}
.close{
all: unset;
position: relative;
......@@ -293,13 +317,29 @@
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='33.996' height='33.996' viewBox='0 0 33.996 33.996'%3E%3Cg id='Group_1499' data-name='Group 1499' transform='translate(2.121 2.121)' opacity='0.997'%3E%3Cpath id='Path_1922' data-name='Path 1922' d='M0 0 29.754 29.754' transform='translate(0 0)' fill='none' stroke='%232c2c2c' stroke-linecap='round' stroke-width='3'/%3E%3Cline id='Line_4' data-name='Line 4' x1='29.754' y2='29.754' transform='translate(0 0)' fill='none' stroke='%232c2c2c' stroke-linecap='round' stroke-width='3'/%3E%3C/g%3E%3C/svg%3E");
}
}
.search .search-form label::before{
content: "";
opacity: 0;
transition: 0.8s;
position: absolute;
width: 35px;
height: 35px;
margin-left: -65px;
margin-top: -5px;
background-image: url("data:image/svg+xml,%3Csvg id='Component_33_1' data-name='Component 33 %E2%80%93 1' xmlns='http://www.w3.org/2000/svg' width='35' height='35' viewBox='0 0 35 35'%3E%3Ccircle id='Ellipse_8' data-name='Ellipse 8' cx='17.5' cy='17.5' r='17.5' fill='%230484b8'/%3E%3Cg id='Group_1454' data-name='Group 1454' transform='translate(-1077.417 -15.667)'%3E%3Ccircle id='Ellipse_7' data-name='Ellipse 7' cx='6.701' cy='6.701' r='6.701' transform='translate(1086.75 25)' fill='none' stroke='%23fff' stroke-width='3'/%3E%3Cline id='Line_39' data-name='Line 39' x2='4.188' y2='4.188' transform='translate(1098.896 37.146)' fill='none' stroke='%23fff' stroke-linecap='round' stroke-width='3'/%3E%3C/g%3E%3C/svg%3E");
}
.search.open .search-form label::before{
opacity: 1;
}
.search.open:not(.mobile-search){
display: block;
top:57px;
right:0px;
width: 100%;
height: 128px;
background-color:rgba(255,255,255,0.9);
position: fixed;
visibility: visible;
transition: 0.4s;
@media only screen and (max-width: 768px) {
display: none;
visibility: hidden;
......@@ -307,12 +347,13 @@
z-index: 999;
}
.search.open.mobile{
.search.mobile{
display: none;
visibility: hidden;
position: revert;
height: 40px;
top:0px;
@media only screen and (max-width: 768px) {
position: absolute;
display: block;
visibility: visible;
}
......@@ -324,6 +365,7 @@
right: 20px;
border-color:transparent !important ;
}
.fixed-top{
.navbar-toggler{
top: 20px;
......