Search widget returns results that are not linked

Hello,

The search widget in the footer of my website returns results, but often times you cannot select the result to go to the appropriate page on the website. It simple appears a excerpt of text with an ellipsis at the end that does not contain a link. I unfortunately cannot include a link to the website as it currently on an internal server until we are ready to launch it.

Any insight into this would be greatly appreciated!

Thanks,
Danielle

Hello Danielle,

To change the ellipsis to a read more link, you’ll need to add the below function into child theme’s functions.php file. Or, you can use the functionality plugin like Code Snippets without a child theme.


function sydney_child_elipsis_link($content) {
	return str_replace('[&hellip;]', '<a href="'. esc_attr(get_permalink()) .'">Read more</a>', $content);
}
add_filter('the_excerpt', 'sydney_child_elipsis_link');

Regards,
Kharis

Hi Kahris,

Thank you so much for your help, adding the function into the php file worked perfectly!

Thanks,
Danielle

You’re welcome, Danielle.

Please let us know in a new topic if you have any further questions, or if we can provide you with any other assistance.

Regards,
Kharis