• I recently updated a site of mine to WP5 (5.2.1 specifically) and wanted to add a page that lists all the posts with the featured image thumbnail next to it. I’ve done this on other sites, so I took the code from one site and tried to add it to a WP5 code block, but when I preview or post the page, the editor jumbles all the code, so that:

    <table style="width:100%; text-align: left;">
    [loop type="post" count="100"]
    <tr>
      <td style="width: 150px; height: 150px;">[field thumbnail]</td>
      <td style="font-size: 150%; padding-left: 10px;">[field link]</td>
    </tr>
    <tr>
      <td colspan="2"><hr></td>
    </tr>
    [/loop]
    </table>

    becomes:

    [loop type="post" count="100"]
    
    [/loop]
    <table style="width:100%; text-align: left;">
    <tbody>
    <tr>
    <td style="width: 150px; height: 150px;">[field thumbnail]</td>
    <td style="font-size: 150%; padding-left: 10px;">[field link]</td>
    </tr>
    <tr>
    <td colspan="2&quot;">
    
    <hr>
    
    </td>
    </tr>
    </tbody>
    </table>

    In fact, even if I open that page on the original site and switch to the code editor, it does that same thing, so there’s no way to see what the original code was without looking at the revisions.

    Obviously I can switch back to the Classic Editor, and I will probably ly do that, but has anyone come up with a solution to this problem?

    • This topic was modified 5 years, 5 months ago by philipt18.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Gutenberg editor destroying CCS code’ is closed to new replies.