D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
stickain
/
davidsteele.com
/
wp-content
/
themes
/
flatsome
/
inc
/
shortcodes
/
Filename :
scroll_to.php
back
Copy
<?php function flatsome_scroll_to( $atts, $content = null ) { extract( shortcode_atts( array( 'bullet' => 'true', 'title' => 'Change this', 'link' => '', ), $atts ) ); if ( ! $title && ! $link ) { return false; } // Convert title to link if link is not set. if ( ! $link ) { $link = flatsome_to_dashed( $title ); } if ( substr( $link, 0, 1 ) !== '#' ) { $link = '#' . $link; } return '<span class="scroll-to" data-label="Scroll to: ' . $link . '" data-bullet="' . $bullet . '" data-link="' . $link . '" data-title="' . $title . '"><a name="' . str_replace( '#', '', $link ) . '"></a></span>'; } add_shortcode( 'scroll_to', 'flatsome_scroll_to' );