<?php
/**
 * Hello Elementor Forum Archive Template
 *
 * @package Forumax
 */

defined( 'ABSPATH' ) || exit;

get_header();
?>

<?php
$has_sidebar = is_active_sidebar( 'forum_archive_sidebar' );
$main_column = $has_sidebar ? '8' : '12';
?>

<main id="frmx-forum-archive" class="frmx-forum-archive">
	<div class="frmx-container">

		<?php do_action( 'bbp_before_main_content' ); ?>

		<?php do_action( 'bbp_template_notices' ); ?>

		<div id="forum-front" class="bbp-forum-front">
			<h1 class="entry-title"><?php bbp_forum_archive_title(); ?></h1>
			<div class="entry-content">
				<div class="frmx-row frmx-sidebar-<?php echo esc_attr( forumax_get_opt( 'sidebar_position', 'right' ) ); ?>">
					<div class="frmx-col-lg-<?php echo esc_attr( $main_column ); ?>">

						<?php bbp_forum_subscription_link(); ?>

						<?php do_action( 'bbp_template_before_forums_index' ); ?>

						<?php if ( bbp_has_forums() ) : ?>
							<?php require FORUMAX_PATH . 'templates/loop-forums.php'; ?>
						<?php else : ?>
							<?php require FORUMAX_PATH . 'templates/feedback-no-forums.php'; ?>
						<?php endif; ?>

						<?php do_action( 'bbp_template_after_forums_index' ); ?>
					</div>

					<?php if ( $has_sidebar ) : ?>
						<div class="frmx-col-lg-4">
							<aside class="forum-sidebar">
								<?php dynamic_sidebar( 'forum_archive_sidebar' ); ?>
							</aside>
						</div>
					<?php endif; ?>
				</div>
			</div>
		</div><!-- #forum-front -->

		<?php do_action( 'bbp_after_main_content' ); ?>

	</div>
</main>

<?php get_footer(); ?>
