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>
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>
Share
Improve this question
asked May 14, 2020 at 18:38
JurajJuraj
1542 silver badges11 bronze badges
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 Commented May 14, 2020 at 18:43
- There is no option to pre-format HTML elements? – Juraj Commented 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 Commented May 15, 2020 at 14:51
1 Answer
Reset to default 0This 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.