-1

I have HTML template for output from the_content() function. It contains elements with custom classes such as <blockquote>, headings or paragraphs.

<p class="mb-40">Nemo enim ipsam voluptatem quia voluptas sit
    aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione
    voluptatem
    sequi nesciunt. 
</p>

<blockquote class="mb-40 bg-white">
    <i class="zmdi zmdi-quote"></i>
    <p class="mb-0">
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget mag
        dolor. Cum sociis natoque penatibus
        et magnis dis parturient montes nascetur ridiculus ru mus. Do quam felis ultricies nec
        pellentesque eu pretium quis sem. </p>
</blockquote>
3
  • 1
    What is it you need help with? You should be able to paste this straight into the Editor in code/text view.
    – WebElaine
    May 14, 2020 at 18:43
  • There is no option to pre-format HTML elements?
    – Juraj
    May 14, 2020 at 18:47
  • What do you mean, pre-format? As Bob answered, you can usually just target elements by their existing markup, without having to add classes. But in both the Classic Editor and the Block Editor, you can add the classes in the Editor if you really have a need to.
    – WebElaine
    May 15, 2020 at 14:51

1 Answer 1

0

This sounds like something that should be handled in CSS without using classes, for examples

article blockquote {
  background-color: #fff;
}

Instead of adding .bg-white to the HTML tag. If you really want to add custom classes you could use a filter or get_the_content() and parse it manually.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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