Created
April 24, 2024 05:57
-
-
Save madhvendras84/047d03b1a8226d5eddb28af26666292e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
3- save. (Dont update theme. else hook will be lost).
4- make sure ACF has fields groups for course duration.
thats all !!