function scholarship_details_shortcode() { if ( ! is_single() ) return ''; $post_id = get_the_ID(); $enable_scholarship = get_post_meta( $post_id, 'enable_scholarship', true ); if ( $enable_scholarship !== 'on' ) return ''; // Retrieve all fields $fields = [ 'host_country' => get_post_meta( $post_id, 'host_country', true ), 'eligible_students' => get_post_meta( $post_id, 'eligible_students', true ), 'deadline' => get_post_meta( $post_id, 'deadline', true ), 'host_university' => get_post_meta( $post_id, 'host_university', true ), 'funding_type' => get_post_meta( $post_id, 'funding_type', true ), 'study_level' => get_post_meta( $post_id, 'study_level', true ), 'apply_url' => get_post_meta( $post_id, 'apply_url', true ), ]; // Define icon mappings (Font Awesome classes) $icon_map = [ 'host_country' => 'fa-globe-americas', 'eligible_students' => 'fa-user-graduate', 'deadline' => 'fa-calendar-alt', 'host_university' => 'fa-university', 'funding_type' => 'fa-hand-holding-usd', 'study_level' => 'fa-book-open', ]; // Labels for display $label_map = [ 'host_country' => 'Host Country', 'eligible_students' => 'Eligible Students', 'deadline' => 'Deadline', 'host_university' => 'Host University', 'funding_type' => 'Funding Type', 'study_level' => 'Study Level', ]; // Build the HTML $html = '
'; // Header $html .= '
'; $html .= ''; $html .= '

Scholarship Details

'; $html .= '
'; // Body $html .= '
'; // Two‑column grid $html .= '
'; // Split fields into left and right columns (4 on left, 2 on right) $left_keys = [ 'host_country', 'eligible_students', 'deadline', 'host_university' ]; $right_keys = [ 'funding_type', 'study_level' ]; // Function to render a column $render_column = function( $keys ) use ( $fields, $icon_map, $label_map ) { $output = ''; foreach ( $keys as $key ) { $value = $fields[ $key ]; if ( empty( $value ) ) continue; $icon = $icon_map[ $key ]; $label = $label_map[ $key ]; $output .= '
'; $output .= ''; $output .= '' . esc_html( $label ) . ''; $output .= '' . esc_html( $value ) . ''; $output .= '
'; } return $output; }; // Left column $html .= '
' . $render_column( $left_keys ) . '
'; // Right column $html .= '
' . $render_column( $right_keys ) . '
'; $html .= '
'; // end grid // Apply Now button (if URL exists) if ( ! empty( $fields['apply_url'] ) ) { $html .= '
'; $html .= ''; $html .= ' Apply Now'; $html .= ''; $html .= '
'; } $html .= '
'; // end body padding $html .= '
'; // end card // Responsive CSS $html .= ''; return $html; } add_shortcode( 'scholarship_details', 'scholarship_details_shortcode' ); Fellowships - Browse Scholarships – Global Scholarships Platform

Nothing Found

It seems we can’t find what you’re looking for. Perhaps searching can help.