# bbp-core/2.2.0/templates/content-single-topic.php

Forumax – AI Powered Advanced Community Forum Plugin, version 2.2.0. 76 lines.

- Page: https://pluginprobe.com/plugins/bbp-core/2.2.0/code/templates/content-single-topic.php
- Raw: https://pluginprobe.com/plugins/bbp-core/2.2.0/raw/templates/content-single-topic.php
- Modified: 2026-02-21T10:57:36+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/bbp-core/2.2.0/code/templates/content-single-topic.php#L10-L20`.

```php
<?php
/**
 * Single Topic Content Part
 *
 * @package bbPress
 * @subpackage Theme
 */

// Exit if accessed directly
defined('ABSPATH') || exit;

$has_sidebar = is_active_sidebar('forum_archive_sidebar');
?>
<section <?php bbp_topic_class(get_the_ID(), array('forum-single-content')); ?>>
    <div class="forum-layout">

        <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($has_sidebar ? '8' : '12'); ?> forum-main-column">

                <?php
                if (post_password_required()):
                    bbp_get_template_part('form', 'protected');
                else:
                    bbp_get_template_part('content', 'single-topic-lead');
                    ?>

                    <?php if (bbp_has_replies()): ?>

                        <div id="topic-<?php bbp_topic_id(); ?>-replies" class="all-answers">

                            <div class="all-replies-header frmx-all-replies-header">
                                <h5 class="replies-title">
                                    <?php esc_html_e('All Replies', 'forumax'); ?>
                                </h5>

                                <div class="replies-sorting">
                                    <select name="sort-replies" id="sort-replies" class="replies-sort-select">
                                        <option selected disabled>Sort By</option>
                                        <option value="desc">Newest First</option>
                                        <option value="asc">Oldest First</option>
                                        <option value="vote">Highest Votes First</option>
                                    </select>
                                </div>
                            </div>

                            <div class="reply-result">
                                <?php bbp_get_template_part('loop', 'replies'); ?>
                            </div>

                            <?php bbp_get_template_part('pagination', 'replies'); ?>

                        </div>

                    <?php endif; ?>

                    <?php bbp_get_template_part('form', 'reply'); ?>

                    <?php bbp_get_template_part('alert', 'topic-lock'); ?>

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

                <?php endif; ?>

            </div>
            <!-- /.forum-main-column -->

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