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

Forumax – AI Powered Advanced Community Forum Plugin, version 2.4.3. 89 lines.

- Page: https://pluginprobe.com/plugins/bbp-core/2.4.3/code/templates/content-single-topic.php
- Raw: https://pluginprobe.com/plugins/bbp-core/2.4.3/raw/templates/content-single-topic.php
- Modified: 2026-06-10T13:02:40+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.4.3/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');
$main_col_class = $has_sidebar ? 'frmx-col-lg-8' : 'frmx-col-lg-12';
?>
<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="<?php echo esc_attr($main_col_class); ?> 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">
                                <div class="frmx-header-left">
                                    <h5 class="replies-title">
                                        <svg class="frmx-reply-count-icon" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>
                                        <?php
                                        $reply_count = bbp_get_topic_reply_count( bbp_get_topic_id() );
                                        printf(
                                            /* translators: %s: number of replies */
                                            esc_html( _n( '%s Reply', '%s Replies', $reply_count, 'forumax' ) ),
                                            esc_html( number_format_i18n( $reply_count ) )
                                        );
                                        ?>
                                    </h5>
                                </div>

                                <div class="frmx-header-right">
                                    <div class="replies-sorting">
                                        <select name="sort-replies" id="sort-replies" class="replies-sort-select">
                                            <option selected disabled><?php esc_html_e( 'Sort By', 'forumax' ); ?></option>
                                            <option value="desc"><?php esc_html_e( 'Newest First', 'forumax' ); ?></option>
                                            <option value="asc"><?php esc_html_e( 'Oldest First', 'forumax' ); ?></option>
                                            <option value="vote"><?php esc_html_e( 'Highest Votes First', 'forumax' ); ?></option>
                                        </select>
                                    </div>
                                </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>
```
