0

When I call the_content() i am getting

<div class="page" title="Page 1">
    <div class="section">
        <div class="layoutArea">
            <div class="column">
                <p>my text</p>
            </div>
        </div>
    </div>
</div>

I would expect just

<p>my text</p>

I am confused about that. I think I have never had all these wrappers returned. Moreover, I have not found a match for layoutArea in the whole wordpress install, nor in my bootsrtap starter theme.

Any ideas?

-- UPDATE: just saw that all those divs were automatically generated by the editor. I was able to remove them via the tinymce text view tab. Still confused, anyway.

  • 1
    Did you copy/paste the text into the editor from another source? Or write directly in it? – TheDeadMedic Feb 18 '15 at 11:56
  • I might have copied the text from an external source. I am no able to reproduce the problem anymore. Thanks! – Marc Feb 20 '15 at 8:19
  • Got it reproduced! You were correct @TheDeadMedic, this error happens when copying-pasting content from an external source. In my case, i was copying it from a pdf, probably exported from indesign or illustrator. – Marc Feb 20 '15 at 9:48
1

As @TheDeadMedic pointed out, I was copying-pasting text directly from an external source, and that is why the wrappers were in the tinymce as well.

Those divs in my case, were copied from a pdf that was probably exported from illustrator or indesign.

0

Usually, all those divs surround the the_content(); function. Theme developers use these divs to wrap the content that's going to be outputted by the the_content(); function.

Having those divs present there, makes it a whole lot easier to style the content that's coming out from the_content();

Bottom line: I don't think you should be removing those divs.

  • Thanks Cristian, but those divs were of no benefit to the markup. Even worse i found them nested inside one another. It was kind of messy. I'll com back if i reproduce the problem – Marc Feb 20 '15 at 8:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.