![]()
J’avais pour besoin de créer un shortcode me permettant d’afficher le lien d’un article WordPress. Pour cela, voici le code que j’ai ajouté dans mon fichier functions.php : add_shortcode( 'my_permalink', 'my_permalink' ); // The Permalink Shortcode function my_permalink() { ob_start(); the_permalink(); return ob_get_clean(); } Et il n’y avait plus qu’à utiliser le shortcode [my_permalink] pour ...