Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Jeff Balicki
/
st_joseph
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
7e01bd15
authored
2023-02-09 17:08:27 -0500
by
Jeff Balicki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
dd
Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent
e9276577
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
wp-content/themes/crlg/inc/learn.php
wp-content/themes/crlg/inc/learn.php
View file @
7e01bd1
...
...
@@ -71,3 +71,51 @@ function the_bread() {
}
};
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
container
">
<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
">
<div class="
cert
">
<?php echo '<a target="
_blank
" style="
background
-
image
:
url
(
'.wp_get_attachment_url( $thumbnail_id).'
)
" class="
cert_link
" href="
'.$cert.'
">'. wp_get_attachment_image(
$thumbnail_id
,'medium' ).'<div class="
cert
-
text
"><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
).'</div></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
()) ;
}
}
...
...
Please
register
or
sign in
to post a comment