Regarding below snippet, now 2 or 3 lines of description is showing in blocks but I need when users click on this description line text it’s clickable and user redirected to the list.
Also in the end of line show this …
It means more …
add_filter(
'hivepress/v1/templates/listing_view_block/blocks',
function ($blocks, $template){
$listing = $template->get_context('listing');
if($listing && $listing->get_description()){
$description = $listing->get_description();
if ( strlen( $description ) > 240) {
$description = substr( $description, 0, 240 ).'...';
}
$blocks = hivepress()->helper->merge_trees(
[ 'blocks' => $blocks ],
[
'blocks' => [
'listing_content' => [
'blocks' => [
'custom_listing_description' => [
'type' => 'content',
'content' => '<p>'.$description.'</p>',
'_order' => 1000,
],
],
],
],
]
)['blocks'];
}
return $blocks;
},
1000,
2
);