Created
March 9, 2018 06:39
-
-
Save gartmeier/c64bb25649f2d0f4f71dee899292deac to your computer and use it in GitHub Desktop.
Wordpress Snippet to show compensated links information
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if (count(get_the_category()) > 0): ?> | |
<?php | |
$german = false; | |
$cats = get_the_category(); | |
foreach ($cats as $cat) { | |
if ($cat->name == "Deutsch") { | |
$german = true; | |
break; | |
} | |
} | |
?> | |
<p class="compensated-links-info"> | |
<?php if ($german): ?> | |
Dieser Artikel kann kompensierte Links enthalten. Bitte lese unser <a href="/impressum/" target="_blank">Impressum</a> für weitere Informationen. | |
<?php else: ?> | |
This article may contain compensated links. Please read our <a href="/disclaimer/" target="_blank" title="Open Disclaimer">disclaimer</a> for more info. | |
<?php endif; ?> | |
</p> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add to
Apperance->Editor->Partials->content-single.php:86
before<?php the_content(); ?>