admin管理员组

文章数量:1392066

My html markup is :

<div class="quote-wrapper">
<div class="quotes">MCSE boot camps have its supporters and its detractors. Some people do not understand why you should have</div>
</div>

how can show it by wordpress function.

Thank you

My html markup is :

<div class="quote-wrapper">
<div class="quotes">MCSE boot camps have its supporters and its detractors. Some people do not understand why you should have</div>
</div>

how can show it by wordpress function.

Thank you

Share Improve this question asked Feb 7, 2020 at 4:37 sampad debnathsampad debnath 11 bronze badge 1
  • Welcome. Could you please add more information like what exactly you want to have as a result? It is possible to edit the markup of contents in the edit page. – Hector Commented Feb 7, 2020 at 8:25
Add a comment  | 

1 Answer 1

Reset to default 0

You could paste this code directly into the Classic Editor, or into a Block Editor HTML block.

If you don't want to manually paste the full HTML in every time, you could either create a shortcode or a block that wraps this for you. Something like

<?php
// create shortcode [wpse_quote]
add_shortcode('wpse_quote', 'output_wpse_quote');
function output_wpse_quote($content = null) {
    // Wrap the content in divs
    return '<div class="quote-wrapper">
                <div class="quotes">' . do_shortcode($content) . '</div>
            </div>';
}
?>

In the Classic Editor, you would use the shortcode by typing an opening and closing shortcode in brackets, with the quote text between them:

[wpse_quote]Enter the quote text here.[/wpse_quote]

In the Block Editor, you would add a Shortcode Block and then paste that same text in. (Though if you're using the Block Editor, a block would probably be preferable, because then you can add the actual divs and style them so they look the same on in the Editor as they do on the front end.)

本文标签: customizationChange ltblockquotegt HTML markup on blog post