Skip to Content
Menu

divider_shortcode()

Create a horizontal line

WordPress June 20, 2017

Usage

WordPress
[line space]

Parameters

space
(Optional) (Integer) The amount of space above and below the line
Default: None

Request or provide clarification »

Examples

WordPress
[line space=5]
Was this page helpful? Yes No


    A feedback message is required to submit this form.


    Please check that you have entered a valid email address.

    Enter your email address if you would like a response.

    Thank you for your feedback!

    Source File

    Located in /libs/Shortcodes.php on line 209.

    WordPress
            public function divider_shortcode($atts){
                extract(shortcode_atts(array("space" => '0', "above" => '0', "below" => '0'), $atts));
    
                $divider = '<hr class="nebula-divider" />';
                if ( $space ) {
                    $above = $space;
                    $below = $space;
                    $divider = '<hr class="nebula-divider" style="' . esc_attr('margin-top: ' . $above . 'px; margin-bottom: ' . $below . 'px;') . '"/>';
                }
    
                return $divider;
            }
    

    Override

    To override or disable this shortcode, use add_shortcode() to declare the shortcode first.