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 6087195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:50:35+00:00 2026-05-23T11:50:35+00:00

Right now, I have something like this: <?php if ( ! is_front_page() ) :

  • 0

Right now, I have something like this:

<?php if ( ! is_front_page() ) : ?>
    <?php if ( $count >= 1 ) : ?>
        <?php if ( $count == 1 ) : ?>
            <h2 class="dark-title"><?php _e( 'Top Reply (Latest)' ); ?></h2>
        <?php else : ?>
            <h2 class="dark-title"><?php _e( 'Top Replies (Latest)' ); ?></h2>
        <?php endif; ?>
    <?php endif; ?>
<?php endif; ?>

There are 3 nested if-statements I would like to know if this is a bad practice. If it is, how can I clean this code?

  • 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-23T11:50:36+00:00Added an answer on May 23, 2026 at 11:50 am

    It is if the conditions are very simple and their are no else cases.

    Also, opening useless <?php processing instructions and using the uncommon endif form instead of braces are definitely not encouraged. Instead, write:

    <?php
    if (!is_front_page() && ($count >= 1)) {
        echo '<h2 class="dark-title">';
        echo _e(($count==1) ? 'Top Reply (Latest)' : 'Top Replies (Latest)');
        echo '</h2>';
    }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Right now I have something like this in NHibernate: Expression.Like(property, value, MatchMode.Anywhere) and that
So what I have right now is something like this: PropertyInfo[] info = obj.GetType().GetProperties(BindingFlags.Public);
Right now, I have code that looks something like this: Private Sub ShowReport(ByVal reportName
Right now I'm doing something like this: RewriteRule ^/?logout(/)?$ logout.php RewriteRule ^/?config(/)?$ config.php I
I am new to php and wondering if I can have something like this:
Right now my code looks like this: <script type=text/javascript> $(document).ready(function() { $.ajaxSetup({ cache: false
In a PHP project I am working on right now, I have some code
I wonder why something like this wouldn't work (actually doesn't work): 4.php : <php
Good day! I right now have a function the drags an element from a
Right now I have a database (about 2-3 GB) in PostgreSQL, which serves as

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.