Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6069229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:48:00+00:00 2026-05-23T09:48:00+00:00

I want the if statement below to appear only on certain pages (for instance,

  • 0

I want the if statement below to appear only on certain pages (for instance, I don’t want them to surround the whole structure if this is an user page):

    <div class="mainbar">

    <?php if /* I don't want this and... */ ( bbp_has_topics( $bbp_loop_args ) ) : ?>

        <?php while ( bbp_topics() ) : bbp_the_topic(); ?>

            <div class="topic-wrapper">
                <div class="topic-left">
                    <h2><a href="<?php bbp_topic_permalink(); ?>" title="<?php bbp_topic_title(); ?>"><?php bbp_topic_title(); ?></a></h2>
                    <span><?php printf( __( 'Started by: %1$s', 'bbpress' ), bbp_get_topic_author_link( array( 'size' => '14' ) ) ); ?></span>

                    <?php if ( !bbp_is_forum() || ( bbp_get_topic_forum_id() != bbp_get_forum_id() ) ) : ?>
                        <span class="bbp-topic-started-in"><?php printf( __( 'in: <a href="%1$s">%2$s</a>', 'bbpress' ), bbp_get_forum_permalink( bbp_get_topic_forum_id() ), bbp_get_forum_title( bbp_get_topic_forum_id() ) ); ?></span>
                    <?php endif; ?>

                    <?php bbp_topic_tag_list(); ?>

                </div><!-- #topic-left -->

                <div class="topic-right">
                    <div class="topic-like-count">
                        <h4><?php // bbp_topic_reply_count(); ?><?php if(function_exists('the_ratings')) { the_ratings(); } ?></h4>
                        <span><?php _e( 'likes' ); ?></span>
                    </div>

                    <div class="topic-reply-count">
                        <h4><?php bbp_topic_reply_count(); ?></h4>
                        <span><?php _e( 'replies' ); ?></span>
                    </div>

                    <div class="topic-freshness">
                        <h4><?php bbp_topic_freshness_link(); ?></h4>
                            <span>
                                <?php bbp_author_link( array( 'post_id' => bbp_get_topic_last_active_id(), 'size' => 14 ) ); ?>
                            </span>
                    </div>
                </div><!-- #topic-right -->
            </div><!-- #topic -->

        <?php /* this to appear in an user page */ endwhile; ?>

    <?php endif; ?>

        </div><!-- #mainbar -->

This is the if statement I should use to make sure that the if statement above don’t surround the whole structure in an user page:

<?php if ( ! is_single( 'user' ) ) : ?>

<?php endif; ?>

But I have no idea how or where to place it.

Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:48:00+00:00Added an answer on May 23, 2026 at 9:48 am

    If I understand you correctly, you can simply replace:

    if ( bbp_has_topics( $bbp_loop_args ) ) :
    

    by:

    if ( is_single( 'user' ) || bbp_has_topics( $bbp_loop_args ) ) :
    

    This way, the second condition is applied only if the first condition is false.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this query statement and want to only get records that has a
I want to use a case statement in my user-defined functions because I need
I have a table that was created using this mysql statement below. CREATE TABLE
I want to add a css class statement like below: <%: Html.TextBoxFor(model => model.Comments,
I want to use prepared statement to insert and update data in mysqli, Below
i just want to implement below statement if bin folder is not available in
I want to implement the solution using the pre-processor described here: Reuse define statement
I have a long running SQL statement that I want to run, and no
When I'm using an If statement and I want to check if a boolean
I am working on an If statement and I want to satisfy two conditions

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.