Skip to content

Instantly share code, notes, and snippets.

@hostz-frank
Last active January 17, 2020 08:52
Show Gist options
  • Save hostz-frank/50637e3851a6ff6a027ec2958cdcf055 to your computer and use it in GitHub Desktop.
Save hostz-frank/50637e3851a6ff6a027ec2958cdcf055 to your computer and use it in GitHub Desktop.
Sprachweiche im Child-Template
<?php
/**
* Angebot-Nachfrage-Buttons nach Sprache ausgeben.
*/
add_action( 'wp_footer', function() {
if( get_locale() == 'de_DE' ) { ?>
<a href="/angebote/" class="sticky-divi-button">Angebote</a>
<a href="/anfrage/" class="sticky-divi-button-2">Anfragen</a>
<?php } elseif( get_locale() == 'it' ) { ?>
<a href="/it/offerta/" class="sticky-divi-button">Offerta</a>
<a href="/it/richiesta/" class="sticky-divi-button-2">Richiesta</a>
<?php }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment