Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madhvendras84/047d03b1a8226d5eddb28af26666292e to your computer and use it in GitHub Desktop.
Save madhvendras84/047d03b1a8226d5eddb28af26666292e to your computer and use it in GitHub Desktop.
function show_custom_details_in_course_sidebar() {
// Check if the ACF plugin is active
if (function_exists('get_field')) {
$enter_time = get_field('enter_time');
$select_time_format = get_field('select_time_format');
echo '<li>';
echo '<i class="fas fa-film"></i>';
echo '<span class="label">' . esc_html__('Content :', 'edubin') . '</span>';
echo '<span class="value"> Audio-Video & Text </span>';
echo '</li>';
if ($enter_time && $select_time_format) {
echo '<li>';
echo '<i class="far fa-clock"></i>';
echo '<span class="label">' . esc_html__('Course Duration :', 'edubin') . '</span>';
echo '<span class="value">' . $enter_time . ' ' . $select_time_format . '</span>';
echo '</li>';
}
}
}
add_action('print_custom_course_duration_acf_data', 'show_custom_details_in_course_sidebar');
@madhvendras84
Copy link
Author

madhvendras84 commented Apr 24, 2024

after adding this in code snippet:

1- Goto /theme-editor.php?file=inc%2Fld-init.php&theme=edubin (theme/edubin/inc/ld-init.php)
2- added a custom hook at line 266.

Screenshot 2024-04-24 at 11 30 56 AM

3- save. (Dont update theme. else hook will be lost).

4- make sure ACF has fields groups for course duration.

thats all !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment