I can't seem to work my way around this: I have included a string translation into my functions.php
file, Polylang registered it in the admin panel and I have added my translations for both Croatian and English.
When using the pll_e('saznaj-vise')
function the output is fine in both languages (Saznaj Više and Read More), however when I include this string translation into my function modify_read_more_link()
it does not display the permalink to the post/page, just static text above the content.
My code in functions.php
looks like this:
function modify_read_more_link() {
return '<a href="' . get_permalink() . '">' . pll_e('saznaj-vise') . '</a>';
{
add_filter( 'the_content_more_link', 'modify_read_more_link' );
pll_register_string('read-more', 'saznaj-vise', 'Wordpress');
The code inside the loop (for displaying a page) looks like this:
<div>
<?php global $more; $more = 0; ?>
<p>
<?php the_content(pll_get_post(5)); ?>
</p>
What I would like is that my string translation becomes a permalink to the post/page on the desired cutoff, as usual in WordPress. I'd really appreciate some help. Thank you!