Sur mon site wordpress, je souhaiterai ajouter un bouton partage en shortcode.
Sur ma page function.php j'ai :
Code : Tout sélectionner
function fond_mon_shortcode( ) {
$code_html = "<a target='_blank' style='margin-right:15px;' href='mailto:?subject=Fonds De Dotation vol de nuits - <?php the_title(); ?>&body=Voici un projet du Fonds De Dotation vol de nuits <?php the_permalink(); ?>' rel='nofollow' data-title='Envoyer par mail' title='Envoyer par mail'>Partager</a>";
";
return $code_html;
}
add_shortcode( 'fondshortcode', 'fond_mon_shortcode' );[fondshortcode]
Mais cela ne marche pas. Le mail ne s’écrit, ni avec le lien , ni avec le titre de la page...
Il y a un truc que je fais mal, mais je n'arrive pas à savoir quoi.. Savez-vous ?
Merci