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?
<a href="<?= getPostUrl($post) ?>"</a>
Thanks!
Where is the getPostUrl() function from? It isn’t included with Kirby.
getPostUrl()
You may want something like this:
<?php echo $page->url('de'); ?>
See http://getkirby.com/docs/cheatsheet/page/url
Maybe even the following is enough as you probably want to link to the currently active language:
<a href="<?php echo $post->url(); ?>"></a>
Thank you, this worked perfect.
I believe this would link always to the same specific language. <?php echo $post->url(); ?> worked fine √. Thank you!