-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.php
53 lines (33 loc) · 1.21 KB
/
search.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
<?php
// Modify the search page markup
add_action( 'beans_before_load_document', 'j0e_search_setup_document' );
function j0e_search_setup_document() {
// Post
beans_add_attribute( 'beans_content', 'class', 'uk-article' );
beans_add_attribute( 'beans_post_title', 'class', 'uk-h2' );
beans_add_attribute( 'beans_post', 'class', 'uk-grid-margin' );
// Post image
beans_remove_action( 'beans_post_image' );
// Post meta
beans_remove_action( 'beans_post_meta_tags' );
beans_remove_action( 'beans_post_meta_categories' );
// Remove article search
beans_remove_output( 'beans_no_post_search_form' );
}
// Add the search form
add_action( 'beans_search_title_after_markup', 'j0e_search_field' );
function j0e_search_field( $content ) {
?><div class="uk-grid-margin"><?php
get_search_form();
?></div><?php
}
// Clean up the search results item markup
add_action( 'the_content', 'j0e_search_content' );
function j0e_search_content( $content ) {
$output = "<p>";
$output .= beans_output( 'j0e_search_post_content', substr( strip_tags( $content ), 0, 150 ) . ' ...' );
$output .= "</p>";
return $output;
}
// Load beans document.
beans_load_document();