I’ve also changed the title tag.
Now it looks like that:
add_filter('crp_list_link','modify_output', 10, 3);
function modify_output( $output, $result, $args ) {
$link = get_permalink( $result->ID );
$post_format = get_post_format( $result->ID );
if (!$post_format) $post_format = 'standard';
$output = '';
$title = crp_title( $args, $result );
$link = crp_permalink( $args, $result );
$link_attributes = crp_link_attributes( $args );
$output .= '<a href="' . $link . '" ' . $link_attributes . ' class="crp_link format-' . $post_format . ' ' . $result->post_type . '-' . $result->ID . '">';
if ( 'after' === $args['post_thumb_op'] ) {
$output .= '<h3 class="crp_title">' . $title . '</h3>'; // Add title when required by settings.
}
if ( 'inline' === $args['post_thumb_op'] || 'after' === $args['post_thumb_op'] || 'thumbs_only' === $args['post_thumb_op'] ) {
$output .= '<figure>';
$output .= crp_get_the_post_thumbnail(
array(
'postid' => $result,
'thumb_height' => $args['thumb_height'],
'thumb_width' => $args['thumb_width'],
'thumb_meta' => $args['thumb_meta'],
'thumb_html' => $args['thumb_html'],
'thumb_default' => $args['thumb_default'],
'thumb_default_show' => $args['thumb_default_show'],
'scan_images' => $args['scan_images'],
'class' => 'crp_thumb',
)
);
$output .= '</figure>';
}
if ( 'inline' === $args['post_thumb_op'] || 'text_only' === $args['post_thumb_op'] ) {
$output .= '<h3 class="crp_title">' . $title . '</h3>'; // Add title when required by settings.
}
$output .= '</a>';
return $output;
}
Better approach maybe?