Skip to content
wiki.fftac.org

Template Members Area

**Site relevance:** Anti-Christ.org

**Memory type:** theme source memory

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

**Size:** 5.2 KB

Summary

Template Name: Members Area

Source Preview

This source file is short enough to preview directly on its source-memory page.

<?php
/**
 * Template Name: Members Area
 * Template Post Type: page
 *
 * @package Antichrist_Engine
 */

get_header();

the_post();

$current_user       = wp_get_current_user();
$notice             = antichrist_engine_membership_get_notice();
$members_raw_content = trim((string) get_post_field('post_content', get_the_ID()));
$recent_posts_query = new WP_Query(array(
    'post_type'      => 'post',
    'post_status'    => 'publish',
    'posts_per_page' => 3,
));
?>
<section class="hero hero--portal">
    <div class="container hero__grid hero__grid--portal">
        <div class="hero__content">
            <p class="eyebrow"><?php esc_html_e('Protected Access', 'antichrist-engine'); ?></p>
            <h1><?php the_title(); ?></h1>
            <p class="hero__lead"><?php esc_html_e('This space is reserved for signed-in members. Use it for private essays, downloads, announcements, archives, or any gated content you want to keep behind the front-end login.', 'antichrist-engine'); ?></p>
            <div class="hero__actions">
                <a class="button" href="<?php echo esc_url(antichrist_engine_membership_get_page_url('portal')); ?>"><?php esc_html_e('Account Dashboard', 'antichrist-engine'); ?></a>
                <a class="button button--ghost" href="<?php echo esc_url(antichrist_engine_membership_get_logout_url()); ?>"><?php esc_html_e('Log Out', 'antichrist-engine'); ?></a>
            </div>
        </div>
        <div class="hero__visual card membership-summary-card">
            <div class="membership-summary-card__avatar">
                <?php echo get_avatar($current_user->ID, 96); ?>
            </div>
            <p class="eyebrow"><?php esc_html_e('Signed In As', 'antichrist-engine'); ?></p>
            <h2><?php echo esc_html($current_user->display_name); ?></h2>
            <p><?php echo esc_html($current_user->user_email); ?></p>
        </div>
    </div>
</section>

<section class="section section--narrow">
    <div class="container membership-layout">
        <div class="membership-layout__main">
            <?php if ($notice) : ?>
                <div class="membership-notice membership-notice--<?php echo esc_attr($notice['status']); ?>" role="<?php echo esc_attr('error' === $notice['status'] ? 'alert' : 'status'); ?>">
                    <?php foreach ($notice['messages'] as $message) : ?>
                        <p><?php echo esc_html($message); ?></p>
                    <?php endforeach; ?>
                </div>
            <?php endif; ?>

            <article id="post-<?php the_ID(); ?>" <?php post_class('page-article card membership-panel'); ?>>
                <header class="entry-header">
                    <p class="eyebrow"><?php esc_html_e('Member Content', 'antichrist-engine'); ?></p>
                    <h2 class="entry-title"><?php the_title(); ?></h2>
                </header>
                <div class="entry-content">
                    <?php
                    if ($members_raw_content) {
                        echo apply_filters('the_content', $members_raw_content); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
                    } else {
                        echo '<p>' . esc_html__('Edit this page in WordPress to add the private content you want members to see after logging in.', 'antichrist-engine') . '</p>';
                    }
                    ?>
                </div>
            </article>
        </div>

        <aside class="membership-layout__aside">
            <article class="card membership-panel membership-panel--compact">
                <p class="eyebrow"><?php esc_html_e('Quick Links', 'antichrist-engine'); ?></p>
                <ul class="membership-links">
                    <li><a href="<?php echo esc_url(antichrist_engine_membership_get_page_url('portal')); ?>"><?php esc_html_e('Update profile', 'antichrist-engine'); ?></a></li>
                    <li><a href="<?php echo esc_url(home_url('/')); ?>"><?php esc_html_e('Return to homepage', 'antichrist-engine'); ?></a></li>
                    <li><a href="<?php echo esc_url(antichrist_engine_membership_get_logout_url()); ?>"><?php esc_html_e('Sign out', 'antichrist-engine'); ?></a></li>
                </ul>
            </article>

            <article class="card membership-panel membership-panel--compact">
                <p class="eyebrow"><?php esc_html_e('Latest Public Posts', 'antichrist-engine'); ?></p>
                <?php if ($recent_posts_query->have_posts()) : ?>
                    <ul class="membership-links">
                        <?php while ($recent_posts_query->have_posts()) : ?>
                            <?php $recent_posts_query->the_post(); ?>
                            <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
                        <?php endwhile; ?>
                    </ul>
                <?php else : ?>
                    <p><?php esc_html_e('Publish a few posts and they will appear here automatically.', 'antichrist-engine'); ?></p>
                <?php endif; ?>
                <?php wp_reset_postdata(); ?>
            </article>
        </aside>
    </div>
</section>
<?php
get_footer();