// 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.

FAITH & SPRITUAL GROWTH

Growing in Faith, Hope, and God’s Love

At The Yahweh Mission, we believe transformation begins in the heart. Through prayer, guidance, and compassionate service, we help children and families experience God’s love. We care for both physical and spiritual needs, planting seeds of hope through every act of kindness.

Faith That Moves Through Action

God’s love is not meant to remain only in words. It is meant to be seen through compassion, service, and care. At The Yahweh Mission, our faith inspires us to stand beside vulnerable children and families with love, dignity, and support.

Through our mission work, we bring together spiritual care and humanitarian action. We pray with families, encourage children, teach biblical values, and support communities through education, food, healthcare, shelter, and practical assistance.

“Let us not love with words or speech but with actions and in truth.”
                                                                                                                         – 1 John 3:18

Helping Children Grow in God’s Love

Every child deserves to know that they are loved, valued, and created with purpose. Many children in poverty face fear, uncertainty, and limited opportunities. Through faith-based care, we help children discover hope beyond their circumstances.

Our spiritual growth programs encourage children to:

Become a Prayer Partner

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 Faith & Spiritual Growth Programmes & how you can make a difference.

It is our way of helping children and families grow in prayer, hope, biblical values, and God’s love.

Children, families, volunteers, sponsors, donors, and anyone who wants to grow in faith or support the mission.

Through prayer, Bible lessons, Sunday School, worship, encouragement, and guidance.

Yes. You can send your prayer request, and our team will pray with care and faith.

You can pray, donate, sponsor a child, volunteer, or share our mission.

F.A.Q

Everything You Need To Know About Our Faith & Spiritual Growth Programmes