How to dispay form in comment.php if user is not logged in
-
Hi there,
I think my question is quite simple, the answer though is beyond my knowledge.How to include theme_my_login() just after “Il suffit de se connecter pour accéder au formulaire.”
<?php $aria_req = ( $req ? " aria-required='true'" : '' ); $args = array( 'id_form' => 'commentform', 'id_submit' => 'submit', 'title_reply' => __( '* Je peux apporter une solution' ), 'title_reply_to' => __( 'Je peux répondre à %s' ), 'cancel_reply_link' => __( 'Cancel Reply' ), 'label_submit' => __( 'Je partage!' ), 'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( 'Solution(s), critiques, témoignage:', 'noun' ) . '</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true">' . '</textarea></p>', 'must_log_in' => '<p class="must-log-in">' . sprintf( __( 'Il suffit de <a href="%s">se connecter</a> pour accéder au formulaire.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink() ) ) ) . '</p>', 'logged_in_as' => '<p>' . sprintf( __( 'Connecté en tant que <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Me déconnecter?</a>' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( ) ) ) ) . '</p>', 'comment_notes_before' => '<p class="comment-notes">' . __( 'Your email address will not be published.' ) . ( $req ? $required_text : '' ) . '</p>', etc.
So far the following adaptation, is the closest I have to what I want but it displays the tml form wether the user is connected or not… not really what I am trying to do:
<?php $aria_req = ( $req ? " aria-required='true'" : '' ); $args = array( 'id_form' => 'commentform', 'id_submit' => 'submit', 'title_reply' => __( '* Je peux apporter une solution' ), 'title_reply_to' => __( 'Je peux répondre à %s' ), 'cancel_reply_link' => __( 'Cancel Reply' ), 'label_submit' => __( 'Je partage!' ), 'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( 'Solution(s), critiques, témoignage:', 'noun' ) . '</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true">' . '</textarea></p>', 'must_log_in' => '<p class="must-log-in">' . sprintf( __( 'Il suffit de <a href="%s">se connecter</a> pour accéder au formulaire.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink() ) ) ) . '</p><div="connectform">' . theme_my_login() . '</div>', 'logged_in_as' => '<p>' . sprintf( __( 'Connecté en tant que <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Me déconnecter?</a>' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( ) ) ) ) . '</p>',
I hope somebody will be up to help me (and maybe others)
Many thanks in advance,
Yours Sincerely,
Tche
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘How to dispay form in comment.php if user is not logged in’ is closed to new replies.