<?php

$layouts = rt_get_option('frontpage_layout', ['post-archive']);

if (is_array($layouts) && $layouts) {

    foreach ($layouts as $key => $layout) {
        $args = array();
        $wraper_id = str_replace('-', '_', $layout);

        if (in_array($layout, ['trip-1', 'trip-2', 'trip-3'])) {
            $args['index'] = str_replace('trip-', '', $layout);
            rt_get_template_part("front-page/trip", $args);
        } else {
            rt_get_template_part("front-page/{$layout}");
        }
    }
}

?>