// Yahweh Mission Dashboard Integration — WPCode snippet version // Paste this into a new PHP Snippet in WPCode, set to run "Auto Insert" / // "Everywhere", and activate it. Functionally identical to the plugin // version — just packaged as a snippet since this host strips .php files // out of uploaded plugin zips. if (!function_exists('ymi_get_api_url')) { function ymi_get_api_url() { return rtrim(get_option('ymi_dashboard_api_url', ''), '/'); } } // ---- Settings page: Settings -> Yahweh Mission ---- add_action('admin_menu', function () { add_options_page('Yahweh Mission Dashboard', 'Yahweh Mission', 'manage_options', 'yahweh-mission', 'ymi_render_settings_page'); }); add_action('admin_init', function () { register_setting('ymi_settings', 'ymi_dashboard_api_url', array( 'sanitize_callback' => 'esc_url_raw', 'default' => '', )); }); function ymi_render_settings_page() { if (!current_user_can('manage_options')) { return; } $api_url = get_option('ymi_dashboard_api_url', ''); ?>

Yahweh Mission Dashboard

Connects this site to the Yahweh Mission Dashboard so published children, gifts, and projects appear here automatically via the [ymi_children], [ymi_gift_catalog], and [ymi_child_profile] shortcodes.

The base URL where the Yahweh Mission Dashboard is deployed — no trailing slash.

Connection check

8)); if (is_wp_error($response)) { echo '

Could not reach the dashboard: ' . esc_html($response->get_error_message()) . '

'; } elseif (wp_remote_retrieve_response_code($response) === 200) { echo '

Connected — the dashboard responded successfully.

'; } else { echo '

Dashboard responded with HTTP ' . esc_html(wp_remote_retrieve_response_code($response)) . '.

'; } ?>
.ymi-children-grid,.ymi-gift-grid{--ymi-navy:#0b1e3d;--ymi-blue:#2454d9;--ymi-blue-soft:#e4ecfc;--ymi-sea:#1fa6c9;--ymi-grey:#64748b;--ymi-line:#dde3ea;display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:20px;margin:24px 0;} .ymi-child-card{display:flex;flex-direction:column;background:#fff;border:1px solid var(--ymi-line);border-radius:10px;overflow:hidden;text-decoration:none;color:inherit;transition:box-shadow .15s ease;} .ymi-child-card:hover{box-shadow:0 4px 16px rgba(11,30,61,.1);} .ymi-child-card__photo{aspect-ratio:1/1;background:var(--ymi-blue-soft);display:flex;align-items:center;justify-content:center;overflow:hidden;} .ymi-child-card__photo img{width:100%;height:100%;object-fit:cover;} .ymi-child-card__initial{font-size:2.5rem;font-weight:600;color:var(--ymi-blue);} .ymi-child-card__body{padding:14px 16px;} .ymi-child-card__name{margin:0 0 4px;font-size:1.05rem;color:var(--ymi-navy);} .ymi-child-card__meta{margin:0 0 8px;font-size:.85rem;color:var(--ymi-grey);} .ymi-child-card__bio{margin:0;font-size:.85rem;color:var(--ymi-navy);opacity:.8;} .ymi-child-profile{--ymi-navy:#0b1e3d;--ymi-blue:#2454d9;--ymi-blue-soft:#e4ecfc;--ymi-grey:#64748b;display:grid;grid-template-columns:minmax(220px,280px) 1fr;gap:32px;margin:24px 0;} .ymi-child-profile__photo{aspect-ratio:1/1;background:var(--ymi-blue-soft);border-radius:10px;display:flex;align-items:center;justify-content:center;overflow:hidden;} .ymi-child-profile__photo img{width:100%;height:100%;object-fit:cover;} .ymi-child-profile__cta{margin-top:20px;} .ymi-gift-card{background:#fff;border:1px solid var(--ymi-line);border-radius:10px;padding:18px 20px;display:flex;flex-direction:column;} .ymi-gift-card__category{font-size:.72rem;text-transform:uppercase;letter-spacing:.05em;color:var(--ymi-sea);font-weight:700;} .ymi-gift-card__name{margin:6px 0 8px;color:var(--ymi-navy);} .ymi-gift-card__description{flex:1;font-size:.88rem;color:var(--ymi-grey);margin:0 0 16px;} .ymi-gift-card__footer{display:flex;align-items:center;justify-content:space-between;gap:12px;} .ymi-gift-card__price{font-weight:700;color:var(--ymi-navy);} .ymi-btn{display:inline-flex;align-items:center;justify-content:center;padding:8px 16px;border-radius:6px;background:var(--ymi-blue,#2454d9);color:#fff!important;text-decoration:none;font-weight:600;font-size:.9rem;} .ymi-btn--outline{background:transparent;border:1px solid var(--ymi-blue,#2454d9);color:var(--ymi-blue,#2454d9)!important;} .ymi-notice{background:#fdf6d8;border:1px solid #e8d98a;border-radius:6px;padding:10px 14px;font-size:.9rem;} .ymi-empty{color:#64748b;font-style:italic;} @media (max-width:640px){.ymi-child-profile{grid-template-columns:1fr;}} '; }); // ---- API client (cached) ---- if (!function_exists('ymi_api_get')) { function ymi_api_get($path, $cache_key, $ttl = 300) { $base = ymi_get_api_url(); if (empty($base)) { return new WP_Error('ymi_not_configured', 'The Yahweh Mission Dashboard URL has not been configured yet. Set it under Settings -> Yahweh Mission.'); } $cached = get_transient($cache_key); if ($cached !== false) { return $cached; } $response = wp_remote_get($base . $path, array('timeout' => 10)); if (is_wp_error($response)) { return $response; } if (wp_remote_retrieve_response_code($response) !== 200) { return new WP_Error('ymi_bad_response', 'The dashboard returned an unexpected response.'); } $data = json_decode(wp_remote_retrieve_body($response), true); if (!is_array($data)) { return new WP_Error('ymi_bad_json', 'The dashboard response could not be read.'); } set_transient($cache_key, $data, $ttl); return $data; } } if (!function_exists('ymi_not_configured_notice')) { function ymi_not_configured_notice() { if (current_user_can('manage_options')) { return '

The Yahweh Mission Dashboard is not connected yet. Configure it in Settings.

'; } return ''; } } if (!function_exists('ymi_error_notice')) { function ymi_error_notice($error) { if (current_user_can('manage_options')) { return '

Could not load content from the dashboard: ' . esc_html($error->get_error_message()) . '

'; } return ''; } } // ---- [ymi_children] ---- add_shortcode('ymi_children', function ($atts) { $atts = shortcode_atts(array('limit' => 0), $atts, 'ymi_children'); $children = ymi_api_get('/api/children?gender=either&country=all&minAge=1&maxAge=22', 'ymi_children_all'); if (is_wp_error($children)) { return $children->get_error_code() === 'ymi_not_configured' ? ymi_not_configured_notice() : ymi_error_notice($children); } if ((int) $atts['limit'] > 0) { $children = array_slice($children, 0, (int) $atts['limit']); } if (empty($children)) { return '

No children are currently available for sponsorship.

'; } ob_start(); ?>
<?php echo esc_attr($child['name']); ?>

yrs ·

''), $atts, 'ymi_child_profile'); $id = !empty($atts['id']) ? $atts['id'] : (isset($_GET['ymi_child']) ? sanitize_text_field(wp_unslash($_GET['ymi_child'])) : ''); if (empty($id)) { return '

No child specified.

'; } $api_url = ymi_get_api_url(); if (empty($api_url)) { return ymi_not_configured_notice(); } $cache_key = 'ymi_child_' . md5($id); $child = get_transient($cache_key); if ($child === false) { $response = wp_remote_get($api_url . '/api/children/' . rawurlencode($id), array('timeout' => 10)); if (is_wp_error($response)) { return ymi_error_notice($response); } if (wp_remote_retrieve_response_code($response) !== 200) { return '

This child profile is no longer available.

'; } $child = json_decode(wp_remote_retrieve_body($response), true); set_transient($cache_key, $child, 300); } if (!is_array($child)) { return '

This child profile is no longer available.

'; } ob_start(); ?>
<?php echo esc_attr($child['name']); ?>

yrs ·

Sponsor

already has a sponsor. Thank you!

get_error_code() === 'ymi_not_configured' ? ymi_not_configured_notice() : ymi_error_notice($gifts); } if (empty($gifts)) { return '

No gifts are available right now.

'; } $api_url = ymi_get_api_url(); ob_start(); ?>

Sponsor a Child

Content coming soon.

CHILDCARE & EDUCATION

Every Child Deserves to Thrive

We believe that every child deserves the opportunity to Learn, Grow and Thrive…..

At The Yahweh Mission, we believe that every child deserves a safe environment where they can learn, dream and build a brighter future. Unfortunately, many children from vulnerable families face barriers such as poverty, limited educational resources, poor nutrition and lack of family support, making it difficult to succeed in school.

Through our Childcare and Education programmes, we work alongside families and communities to give children the support they need during their most important years of development. By providing education, care, encouragement and essential resources, we help children reach their full potential while creating opportunities that can transform their future.

How We Support Children

Our Childcare and Education initiatives focus on the complete development of every child by providing:

Join a Child's Journey

Every child deserves the chance to learn and thrive. Your support can change a child’s life.

Together, we can build brighter futures—one child at a time.

More campaign
Child Sponsorship

Give a child hope by providing access to education, healthcare, nutrition, and ongoing support.

Healthcare Support

Help children and families receive essential medical care, health education, and wellness services.

Volunteer With Us

Make a difference by sharing your time, skills, and compassion with those who need it most.

Make a Difference Today

Join us in bringing hope, education, and care to children and families in need.

Clear your doubts about our Childcare & Education programmes & how you can make a difference.

Children and families facing financial hardship or limited access to education and essential care.

We offer education, childcare, nutrition, learning resources, and mentorship to help children thrive.

You can donate, volunteer, sponsor a child, or partner with us to make a lasting impact.

Yes. We welcome passionate volunteers who want to support children and strengthen communities.

Donations help provide educational resources, nutritious meals, childcare, and community support programmes

F.A.Q

Everything You Need To Know About Our Childcare & Education programmes