• August 12, 2018

    +https://wordpress.stackexchange.com/questions/101883/multiple-block-quotes-without-using-html

    1.make a shortcode unsing add_shortcode(functions.php)

    add_shortcode('bquote','ravs_blockquotes_func')    
        function ravs_blockquotes_func( $atts, $content="" ) {
                 extract( shortcode_atts( array(
                      'style' => 'style1'
                 ), $atts ) );
            return '<blockquote class="'.$style.'">'.$content.'</blockquote>' 
            }

    2.now just simply define quote in shortcode(post or page editer)

    [bquote style="style2"]your quote[/bquote]

    it’s output in html like

    <blockquote class="style2">your quote</blockquote>

    3.create as many as class for blockquote style you want.it’s easy to use and understand.

    Custom <blockquote> HTML markup

    Put this in your functions.php:

    add_shortcode('my_blockquote', 'my_blockquote');
    function my_blockquote($atts, $content) {
        return '<div class="span3 quote well">'.PHP_EOL
            .'<i class="icon-quote-left icon-2x pull-left icon-muted"></i>'.PHP_EOL
            .'<blockquote class="lead">'.$content.'</blockquote>'.PHP_EOL
            .'</div>';
    }

    Then, on a page/post, just write:

    [my_blockquote]Content goes here…[/my_blockquote]

    and that’s it.


    // EDIT: To add a quicktag button, put this also in functions.php:

    function add_blockquote_quicktag() {
    ?>
        <script type="text/javascript">
        QTags.addButton( 'my_blockquote', 'B', '[my_blockquote]', '[/my_blockquote]', 'B', 'My blockquote', 1 );
        </script>
    <?php
    }
    add_action( 'admin_print_footer_scripts', 'add_blockquote_quicktag' );


เวอไนน์ไอคอร์ส

ประหยัดเวลากว่า 100 เท่า!






เวอไนน์เว็บไซต์⚡️
สร้างเว็บไซต์ ดูแลเว็บไซต์

Categories


Uncategorized