Title: Hide section title without posts
Last modified: April 21, 2022

---

# Hide section title without posts

 *  Resolved [rajikdeymon](https://wordpress.org/support/users/rajikdeymon/)
 * (@rajikdeymon)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/hide-bpress-single-section-without-posts/)
 * Hi,
 * I wonder why the section title is shown when there is no post but only sub sections.
 * Depending on the used theme, this can be ugly. So here is a tip to remove the
   section title element if it hasn’t any posts:
 * – Open “**wp-content\plugins\basepress\themes\[THEME]\template-parts\single-section-
   content.php**” from your used theme.
 * – Search for the first **<div>** after the line “**foreach ( $bpkb_sections as
   $bpkb_section )**” and append some php code to the div class name.
 * The class name is depending on your theme.
    f.ex. for the modern theme:
 * CHANGE:
    `<div class="bpress-single-section">`
 * TO:
    `<div class="bpress-single-section<?php if(empty($bpkb_section->posts)) {
   echo " bpress-headline-only"; } ?>">`
 * – then you can add the following custom css to the custom css section in the 
   theme settings:
 *     ```
       .bpress-headline-only {
         display: none;
       }
       ```
   

Viewing 1 replies (of 1 total)

 *  Plugin Author [BasePress](https://wordpress.org/support/users/codesavory/)
 * (@codesavory)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/hide-bpress-single-section-without-posts/#post-15581106)
 * Thanks for this tip. I am sure this would help others.
 * If you loved our plugin, please consider adding a review for this plugin.

Viewing 1 replies (of 1 total)

The topic ‘Hide section title without posts’ is closed to new replies.

 * ![](https://ps.w.org/basepress/assets/icon-256x256.gif?rev=2817400)
 * [Knowledge Base documentation & wiki plugin - BasePress Docs](https://wordpress.org/plugins/basepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/basepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/basepress/)
 * [Active Topics](https://wordpress.org/support/plugin/basepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/basepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/basepress/reviews/)

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [remove](https://wordpress.org/support/topic-tag/remove/)
 * [section title](https://wordpress.org/support/topic-tag/section-title/)

 * 1 reply
 * 2 participants
 * Last reply from: [BasePress](https://wordpress.org/support/users/codesavory/)
 * Last activity: [4 years, 1 month ago](https://wordpress.org/support/topic/hide-bpress-single-section-without-posts/#post-15581106)
 * Status: resolved