Skip to content

Commit

Permalink
Adding featured images on courses
Browse files Browse the repository at this point in the history
  • Loading branch information
jstriedinger committed Jan 4, 2025
1 parent 830d742 commit 3e28666
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 19 deletions.
52 changes: 42 additions & 10 deletions acf-json/group_5f5ef62a3a14f.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,34 @@
"placeholder": "",
"new_lines": ""
},
{
"key": "field_67786cf72fcd9",
"label": "Featured images",
"name": "featured_images",
"aria-label": "",
"type": "gallery",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"return_format": "array",
"library": "all",
"min": "",
"max": "",
"min_width": "",
"min_height": "",
"min_size": "",
"max_width": "",
"max_height": "",
"max_size": "",
"mime_types": "",
"insert": "append",
"preview_size": "medium"
},
{
"key": "field_6436ead456157",
"label": "GIF preview video",
Expand Down Expand Up @@ -173,7 +201,8 @@
"allow_null": 1,
"multiple": 0,
"return_format": "object",
"ui": 1
"ui": 1,
"bidirectional_target": []
},
{
"key": "field_6081e93e7109c",
Expand Down Expand Up @@ -252,6 +281,7 @@
"max": 0,
"layout": "table",
"button_label": "Add Row",
"rows_per_page": 20,
"sub_fields": [
{
"key": "field_607850b611dc6",
Expand All @@ -274,8 +304,7 @@
"maxlength": "",
"parent_repeater": "field_6078504311dc5"
}
],
"rows_per_page": 20
]
},
{
"key": "field_5f6acc3e7845d",
Expand All @@ -296,6 +325,7 @@
"max": 0,
"layout": "table",
"button_label": "Add Row",
"rows_per_page": 20,
"sub_fields": [
{
"key": "field_5faf6395cc06a",
Expand All @@ -318,8 +348,7 @@
"maxlength": "",
"parent_repeater": "field_5f6acc3e7845d"
}
],
"rows_per_page": 20
]
},
{
"key": "field_60f0d543e08f4",
Expand Down Expand Up @@ -364,7 +393,8 @@
"allow_null": 1,
"multiple": 0,
"return_format": "object",
"ui": 1
"ui": 1,
"bidirectional_target": []
},
{
"key": "field_5f6580bebcd1b",
Expand All @@ -388,7 +418,8 @@
"elements": "",
"min": "",
"max": "",
"return_format": "object"
"return_format": "object",
"bidirectional_target": []
},
{
"key": "field_63c10acdfe6ca",
Expand All @@ -414,7 +445,8 @@
"elements": "",
"min": "",
"max": "",
"return_format": "object"
"return_format": "object",
"bidirectional_target": []
}
],
"location": [
Expand All @@ -435,5 +467,5 @@
"active": true,
"description": "",
"show_in_rest": 0,
"modified": 1685572828
}
"modified": 1735945627
}
6 changes: 5 additions & 1 deletion learndash/ld30/course.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
$preview_gif = $meta['preview_gif'];
$course_cover_photo = false;
$sponsor = $meta['sponsor'];
$featured_images = $meta['featured_images'];
if ( class_exists( '\BuddyBossTheme\BuddyBossMultiPostThumbnails' ) ) {
$course_cover_photo = \BuddyBossTheme\BuddyBossMultiPostThumbnails::get_post_thumbnail_url(
'sfwd-courses',
Expand Down Expand Up @@ -265,8 +266,11 @@ class="button is-primary is-medium"><?php esc_html_e( 'Empieza el curso', 'arkde
}
get_template_part( 'template-parts/course/bulletpoints', '', array( 'bullets' => $bullets ) );
get_template_part( 'template-parts/course/description', '' );
if($featured_images)
get_template_part( 'template-parts/course/featured_images', '',array( 'featured_images' => $featured_images ) );
?>
<h3 class="subtitle is-size-4 has-text-weight-bold pt-4"><?php esc_html_e( 'Temario del curso', 'arkdewp' ); ?></h2>
<div class="pt-6"></div>
<h3 class="subtitle is-size-4 has-text-weight-bold pt-2"><?php esc_html_e( 'Temario del curso', 'arkdewp' ); ?></h2>

<?php
learndash_get_template_part(
Expand Down
2 changes: 1 addition & 1 deletion learndash/ld30/course/pensum-listing.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

if ( $lessons && ! empty( $lessons ) ) : ?>

<div class="course-pensum mb-6">
<div class="course-pensum">
<?php
foreach ( $lessons as $lesson ) :
$lesson = $lesson['post'];
Expand Down
4 changes: 2 additions & 2 deletions template-parts/course/description.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
$course_content = get_the_content();
?>

<h3 class="subtitle is-size-4 has-text-weight-bold pt-4 <?php echo $white ? 'has-text-white' : ''; ?>"><?php esc_html_e( 'Descripción', 'arkdewp' ); ?></h3>
<div class="mt-6"></div>
<h3 class="subtitle is-size-4 has-text-weight-bold pt-2 <?php echo $white ? 'has-text-white' : ''; ?>"><?php esc_html_e( 'Descripción', 'arkdewp' ); ?></h3>
<div class="course-description content has-text-justified <?php echo $white ? 'has-text-white' : ''; ?>">
<?php echo $course_content; ?>
</div>
<div class="course-desc-show <?php echo $white ? 'has-text-white' : ''; ?>">
<a href="#" class="has-text-weight-bold <?php echo $white ? 'has-text-white' : ''; ?>"><span><?php esc_html_e( 'Leer más ', 'arkdewp' ); ?></span><i class="fa-solid fa-chevron-down"></i></a>
</div>
<div class="mb-6"></div>
20 changes: 20 additions & 0 deletions template-parts/course/featured_images.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$white = isset( $args['white'] ) ? $args['white'] : false;
$images = $args['featured_images'];
$course_content = get_the_content();
?>

<div class="pt-6"></div>
<h3 class="subtitle is-size-4 has-text-weight-bold pt-2 <?php echo $white ? 'has-text-white' : ''; ?>"><?php esc_html_e( 'Imágenes destacadas', 'arkdewp' ); ?></h3>
<div class="columns is-multiline is-desktop has-text-centered">
<?php
foreach ( $images as $img ) : ?>
<div class="column is-half-desktop">
<img src="<?php echo esc_url( $img['url'] ); ?>" alt="<?php echo esc_attr( $img['alt'] ); ?>" style="max-width: 100%;" >
</div>
<?php endforeach;
?>
</div>
6 changes: 3 additions & 3 deletions template-parts/course/req.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
$reqs = $args[0];
$white = isset( $args[1] ) ? true : false;
?>

<h3 class="subtitle is-size-4 has-text-weight-bold pt-4 <?php echo $white ? 'has-text-white' : ''; ?>"><?php esc_html_e( '¿Qué necesitas?', 'arkdewp' ); ?></h2>
<ul class="is-flex is-flex-wrap-wrap bullet-points mb-6">
<div class="pt-6"></div>
<h3 class="subtitle is-size-4 has-text-weight-bold pt-2 <?php echo $white ? 'has-text-white' : ''; ?>"><?php esc_html_e( '¿Qué necesitas?', 'arkdewp' ); ?></h2>
<ul class="is-flex is-flex-wrap-wrap bullet-points">
<?php foreach ( $reqs as $req ) : ?>
<li class="is-flex is-align-items-baseline <?php echo $white ? 'has-text-white' : ''; ?>">
<i class="fa-solid fa-circle mr-3"></i><span class="is-size-14px"><?php echo esc_html( $req['txt'] ); ?></span>
Expand Down
4 changes: 2 additions & 2 deletions template-parts/course/teachers.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
$teachers = $args[0];
$career = isset( $args[1] ) ? true : false;
?>

<h3 class="subtitle is-size-4 has-text-weight-bold pt-4 <?php echo $career ? 'has-text-white' : ''; ?>"><?php count( $teachers ) > 1 ? esc_html_e( 'Tus instructores', 'arkdewp' ) : esc_html_e( 'Tu instructor', 'arkdewp' ); ?></h3>
<div class="pt-6"></div>
<h3 class="subtitle is-size-4 has-text-weight-bold pt-2 <?php echo $career ? 'has-text-white' : ''; ?>"><?php count( $teachers ) > 1 ? esc_html_e( 'Tus instructores', 'arkdewp' ) : esc_html_e( 'Tu instructor', 'arkdewp' ); ?></h3>
<div class="is-flex has-gap-16 is-flex-direction-column mb-6">
<?php
foreach ( $teachers as $teacher ) :
Expand Down

0 comments on commit 3e28666

Please sign in to comment.