<?php
function theme_404_content($args = '') {
    $args = wp_parse_args($args, array(
            'error_title' => __('Not Found', THEME_NS),
            'error_message' => __('Apologies, but the page you requested could not be found. Perhaps searching will help.', THEME_NS)
        )
    );
    extract($args);
    echo '<div class="@classNames">';
    echo '<h4>' . $error_title . '</h4>';
    echo '<p class="center">' . $error_message . '</p>';

    if (theme_get_option('theme_show_random_posts_on_404_page')) {
        theme_ob_start();
        echo '<h4 class="box-title">' . theme_get_option('theme_show_random_posts_title_on_404_page') . '</h4>';
        ?>
        <ul>
            <?php
            global $post;
            $rand_posts = get_posts('numberposts=5&orderby=rand');
            foreach ($rand_posts as $post) :
                ?>
                <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
            <?php endforeach; ?>
        </ul>
        <?php
        echo theme_ob_get_clean();
    }
    if (theme_get_option('theme_show_tags_on_404_page')) {
        theme_ob_start();
        echo '<h4 class="box-title">' . theme_get_option('theme_show_tags_title_on_404_page') . '</h4>';
        wp_tag_cloud('smallest=9&largest=22&unit=pt&number=200&format=flat&orderby=name&order=ASC');
        echo theme_ob_get_clean();
    }
    echo '</div>';
}
?>