Skip to content
wiki.fftac.org

Template Tags - Source Excerpt 03

Back to Template Tags

Summary

This source excerpt preserves a bounded section of Anti-Christ.org/wp-content/themes/antichrist-engine/inc/template-tags.php so readers can inspect the evidence without opening the full source file.

**Source path:** Anti-Christ.org/wp-content/themes/antichrist-engine/inc/template-tags.php

if (!$routes && function_exists('antichrist_engine_foundation_publication_empty_state_routes')) {
        $routes = antichrist_engine_foundation_publication_empty_state_routes();
    }

    if (!$routes) {
        return;
    }

    echo '<div class="publication-empty-route-grid">';

    foreach ($routes as $route) {
        $url = function_exists('antichrist_engine_foundation_build_target_url')
            ? antichrist_engine_foundation_build_target_url(
                (string) ($route['target'] ?? ''),
                (array) ($route['args'] ?? array()),
                (string) ($route['anchor'] ?? '')
            )
            : home_url('/');

        echo '<article class="statement-card publication-empty-route-card">';
        echo '<p class="eyebrow">' . esc_html((string) ($route['eyebrow'] ?? __('Route', 'antichrist-engine'))) . '</p>';
        echo '<h3>' . esc_html((string) ($route['title'] ?? '')) . '</h3>';
        echo '<p>' . esc_html((string) ($route['summary'] ?? '')) . '</p>';
        echo '<a class="text-link" href="' . esc_url($url) . '">' . esc_html((string) ($route['cta'] ?? __('Open route', 'antichrist-engine'))) . '</a>';
        echo '</article>';
    }

    echo '</div>';
}

/**
 * Renders an intentional empty state for archive surfaces before first publication.
 *
 * @param string $context Archive context.
 * @return void
 */
function antichrist_engine_publication_empty_state($context = 'archive')
{
    $title = __('The archive is being staged on purpose', 'antichrist-engine');
    $summary = __('No public journal file has been promoted yet. Start with the moral frame, the research atlas, the Signals briefing layer, or the participation path while the first release cycle is prepared.', 'antichrist-engine');

    if ('home' === $context) {
        $title = __('No public transmissions have been promoted yet', 'antichrist-engine');
        $summary = __('The Journal is not empty by accident. The first files are being sequenced around philosophy, evidence, Signals, and contributor intake before they enter the public archive.', 'antichrist-engine');
    } elseif ('search' === $context) {
        $title = __('No indexed result has landed here yet', 'antichrist-engine');
        $summary = __('The broader archive may not have the phrase you searched for yet. Use the core lanes below to reach the live structure around the publication queue.', 'antichrist-engine');
    }

    echo '<article class="card foundation-panel publication-empty-state">';
    echo '<p class="eyebrow">' . esc_html__('Archive In Formation', 'antichrist-engine') . '</p>';
    echo '<h2>' . esc_html($title) . '</h2>';
    echo '<p>' . esc_html($summary) . '</p>';
    antichrist_engine_render_publication_empty_routes();
    echo '</article>';
}

/**
 * Displays a decorative archive title.
 *
 * @return void
 */
function antichrist_engine_archive_intro()
{
    if (is_home() && !is_front_page()) {
        $posts_page_id = (int) get_option('page_for_posts');
        $archive_title = $posts_page_id ? get_the_title($posts_page_id) : __('Journal', 'antichrist-engine');
        $has_publications = function_exists('antichrist_engine_foundation_get_publication_count')
            ? antichrist_engine_foundation_get_publication_count() > 0
            : true;

        echo '<header class="section-heading">';
        echo '<p class="eyebrow">' . esc_html($has_publications ? __('Latest Transmission', 'antichrist-engine') : __('Archive In Formation', 'antichrist-engine')) . '</p>';
        echo '<h1>' . esc_html($archive_title) . '</h1>';
        if (!$has_publications) {
            echo '<p>' . esc_html__('The publication shell is ready, but the first public files are being sequenced through philosophy, research, Signals, and contributor intake before promotion.', 'antichrist-engine') . '</p>';
        }
        echo '</header>';
        return;
    }

    if (is_archive()) {
        $has_publications = function_exists('antichrist_engine_foundation_get_publication_count')
            ? antichrist_engine_foundation_get_publication_count() > 0
            : true;

        echo '<header class="section-heading">';
        the_archive_title('<p class="eyebrow">' . esc_html($has_publications ? __('Archive', 'antichrist-engine') : __('Archive In Formation', 'antichrist-engine')) . '</p><h1>', '</h1>');
        the_archive_description('<div class="archive-description">', '</div>');
        if (!$has_publications) {
            echo '<p>' . esc_html__('No public files have been promoted into this archive view yet. The route cards below keep the surface useful while the first release cycle is staged.', 'antichrist-engine') . '</p>';
        }
        echo '</header>';
        return;
    }

    if (is_search()) {
        echo '<header class="section-heading">';
        echo '<p class="eyebrow">' . esc_html__('Search Results', 'antichrist-engine') . '</p>';
        echo '<h1>' . sprintf(
            /* translators: %s is the search query. */
            esc_html__('Results for "%s"', 'antichrist-engine'),
            esc_html(get_search_query())
        ) . '</h1>';
        echo '</header>';
    }
}