-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshortcodes.php
More file actions
58 lines (50 loc) · 2.13 KB
/
Copy pathshortcodes.php
File metadata and controls
58 lines (50 loc) · 2.13 KB
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
57
58
<?php
add_filter( 'the_content', 'remove_first_gallery' );
function remove_first_gallery( $content ) {
if(get_post_format($post->ID) == "gallery") {
$content = preg_replace('/\[gallery.*?\]/','',$content);
}
return $content;
}
function dropcap_shortcode( $atts, $content ){
$a = shortcode_atts( array(
'color' => '#111'
), $atts );
return '<span class="dropcap" style="color:' . $a['color'] .'">' . $content . '</span>';
}
add_shortcode( 'dropcap', 'dropcap_shortcode' );
function quote_shortcode( $atts, $content ){
$a = shortcode_atts( array(
'author' => ''
), $atts );
return '<div class="content-quote"><h1 class="quote-content">' . $content . '</h1><p class="quote-author">' . $a['author'] . '</p></div>';
}
add_shortcode( 'quote', 'quote_shortcode' );
function spacer_shortcode( $atts, $content ){
return '<div class="spacer">' . do_shortcode($content) . '</div>';
}
add_shortcode( 'spacer', 'spacer_shortcode' );
function smallspacer_shortcode( $atts, $content ){
return '<div class="smallspacer">' . do_shortcode($content) . '</div>';
}
add_shortcode( 'smallspacer', 'smallspacer_shortcode' );
function row_shortcode( $atts, $content ){
return '<div class="row">' . do_shortcode($content) . '</div>';
}
add_shortcode( 'row', 'row_shortcode' );
function column_shortcode( $atts, $content ){
$a = shortcode_atts( array(
'width' => '12'
), $atts );
return '<div class="col-sm-' . $a['width'] . '">' .do_shortcode($content) . '</div>';
}
add_shortcode( 'column', 'column_shortcode' );
function list_title_shortcode( $atts, $content ){
return '<span class="list-title">' . do_shortcode($content) . '</span>';
}
add_shortcode( 'list_title', 'list_title_shortcode' );
function fullsizemap_shortcode( $atts, $content ){
return '<div class="map_holder">' . do_shortcode($content) . '</div><div class="map_spacer"></div>';
}
add_shortcode( 'fullsizemap', 'fullsizemap_shortcode' );
?>