Blog Post Link on Different Language

I’m using <a href="<?= getPostUrl($post) ?>"</a> to link a blog post using a “Show More” Button. If I change language the button keep linking the post on the default language. How should I link the button to call the post on the specific language?


Where is the getPostUrl() function from? It isn’t included with Kirby.

You may want something like this:

<?php echo $page->url('de'); ?>


Maybe even the following is enough as you probably want to link to the currently active language:

<a href="<?php echo $post->url(); ?>"></a>
1 Like

Thank you, this worked perfect.

I believe this would link always to the same specific language. <?php echo $post->url(); ?> worked fine √. Thank you!