Breadcrumbs - wrong link

Hi,

When at a post page like this one: https://www.vesti-olsen.dk/ny-ordre-steiness-liftcenter-aps/ - and clicking on “NYHEDER” (News) in the breadcrumbs, I’m landing on my frontpage? How can I change that, so when clicking on “NYHEDER” I land on: https://www.vesti-olsen.dk/nyheder/?

Hi There,

It seem you didn’t set a Posts Page yet. You’re using the page template as blog instead.

To fix this issue, please install and activate the child theme first:

After that add this custom code under functions.php file locates in your child theme:

add_filter('x_breadcrumbs_data', 'post_parent_trail', 9999999, 2);
function post_parent_trail ($crumbs, $args) {
	if ( is_singular('post') ) {
		$crumbs[1]['url'] = "https://www.vesti-olsen.dk/nyheder/";
	}
	return $crumbs;  
}

Hope it helps :slight_smile:

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.