/var/www/(Del)hsihk.com/wp-content/themes/flatsome/inc/shortcodes/titles_dividers.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
// [title]
function title_shortcode$atts$content null ){
  
extractshortcode_atts( array(
    
'text' => '',
    
'style' => '',
    
'link' => '',
    
'link_text' => ''
  
), $atts ) );

  
$link_output '';
  
$style_output ='';
  if(
$style$style_output 'title_'.$style;
  if(
$link$link_output '<a href="'.$link.'">'.$link_text.'</a>';
  
$after_title '';
  
$align '';
  if(
$style == 'divided'){ $after_title '<div class="tx-div medium"></div>'$align 'text-center'; };

return 
'<h3 class="section-title clearfix '.$style_output.' '.$align.'"><span>'.$atts['text'].'</span> '.$link_output.' '.$after_title.'</h3><!-- end section_title -->';

}
add_shortcode('title''title_shortcode');


// [divider]
function divider_shortcode$atts$content null ){
  
extractshortcode_atts( array(
    
'width' => 'small',
    
'height' => '',
    
'align' => 'left'
  ), 
$atts ) );

if(
$height$height 'style="height:'.$height.'"';

$align_end ='';
$align_start '';
if(
$align == 'center'){
  
$align_start ='<div class="text-center">';
  
$align_end '</div>';
}

return 
$align_start.'<div class="tx-div '.$width.' clearfix" '.$height.'"></div>'.$align_end.'<!-- end divider -->';

}
add_shortcode('divider''divider_shortcode');

// [gap]
function ux_gap_shortcode$atts$content null ){
  
extractshortcode_atts( array(
    
'height' => '30px',
  ), 
$atts ) );

return 
'<div style="display:block;height:'.$height.'" class="clearfix"></div>';

}
add_shortcode('gap''ux_gap_shortcode');