skip to Main Content

I have the following site: https://www.daenischer-kerzenshop.de/
If i look at the source code via the browser, I can detect empty tags.

Does anyone happen to know why they are generated and how I can remove them?
I have searched all possible files and removed all code that could possibly cause this.Unfortunately I could not find a usable plugin either.

Here is an example (Browser-> View source code-> line: 1465 ):

<div class="container section-title-container">
  <h1 class="section-title section-title-center">
    <b></b>
    <span class="section-title-main">Qualitätsmerkmale der Dänischen Kerzen</span>
    <b></b>
  </h1>
</div>

The site uses the theme Flatsome.

Any help would be greatly appreciated!

4

Answers


  1. If you still have Gutenberg editor this works.
    Click all pages – > find your page and click Gutenberg editor -> top-right side click three dots -> Code Editor.

    Login or Signup to reply.
  2. the "b" tag created by your Theme developer. it has some styles in your theme.
    he/she styled the "section-title b" tag for making the title centered. either it is not a standard way to make a title text centered. you can try this way:

    put this code into your css file and see the result with clearing your cache by ctrl + F5:

    .section-title b {
      display: none;
    }
    .section-title.section-title-center {
      justify-content: center;
    }
    
    Login or Signup to reply.
  3. Those tags actually are being used by the theme author for styling purposes, so you can’t remove or hide them without modifiyng the look of the page. Notice that they have the following styles assigned:

    .section-title b {
        display: block;
        -webkit-box-flex: 1;
        -ms-flex: 1;
        flex: 1;
        height: 2px;
        opacity: .1;
        background-color: currentColor;
    }
    

    They represent the thin lines at both sides of the titles.

    So, even they are empty, they represent a visual element in your page style.

    Login or Signup to reply.
  4. Using str_replace() Method

    This is the simplest and the easiest method to exclude any unused tags or text. Just add the below code and see the magic.

    $foo = '
    <div class="container section-title-container">
      <h1 class="section-title section-title-center">
        <b></b>
        <span class="section-title-main">Qualitätsmerkmale der Dänischen Kerzen</span>
        <b></b>
      </h1>
    </div>';
    
    $bar = str_replace('<b></b>', '', $foo); // Magic mathod
    echo $bar;
    

    The Code After Cleaning Unused Tags

    <div class="container section-title-container">
      <h1 class="section-title section-title-center">  
        <span class="section-title-main">Qualitätsmerkmale der Dänischen Kerzen</span>   
      </h1>
    </div>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search