has_children = !empty($children_elements[$element->ID]); $element->classes[] = ($element->current || $element->current_item_ancestor) ? 'active' : ''; $element->classes[] = ($element->has_children) ? 'has-dropdown' : ''; parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output); } function start_lvl(&$output, $depth = 0, $args = array()) { $output .= "\n
';
}
return apply_filters( 'rescue_tribe_event_featured_image', $featured_image, $post_id, $size, $image_src );
}
endif;
/*----------------------------------------------------*/
/* Customize the_excerpt() Output and Length
/*----------------------------------------------------*/
if ( ! function_exists( 'rescue_excerpt_more' ) ) :
function rescue_excerpt_more( $more ) {
return ' ... ' . __('read more', 'advocator-lite' ) . '';
}
add_filter( 'excerpt_more', 'rescue_excerpt_more' );
endif;
if ( ! function_exists( 'rescue_excerpt_length' ) ) :
function rescue_excerpt_length( $length ) {
return 80;
}
add_filter( 'excerpt_length', 'rescue_excerpt_length', 999 );
endif;
/*----------------------------------------------------*/
/* Customize readmore link with a few more classes
/*----------------------------------------------------*/
if ( ! function_exists( 'rescue_readmore' ) ) :
function rescue_readmore($content) {
$pattern = "/class=\"more-link\"/";
$replacement = "class=\"more-link button tiny radius left clearfix\" ";
$content = preg_replace($pattern, $replacement, $content);
return $content;
}
add_action('the_content', 'rescue_readmore');
endif;
/*----------------------------------------------------*/
/* Prints HTML with meta information for the current post-date/time.
/*----------------------------------------------------*/
if ( ! function_exists( 'rescue_posted_on' ) ) :
function rescue_posted_on() {
$time_string = '';
// if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
// $time_string .= '';
// }
$time_string = sprintf( $time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( 'c' ) ),
esc_html( get_the_modified_date() )
);
// printf( __( 'Published %1$s by %2$s', 'advocator-lite' ),
printf( __( 'Published %1$s', 'advocator-lite' ),
sprintf( '%2$s',
esc_url( get_permalink() ),
$time_string
),
sprintf( '%2$s',
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_html( get_the_author() )
)
);
}
endif;
/*----------------------------------------------------*/
/* Template for comments and pingbacks.
/*----------------------------------------------------*/
if ( ! function_exists( 'rescue_comments' ) ) :
function rescue_comments( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case '' :
?>
user_id, 'administrator' ) ) : ?> $depth, 'max_depth' => $args['max_depth']))) ?>
comment_approved == '0') : ?>