Support

Account

Home Forums General Issues URL to public profil Reply To: URL to public profil

  • Thank you for your help, Following your indication, I did this with chatGPT, Here is my code:

    <? php if (is_user_logged_in()) { $user_id = get_current_user_id(); $custom_posts = get_posts(array( 'post_type' => 'profil', 'auteur' => $user_id, 'posts_per_page' => 1, )) ; si (! vide($custom_posts)) { $custom_post_url = get_permalink($custom_posts[0]->ID) ; ? > <a href="<? php echo esc_url($custom_post_url) ; ? >" class="mon-bouton">Voir mon profil</a> <? php } else { echo 'Vous n\'avez pas encore créé de profil.' ; } } else { echo 'Connectez-vous pour voir votre profil.' ; } ? >