This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
remove_filter( 'pre_term_description', 'wp_filter_kses' ); | |
remove_filter( 'pre_link_description', 'wp_filter_kses' ); | |
remove_filter( 'pre_link_notes', 'wp_filter_kses' ); | |
remove_filter( 'term_description', 'wp_kses_data' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function search_excerpt_highlight( $limit ) { | |
$excerpt = get_the_excerpt(); | |
$excerpt = explode(' ', get_the_excerpt(), $limit); | |
if ( count( $excerpt ) >= $limit ) { | |
array_pop( $excerpt ); | |
$excerpt = implode(' ', $excerpt); | |
} else { | |
$excerpt = implode(' ', $excerpt); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function roots_nice_search_redirect() { | |
global $wp_rewrite; | |
if (!isset($wp_rewrite) || !is_object($wp_rewrite) || !$wp_rewrite->using_permalinks()) { | |
return; | |
} | |
$search_base = $wp_rewrite->search_base; | |
if (is_search() && !is_admin() && strpos($_SERVER['REQUEST_URI'], "/{$search_base}/") === false) { | |
wp_redirect(home_url("/{$search_base}/" . urlencode(get_query_var('s')))); | |
exit(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wordcount() { | |
ob_start(); | |
the_content(); | |
$postcontent = ob_get_clean(); | |
return sizeof(explode(" ", $postcontent)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class comment_walker extends Walker_Comment { | |
var $tree_type = 'comment'; | |
var $db_fields = array( 'parent' => 'comment_parent', 'id' => 'comment_ID' ); | |
// constructor – wrapper for the comments list | |
function __construct() { ?> | |
<section class="comments-list"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// awesome semantic comment | |
function better_comment($comment, $args, $depth) { | |
$GLOBALS['comment'] = $comment; | |
extract($args, EXTR_SKIP); | |
if ( 'article' == $args['style'] ) { | |
$tag = 'article'; | |
$add_below = 'comment'; | |
} else { |