Quantcast
Channel: polylang – WordPress.org Forums
Viewing all articles
Browse latest Browse all 11471

Dexeryl on "Polylang - different a href link on each page."

$
0
0

I also tried to make it through functions because i can also set one pdf file in theme options.
functions.php:

$pdf = of_get_option('pdf_file');
pll_register_string('pdf', $pdf);

template page:

<a href="<?pll_e($pdf); ?>" ><?pll_e("Download PDF", "sitex"); ?></a>

It doesn't show the pdf.
AND OTHER METHOD
template page:

<?php
	$currentlang = get_bloginfo('language');
	if($currentlang=="Locale"):
?>
<a href="http://example.com/wp-content/uploads/2014/09/FileA.pdf"><?php_e("Download PDF", "sitex"); ?></a>
<?php else: ?>
<a href="http://example.com/wp-content/uploads/2014/09/FileB.pdf"><?php_e("GET PDF", "sitex"); ?></a>
<?php endif; ?>

But still it doesn't work.


Viewing all articles
Browse latest Browse all 11471

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>