Forums

Show "Log in to be able to post" message... (3 posts)

  1. mrosarionyc
    Member
    Posted 2 years ago #

    Is there a way to make WP to show a message to non users to log in to be able to to post? I would like to show this message in the homepage and it should disappear after the user logs in....

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Assuming you mean "log into post a comment", try adding:

    <?php if (get_option('comment_registration' && is_front_page()) && !$user_ID ) : ?><p class="login_msg">You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in</a> to post a comment.</p>
    <?php endif;?>

    to comments.php immediately before the comment form markup.

  3. mrosarionyc
    Member
    Posted 2 years ago #

    hi well... all im trying to do is to create like a sticky message that shows on the top of the main page... almost like a welcome message that explains whats the site about in a short sentence and then provide a link to let users subscribe to participate... then this message should disappear once they are logged in

Topic Closed

This topic has been closed to new replies.

About this Topic